Пример #1
0
        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;
        }
Пример #2
0
        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);
            });
        }
Пример #3
0
 private void OnItemsSourceChanged(IEnumerable <string> items)
 {
     AutoCompleteBehavior.SetAutoCompleteItemsSource(AutoCompleteBox, items);
 }