Removed unneeded event
This commit is contained in:
Родитель
e849126ba2
Коммит
5c1ce3a7cc
|
@ -30,6 +30,7 @@ namespace Microsoft.Toolkit.Uwp.SampleApp
|
|||
public sealed partial class SampleController : Page, INotifyPropertyChanged
|
||||
{
|
||||
public static SampleController Current { get; private set; }
|
||||
|
||||
public ThemeListener ThemeListener => _themeListener;
|
||||
|
||||
public SampleController()
|
||||
|
|
|
@ -18,7 +18,6 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
|
|||
{
|
||||
this.InitializeComponent();
|
||||
this.Loaded += ThemeListenerPage_Loaded;
|
||||
SampleController.Current.ThemeListener.ThemeChanged += Listener_ThemeChanged;
|
||||
SampleController.Current.ThemeChanged += Current_ThemeChanged;
|
||||
}
|
||||
|
||||
|
@ -32,11 +31,6 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
|
|||
UpdateThemeState();
|
||||
}
|
||||
|
||||
private void Listener_ThemeChanged(ThemeListener sender)
|
||||
{
|
||||
UpdateThemeState();
|
||||
}
|
||||
|
||||
private void UpdateThemeState()
|
||||
{
|
||||
SystemTheme.Text = SampleController.Current.ThemeListener.CurrentThemeName;
|
||||
|
@ -46,7 +40,6 @@ namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages
|
|||
protected async override void OnNavigatedFrom(NavigationEventArgs e)
|
||||
{
|
||||
Loaded -= ThemeListenerPage_Loaded;
|
||||
SampleController.Current.ThemeListener.ThemeChanged -= Listener_ThemeChanged;
|
||||
SampleController.Current.ThemeChanged -= Current_ThemeChanged;
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче