Skip to content

Commit 58a3cde

Browse files
committed
rename Query -> QueryText everywhere
1 parent 9d4809c commit 58a3cde

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/RichSuggestBox/RichSuggestBoxPage.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,12 @@ private void SuggestingBox_OnSuggestionsRequested(RichSuggestBox sender, Suggest
180180
if (args.Prefix == "#")
181181
{
182182
sender.ItemsSource =
183-
this._samples.Where(x => x.Text.Contains(args.Query, StringComparison.OrdinalIgnoreCase));
183+
this._samples.Where(x => x.Text.Contains(args.QueryText, StringComparison.OrdinalIgnoreCase));
184184
}
185185
else
186186
{
187187
sender.ItemsSource =
188-
this._emailSamples.Where(x => x.DisplayName.Contains(args.Query, StringComparison.OrdinalIgnoreCase));
188+
this._emailSamples.Where(x => x.DisplayName.Contains(args.QueryText, StringComparison.OrdinalIgnoreCase));
189189
}
190190
}
191191
}

Microsoft.Toolkit.Uwp.UI.Controls.Input/RichSuggestBox/RichSuggestBox.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ private async Task RequestSuggestionsAsync(ITextRange range = null)
516516
using var tokenSource = new CancellationTokenSource();
517517
_suggestionRequestedCancellationSource = tokenSource;
518518
var cancellationToken = tokenSource.Token;
519-
var eventArgs = new SuggestionsRequestedEventArgs { Query = query, Prefix = prefix };
519+
var eventArgs = new SuggestionsRequestedEventArgs { QueryText = query, Prefix = prefix };
520520
try
521521
{
522522
await SuggestionsRequested.InvokeAsync(this, eventArgs, cancellationToken);
@@ -559,7 +559,7 @@ internal async Task CommitSuggestionAsync(object selectedItem)
559559
{
560560
Id = id,
561561
Prefix = prefix,
562-
Query = query,
562+
QueryText = query,
563563
SelectedItem = selectedItem,
564564
Text = query,
565565
Format = CreateTokenFormat(range)

Microsoft.Toolkit.Uwp.UI.Controls.Input/RichSuggestBox/SuggestionChosenEventArgs.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class SuggestionChosenEventArgs : DeferredEventArgs
1616
/// <summary>
1717
/// Gets the query used for this token.
1818
/// </summary>
19-
public string Query { get; internal set; }
19+
public string QueryText { get; internal set; }
2020

2121
/// <summary>
2222
/// Gets the prefix character used for this token.

Microsoft.Toolkit.Uwp.UI.Controls.Input/RichSuggestBox/SuggestionsRequestedEventArgs.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ public class SuggestionsRequestedEventArgs : DeferredCancelEventArgs
1919
/// <summary>
2020
/// Gets or sets the query for suggestions.
2121
/// </summary>
22-
public string Query { get; set; }
22+
public string QueryText { get; set; }
2323
}
2424
}

UITests/UITests.Tests.Shared/Controls/RichSuggestBoxTestPage.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ private void RichSuggestBox_OnSuggestionsRequested(RichSuggestBox sender, Sugges
2727

2828
private void RichSuggestBox_OnSuggestionsChosen(RichSuggestBox sender, SuggestionChosenEventArgs args)
2929
{
30-
args.Text = args.Query + (string)args.SelectedItem;
30+
args.Text = args.QueryText + (string)args.SelectedItem;
3131
}
3232
}
3333
}

UnitTests/UnitTests.UWP/UI/Controls/Test_RichSuggestBox.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,15 +236,15 @@ void SuggestionsRequestedHandler(RichSuggestBox sender, SuggestionsRequestedEven
236236
{
237237
suggestionsRequestedCalled = true;
238238
Assert.AreEqual(tokenText[0].ToString(), args.Prefix, $"Unexpected prefix in {nameof(RichSuggestBox.SuggestionsRequested)}.");
239-
Assert.AreEqual(tokenText.Substring(1), args.Query, $"Unexpected query in {nameof(RichSuggestBox.SuggestionsRequested)}.");
239+
Assert.AreEqual(tokenText.Substring(1), args.QueryText, $"Unexpected query in {nameof(RichSuggestBox.SuggestionsRequested)}.");
240240
}
241241

242242
void SuggestionChosenHandler(RichSuggestBox sender, SuggestionChosenEventArgs args)
243243
{
244244
suggestionChosenCalled = true;
245245
Assert.AreEqual(tokenText[0].ToString(), args.Prefix, $"Unexpected prefix in {nameof(RichSuggestBox.SuggestionChosen)}.");
246-
Assert.AreEqual(tokenText.Substring(1), args.Query, $"Unexpected query in {nameof(RichSuggestBox.SuggestionChosen)}.");
247-
Assert.AreEqual(args.Query, args.Text, $"Unexpected display text in {nameof(RichSuggestBox.SuggestionChosen)}.");
246+
Assert.AreEqual(tokenText.Substring(1), args.QueryText, $"Unexpected query in {nameof(RichSuggestBox.SuggestionChosen)}.");
247+
Assert.AreEqual(args.QueryText, args.Text, $"Unexpected display text in {nameof(RichSuggestBox.SuggestionChosen)}.");
248248
Assert.AreSame(tokenText, args.SelectedItem, $"Selected item has unknown object {args.SelectedItem} in {nameof(RichSuggestBox.SuggestionChosen)}.");
249249
}
250250

0 commit comments

Comments
 (0)