1
1
// // Copyright (c) Microsoft. All rights reserved.
2
2
// // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
3
4
+ using System . Collections . Specialized ;
4
5
using System . ComponentModel ;
5
6
using System . Windows ;
7
+ using System . Windows . Automation ;
8
+ using System . Windows . Automation . Peers ;
6
9
using System . Windows . Data ;
7
10
8
11
namespace DataBindingDemo
@@ -41,11 +44,21 @@ private void AddGrouping(object sender, RoutedEventArgs args)
41
44
// This groups the items in the view by the property "Category"
42
45
var groupDescription = new PropertyGroupDescription { PropertyName = "Category" } ;
43
46
_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 ) ;
44
56
}
45
57
46
58
private void RemoveGrouping ( object sender , RoutedEventArgs args )
47
59
{
48
60
_listingDataView . GroupDescriptions . Clear ( ) ;
61
+ NotifyUpdate ( ) ;
49
62
}
50
63
51
64
private void AddSorting ( object sender , RoutedEventArgs args )
@@ -57,21 +70,26 @@ private void AddSorting(object sender, RoutedEventArgs args)
57
70
new SortDescription ( "Category" , ListSortDirection . Ascending ) ) ;
58
71
_listingDataView . SortDescriptions . Add (
59
72
new SortDescription ( "StartDate" , ListSortDirection . Ascending ) ) ;
73
+ NotifyUpdate ( ) ;
60
74
}
61
75
62
76
private void RemoveSorting ( object sender , RoutedEventArgs args )
63
77
{
64
78
_listingDataView . SortDescriptions . Clear ( ) ;
79
+ NotifyUpdate ( ) ;
65
80
}
66
81
67
82
private void AddFiltering ( object sender , RoutedEventArgs args )
68
83
{
69
84
_listingDataView . Filter += ShowOnlyBargainsFilter ;
85
+ NotifyUpdate ( ) ;
70
86
}
71
87
72
88
private void RemoveFiltering ( object sender , RoutedEventArgs args )
73
89
{
74
90
_listingDataView . Filter -= ShowOnlyBargainsFilter ;
91
+ NotifyUpdate ( ) ;
75
92
}
76
93
}
77
- }
94
+
95
+ }
0 commit comments