Пример #1
0
        private static void OnNoResultsTemplatePropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
        {
            SearchTextBox searchTextBox = (SearchTextBox)sender;

            if (!string.IsNullOrEmpty(searchTextBox.NoResultsMessage) && args.NewValue != null)
            {
                throw new Exception("Cannot set both NoResultsMessage and NoResultsTemplate.");
            }
        }
Пример #2
0
        private static void OnSearchingMessagePropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
        {
            SearchTextBox searchTextBox = (SearchTextBox)sender;

            if (!string.IsNullOrEmpty((string)args.NewValue) && searchTextBox.SearchingTemplate != null)
            {
                throw new Exception("Cannot set both SearchingMessage and SearchingTemplate.");
            }
        }