예제 #1
0
        private void fill_users(AutoSuggestBox sender, AutoSuggestBoxTextChangedEventArgs args)
        {
            if (args.Reason == AutoSuggestionBoxTextChangeReason.UserInput)
            {
                if (sender.Text.Length > 0)
                    sender.ItemsSource = GetSuggestions(sender.Text);
                else
                {
                    sender.ItemsSource = new[] {"No suggestions..."};

                    sender.Background = (sender.Text == "")
                        ? new SolidColorBrush(Colors.PaleVioletRed)
                        : new SolidColorBrush(Colors.White);
                    sender.UpdateLayout();

                }

            }
        }