File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed
src/BootstrapBlazor/Services Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -20,11 +20,6 @@ public async ValueTask SetThemeAsync(string themeName)
2020 {
2121 var module = await jsRuntime . LoadUtility ( ) ;
2222 await module . SetThemeAsync ( themeName ) ;
23-
24- if ( ThemeChangedAsync is not null )
25- {
26- await ThemeChangedAsync ( themeName ) ;
27- }
2823 }
2924
3025 /// <summary>
@@ -35,4 +30,15 @@ public async ValueTask SetThemeAsync(string themeName)
3530 var module = await jsRuntime . LoadUtility ( ) ;
3631 return await module . GetThemeAsync ( ) ;
3732 }
33+
34+ /// <summary>
35+ /// <inheritdoc/>
36+ /// </summary>
37+ public void TriggerThemeChanged ( )
38+ {
39+ if ( ThemeChangedAsync is not null )
40+ {
41+ ThemeChangedAsync ( string . Empty ) ;
42+ }
43+ }
3844}
Original file line number Diff line number Diff line change @@ -27,4 +27,9 @@ public interface IThemeProvider
2727 /// The callback when theme changed
2828 /// </summary>
2929 Func < string , Task > ? ThemeChangedAsync { get ; set ; }
30+
31+ /// <summary>
32+ /// Trigger the theme changed event
33+ /// </summary>
34+ void TriggerThemeChanged ( ) ;
3035}
You can’t perform that action at this time.
0 commit comments