File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
Microsoft.Toolkit.Uwp.UI/Helpers
UnitTests/UnitTests.XamlIslands.UWPApp Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -79,23 +79,26 @@ public ThemeListener(DispatcherQueue dispatcherQueue = null)
79
79
}
80
80
}
81
81
82
- private void Accessible_HighContrastChanged ( AccessibilitySettings sender , object args )
82
+ private async void Accessible_HighContrastChanged ( AccessibilitySettings sender , object args )
83
83
{
84
84
#if DEBUG
85
85
System . Diagnostics . Debug . WriteLine ( "HighContrast Changed" ) ;
86
86
#endif
87
87
88
- UpdateProperties ( ) ;
88
+ await OnThemePropertyChangedAsync ( ) ;
89
89
}
90
90
91
91
// Note: This can get called multiple times during HighContrast switch, do we care?
92
92
private async void Settings_ColorValuesChanged ( UISettings sender , object args )
93
93
{
94
- await OnColorValuesChanged ( ) ;
94
+ await OnThemePropertyChangedAsync ( ) ;
95
95
}
96
96
97
- // Internal abstraction is used by the Unit Tests
98
- internal Task OnColorValuesChanged ( )
97
+ /// <summary>
98
+ /// Dispatches an update for the public properties and the firing of <see cref="ThemeChanged"/> on <see cref="DispatcherQueue"/>.
99
+ /// </summary>
100
+ /// <returns>A <see cref="Task"/> that indicates when the dispatching has completed.</returns>
101
+ internal Task OnThemePropertyChangedAsync ( )
99
102
{
100
103
// Getting called off thread, so we need to dispatch to request value.
101
104
return DispatcherQueue . EnqueueAsync (
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ public Task Init()
39
39
[ TestMethod ]
40
40
public async Task ThemeListenerDispatcherTestAsync ( )
41
41
{
42
- await _themeListener . OnColorValuesChanged ( ) ;
42
+ await _themeListener . OnThemePropertyChangedAsync ( ) ;
43
43
44
44
await _taskCompletionSource . Task ;
45
45
}
@@ -49,7 +49,7 @@ public async Task ThemeListenerDispatcherTestFromOtherThreadAsync()
49
49
{
50
50
await Task . Run ( async ( ) =>
51
51
{
52
- await _themeListener . OnColorValuesChanged ( ) ;
52
+ await _themeListener . OnThemePropertyChangedAsync ( ) ;
53
53
} ) ;
54
54
await _taskCompletionSource . Task ;
55
55
}
You can’t perform that action at this time.
0 commit comments