diff --git a/BackupEssentials/AppPageManager.cs b/BackupEssentials/AppPageManager.cs index bca843c..89ba66d 100644 --- a/BackupEssentials/AppPageManager.cs +++ b/BackupEssentials/AppPageManager.cs @@ -1,4 +1,6 @@ -using System; +using BackupEssentials.Pages; +using BackupEssentials.Utils; +using System; using System.Collections.Generic; using System.Windows.Controls; @@ -22,8 +24,15 @@ namespace BackupEssentials{ return page; } - public static void ResetCache(){ - cached.Clear(); + public static void ResetUI(){ + App.Current.MainWindow.UpdateBindings(); + + foreach(Page page in cached.Values){ + page.UpdateBindings(); + + IPageResetUI reset = page as IPageResetUI; + if (reset != null)reset.OnReset(); + } } } } diff --git a/BackupEssentials/BackupEssentials.csproj b/BackupEssentials/BackupEssentials.csproj index d73914d..05a0cfb 100644 --- a/BackupEssentials/BackupEssentials.csproj +++ b/BackupEssentials/BackupEssentials.csproj @@ -116,6 +116,7 @@ <Compile Include="Pages\History.xaml.cs"> <DependentUpon>History.xaml</DependentUpon> </Compile> + <Compile Include="Pages\IPageResetUI.cs" /> <Compile Include="Pages\IPageShowData.cs" /> <Compile Include="Pages\Home.xaml.cs"> <DependentUpon>Home.xaml</DependentUpon> diff --git a/BackupEssentials/Pages/IPageResetUI.cs b/BackupEssentials/Pages/IPageResetUI.cs new file mode 100644 index 0000000..a70f378 --- /dev/null +++ b/BackupEssentials/Pages/IPageResetUI.cs @@ -0,0 +1,5 @@ +namespace BackupEssentials.Pages{ + interface IPageResetUI{ + void OnReset(); + } +}