11// // Copyright (c) Microsoft. All rights reserved.
22// // Licensed under the MIT license. See LICENSE file in the project root for full license information.
33
4+ using System . Collections . Specialized ;
45using System . ComponentModel ;
56using System . Windows ;
7+ using System . Windows . Automation ;
8+ using System . Windows . Automation . Peers ;
69using System . Windows . Data ;
710
811namespace DataBindingDemo
@@ -41,11 +44,21 @@ private void AddGrouping(object sender, RoutedEventArgs args)
4144 // This groups the items in the view by the property "Category"
4245 var groupDescription = new PropertyGroupDescription { PropertyName = "Category" } ;
4346 _listingDataView . GroupDescriptions . Add ( groupDescription ) ;
47+
48+ NotifyUpdate ( ) ;
49+
50+ }
51+
52+ private void NotifyUpdate ( )
53+ {
54+ var listingPeer = ListBoxAutomationPeer . FromElement ( Master ) ;
55+ listingPeer . RaiseAutomationEvent ( AutomationEvents . LiveRegionChanged ) ;
4456 }
4557
4658 private void RemoveGrouping ( object sender , RoutedEventArgs args )
4759 {
4860 _listingDataView . GroupDescriptions . Clear ( ) ;
61+ NotifyUpdate ( ) ;
4962 }
5063
5164 private void AddSorting ( object sender , RoutedEventArgs args )
@@ -57,21 +70,26 @@ private void AddSorting(object sender, RoutedEventArgs args)
5770 new SortDescription ( "Category" , ListSortDirection . Ascending ) ) ;
5871 _listingDataView . SortDescriptions . Add (
5972 new SortDescription ( "StartDate" , ListSortDirection . Ascending ) ) ;
73+ NotifyUpdate ( ) ;
6074 }
6175
6276 private void RemoveSorting ( object sender , RoutedEventArgs args )
6377 {
6478 _listingDataView . SortDescriptions . Clear ( ) ;
79+ NotifyUpdate ( ) ;
6580 }
6681
6782 private void AddFiltering ( object sender , RoutedEventArgs args )
6883 {
6984 _listingDataView . Filter += ShowOnlyBargainsFilter ;
85+ NotifyUpdate ( ) ;
7086 }
7187
7288 private void RemoveFiltering ( object sender , RoutedEventArgs args )
7389 {
7490 _listingDataView . Filter -= ShowOnlyBargainsFilter ;
91+ NotifyUpdate ( ) ;
7592 }
7693 }
77- }
94+
95+ }
0 commit comments