mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Fix component initialization issue
This commit is contained in:
parent
57dccce1bf
commit
1a67c8906b
12 changed files with 48 additions and 0 deletions
|
|
@ -14,10 +14,14 @@ namespace Flow.Launcher.Resources.Pages
|
|||
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
// If the navigation is not triggered by button click, view model will be null again
|
||||
if (_viewModel == null)
|
||||
{
|
||||
Settings = Ioc.Default.GetRequiredService<Settings>();
|
||||
_viewModel = Ioc.Default.GetRequiredService<WelcomeViewModel>();
|
||||
}
|
||||
if (!IsInitialized)
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
// Sometimes the navigation is not triggered by button click,
|
||||
|
|
|
|||
|
|
@ -16,10 +16,14 @@ namespace Flow.Launcher.Resources.Pages
|
|||
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
// If the navigation is not triggered by button click, view model will be null again
|
||||
if (_viewModel == null)
|
||||
{
|
||||
Settings = Ioc.Default.GetRequiredService<Settings>();
|
||||
_viewModel = Ioc.Default.GetRequiredService<WelcomeViewModel>();
|
||||
}
|
||||
if (!IsInitialized)
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
// Sometimes the navigation is not triggered by button click,
|
||||
|
|
|
|||
|
|
@ -12,10 +12,14 @@ namespace Flow.Launcher.Resources.Pages
|
|||
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
// If the navigation is not triggered by button click, view model will be null again
|
||||
if (_viewModel == null)
|
||||
{
|
||||
Settings = Ioc.Default.GetRequiredService<Settings>();
|
||||
_viewModel = Ioc.Default.GetRequiredService<WelcomeViewModel>();
|
||||
}
|
||||
if (!IsInitialized)
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
// Sometimes the navigation is not triggered by button click,
|
||||
|
|
|
|||
|
|
@ -12,10 +12,14 @@ namespace Flow.Launcher.Resources.Pages
|
|||
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
// If the navigation is not triggered by button click, view model will be null again
|
||||
if (_viewModel == null)
|
||||
{
|
||||
Settings = Ioc.Default.GetRequiredService<Settings>();
|
||||
_viewModel = Ioc.Default.GetRequiredService<WelcomeViewModel>();
|
||||
}
|
||||
if (!IsInitialized)
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
// Sometimes the navigation is not triggered by button click,
|
||||
|
|
|
|||
|
|
@ -15,10 +15,14 @@ namespace Flow.Launcher.Resources.Pages
|
|||
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
// If the navigation is not triggered by button click, view model will be null again
|
||||
if (_viewModel == null)
|
||||
{
|
||||
Settings = Ioc.Default.GetRequiredService<Settings>();
|
||||
_viewModel = Ioc.Default.GetRequiredService<WelcomeViewModel>();
|
||||
}
|
||||
if (!IsInitialized)
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
// Sometimes the navigation is not triggered by button click,
|
||||
|
|
|
|||
|
|
@ -12,11 +12,15 @@ public partial class SettingsPaneAbout
|
|||
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
// If the navigation is not triggered by button click, view model will be null again
|
||||
if (_viewModel == null)
|
||||
{
|
||||
_viewModel = Ioc.Default.GetRequiredService<SettingsPaneAboutViewModel>();
|
||||
_settingViewModel = Ioc.Default.GetRequiredService<SettingWindowViewModel>();
|
||||
DataContext = _viewModel;
|
||||
}
|
||||
if (!IsInitialized)
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
// Sometimes the navigation is not triggered by button click,
|
||||
|
|
|
|||
|
|
@ -12,11 +12,15 @@ public partial class SettingsPaneGeneral
|
|||
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
// If the navigation is not triggered by button click, view model will be null again
|
||||
if (_viewModel == null)
|
||||
{
|
||||
_viewModel = Ioc.Default.GetRequiredService<SettingsPaneGeneralViewModel>();
|
||||
_settingViewModel = Ioc.Default.GetRequiredService<SettingWindowViewModel>();
|
||||
DataContext = _viewModel;
|
||||
}
|
||||
if (!IsInitialized)
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
// Sometimes the navigation is not triggered by button click,
|
||||
|
|
|
|||
|
|
@ -12,11 +12,15 @@ public partial class SettingsPaneHotkey
|
|||
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
// If the navigation is not triggered by button click, view model will be null again
|
||||
if (_viewModel == null)
|
||||
{
|
||||
_viewModel = Ioc.Default.GetRequiredService<SettingsPaneHotkeyViewModel>();
|
||||
_settingViewModel = Ioc.Default.GetRequiredService<SettingWindowViewModel>();
|
||||
DataContext = _viewModel;
|
||||
}
|
||||
if (!IsInitialized)
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
// Sometimes the navigation is not triggered by button click,
|
||||
|
|
|
|||
|
|
@ -15,11 +15,15 @@ public partial class SettingsPanePluginStore
|
|||
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
// If the navigation is not triggered by button click, view model will be null again
|
||||
if (_viewModel == null)
|
||||
{
|
||||
_viewModel = Ioc.Default.GetRequiredService<SettingsPanePluginStoreViewModel>();
|
||||
_settingViewModel = Ioc.Default.GetRequiredService<SettingWindowViewModel>();
|
||||
DataContext = _viewModel;
|
||||
}
|
||||
if (!IsInitialized)
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
_viewModel.PropertyChanged += ViewModel_PropertyChanged;
|
||||
|
|
|
|||
|
|
@ -15,11 +15,15 @@ public partial class SettingsPanePlugins
|
|||
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
// If the navigation is not triggered by button click, view model will be null again
|
||||
if (_viewModel == null)
|
||||
{
|
||||
_viewModel = Ioc.Default.GetRequiredService<SettingsPanePluginsViewModel>();
|
||||
_settingViewModel = Ioc.Default.GetRequiredService<SettingWindowViewModel>();
|
||||
DataContext = _viewModel;
|
||||
}
|
||||
if (!IsInitialized)
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
_viewModel.PropertyChanged += ViewModel_PropertyChanged;
|
||||
|
|
|
|||
|
|
@ -12,11 +12,15 @@ public partial class SettingsPaneProxy
|
|||
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
// If the navigation is not triggered by button click, view model will be null again
|
||||
if (_viewModel == null)
|
||||
{
|
||||
_viewModel = Ioc.Default.GetRequiredService<SettingsPaneProxyViewModel>();
|
||||
_settingViewModel = Ioc.Default.GetRequiredService<SettingWindowViewModel>();
|
||||
DataContext = _viewModel;
|
||||
}
|
||||
if (!IsInitialized)
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
// Sometimes the navigation is not triggered by button click,
|
||||
|
|
|
|||
|
|
@ -12,11 +12,15 @@ public partial class SettingsPaneTheme
|
|||
|
||||
protected override void OnNavigatedTo(NavigationEventArgs e)
|
||||
{
|
||||
// If the navigation is not triggered by button click, view model will be null again
|
||||
if (_viewModel == null)
|
||||
{
|
||||
_viewModel = Ioc.Default.GetRequiredService<SettingsPaneThemeViewModel>();
|
||||
_settingViewModel = Ioc.Default.GetRequiredService<SettingWindowViewModel>();
|
||||
DataContext = _viewModel;
|
||||
}
|
||||
if (!IsInitialized)
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
// Sometimes the navigation is not triggered by button click,
|
||||
|
|
|
|||
Loading…
Reference in a new issue