mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 18:11:27 -07:00
ColorValuesChanged now reapplies the theme
This commit is contained in:
parent
4795bf8b66
commit
e983814176
@ -4,16 +4,20 @@ using Wpf.Ui.Appearance;
|
||||
using Wpf.Ui.Controls;
|
||||
using Wpf.Ui.Mvvm.Contracts;
|
||||
using Wpf.Ui.Mvvm.Services;
|
||||
using Windows.UI.ViewManagement;
|
||||
|
||||
namespace Bloxstrap.UI.Elements.Base
|
||||
{
|
||||
public abstract class WpfUiWindow : UiWindow
|
||||
{
|
||||
private readonly IThemeService _themeService = new ThemeService();
|
||||
private UISettings _settings;
|
||||
|
||||
public WpfUiWindow()
|
||||
{
|
||||
ApplyTheme();
|
||||
_settings = new UISettings();
|
||||
_settings.ColorValuesChanged += ColorValuesChanged;
|
||||
}
|
||||
|
||||
public void ApplyTheme()
|
||||
@ -37,5 +41,13 @@ namespace Bloxstrap.UI.Elements.Base
|
||||
|
||||
base.OnSourceInitialized(e);
|
||||
}
|
||||
|
||||
private async void ColorValuesChanged(UISettings sender, object args)
|
||||
{
|
||||
await Dispatcher.InvokeAsync(() =>
|
||||
{
|
||||
ApplyTheme();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user