diff --git a/Sample Applications/DataBindingDemo/MainWindow.cs b/Sample Applications/DataBindingDemo/MainWindow.cs index 6132bc68..cac82a3f 100644 --- a/Sample Applications/DataBindingDemo/MainWindow.cs +++ b/Sample Applications/DataBindingDemo/MainWindow.cs @@ -1,8 +1,11 @@ // // Copyright (c) Microsoft. All rights reserved. // // Licensed under the MIT license. See LICENSE file in the project root for full license information. +using System.Collections.Specialized; using System.ComponentModel; using System.Windows; +using System.Windows.Automation; +using System.Windows.Automation.Peers; using System.Windows.Data; namespace DataBindingDemo @@ -41,11 +44,21 @@ private void AddGrouping(object sender, RoutedEventArgs args) // This groups the items in the view by the property "Category" var groupDescription = new PropertyGroupDescription {PropertyName = "Category"}; _listingDataView.GroupDescriptions.Add(groupDescription); + + NotifyUpdate(); + + } + + private void NotifyUpdate() + { + var listingPeer = ListBoxAutomationPeer.FromElement(Master); + listingPeer.RaiseAutomationEvent(AutomationEvents.LiveRegionChanged); } private void RemoveGrouping(object sender, RoutedEventArgs args) { _listingDataView.GroupDescriptions.Clear(); + NotifyUpdate(); } private void AddSorting(object sender, RoutedEventArgs args) @@ -57,21 +70,26 @@ private void AddSorting(object sender, RoutedEventArgs args) new SortDescription("Category", ListSortDirection.Ascending)); _listingDataView.SortDescriptions.Add( new SortDescription("StartDate", ListSortDirection.Ascending)); + NotifyUpdate(); } private void RemoveSorting(object sender, RoutedEventArgs args) { _listingDataView.SortDescriptions.Clear(); + NotifyUpdate(); } private void AddFiltering(object sender, RoutedEventArgs args) { _listingDataView.Filter += ShowOnlyBargainsFilter; + NotifyUpdate(); } private void RemoveFiltering(object sender, RoutedEventArgs args) { _listingDataView.Filter -= ShowOnlyBargainsFilter; + NotifyUpdate(); } } -} \ No newline at end of file + +}