public AutoComplete() { AutoCompleteBox = new TextBox { HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Center }; AutoCompleteBehavior.SetAutoCompleteStringComparison(AutoCompleteBox, StringComparison.OrdinalIgnoreCase); AutoCompletePopup = new Popup { Child = AutoCompleteBox, StaysOpen = false, Placement = PlacementMode.Center }; AutoCompleteBox.PreviewKeyDown += AutoCompleteBox_PreviewKeyDown; AutoCompleteBox.PreviewTextInput += AutoCompleteBox_PreviewTextInput; }
public void SetUp() { UITester.Init(typeof(Utils.Net.Sample.App)); UITester.Dispatcher.Invoke(() => UITester.Get <ComboBox>().SelectedItem = "ListPage"); System.Threading.Thread.Sleep(100); testTextBox = UITester.Get <TextBox>(); UITester.Dispatcher.Invoke(() => { testBehavior = new AutoCompleteBehavior { ItemsSource = testAutoCompleteList, StringComparison = System.StringComparison.InvariantCultureIgnoreCase }; testBehavior.Attach(testTextBox); }); }
private void OnItemsSourceChanged(IEnumerable <string> items) { AutoCompleteBehavior.SetAutoCompleteItemsSource(AutoCompleteBox, items); }