Skip to content

Commit

Permalink
move the viewmodel to a variable
Browse files Browse the repository at this point in the history
makes everything look cleaner
  • Loading branch information
bluepilledgreat committed Oct 29, 2024
1 parent e9712d1 commit 5b32de8
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ namespace Bloxstrap.UI.Elements.Settings.Pages
/// </summary>
public partial class FastFlagEditorWarningPage
{
private FastFlagEditorWarningViewModel _viewModel;
private bool _initialLoad = false;

public FastFlagEditorWarningPage()
{
var vm = new FastFlagEditorWarningViewModel(this);
DataContext = vm;
vm.StartCountdown();
_viewModel = new FastFlagEditorWarningViewModel(this);
DataContext = _viewModel;
_viewModel.StartCountdown();

InitializeComponent();
}
Expand All @@ -29,12 +30,12 @@ private void Page_Loaded(object sender, RoutedEventArgs e)
return;
}

((FastFlagEditorWarningViewModel)DataContext).StartCountdown();
_viewModel.StartCountdown();
}

private void Page_Unloaded(object sender, RoutedEventArgs e)
{
((FastFlagEditorWarningViewModel)DataContext).StopCountdown();
_viewModel.StopCountdown();
}
}
}

0 comments on commit 5b32de8

Please sign in to comment.