From 2bd20b5880f627466145cba8d02339cea1ae9453 Mon Sep 17 00:00:00 2001 From: pizzaboxer Date: Sun, 23 Jul 2023 15:56:55 +0100 Subject: [PATCH] Fix DataContext management for FastFlags page --- .../UI/Elements/Menu/Pages/FastFlagEditorPage.xaml | 2 +- Bloxstrap/UI/Elements/Menu/Pages/FastFlagsPage.xaml.cs | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Bloxstrap/UI/Elements/Menu/Pages/FastFlagEditorPage.xaml b/Bloxstrap/UI/Elements/Menu/Pages/FastFlagEditorPage.xaml index 48fdf109..6d730c9e 100644 --- a/Bloxstrap/UI/Elements/Menu/Pages/FastFlagEditorPage.xaml +++ b/Bloxstrap/UI/Elements/Menu/Pages/FastFlagEditorPage.xaml @@ -16,7 +16,7 @@ - + diff --git a/Bloxstrap/UI/Elements/Menu/Pages/FastFlagsPage.xaml.cs b/Bloxstrap/UI/Elements/Menu/Pages/FastFlagsPage.xaml.cs index 9ea4c968..ee3c53ea 100644 --- a/Bloxstrap/UI/Elements/Menu/Pages/FastFlagsPage.xaml.cs +++ b/Bloxstrap/UI/Elements/Menu/Pages/FastFlagsPage.xaml.cs @@ -10,14 +10,24 @@ namespace Bloxstrap.UI.Elements.Menu.Pages /// public partial class FastFlagsPage { + bool _initialLoad = false; + public FastFlagsPage() { + DataContext = new FastFlagsViewModel(); InitializeComponent(); } private void Page_Loaded(object sender, RoutedEventArgs e) { // refresh datacontext on page load to synchronize with editor page + + if (!_initialLoad) + { + _initialLoad = true; + return; + } + DataContext = new FastFlagsViewModel(); }