Adding page refresh to IPageBase

This commit is contained in:
2025-11-29 10:54:17 -06:00
parent 5515f981cd
commit c64386b985
7 changed files with 10 additions and 5 deletions

View File

@@ -21,11 +21,6 @@ public static class AppManager
} }
// -- Global Commands -- // // -- Global Commands -- //
[Command(Name = "exit", Description = "Hides the console")]
public static void ExitConsole()
{
SzConsole.Exit();
}
[Command(Name = "page", Description = "Change the current page to the given value, if it exists")] [Command(Name = "page", Description = "Change the current page to the given value, if it exists")]
public static void ChangePage(string pageName) public static void ChangePage(string pageName)

View File

@@ -35,6 +35,7 @@ public partial class MainWindow : Window
if (_pages.TryGetValue(pageName.ToLower(), out var page)) if (_pages.TryGetValue(pageName.ToLower(), out var page))
{ {
_mainContentControl?.Content = page; _mainContentControl?.Content = page;
page.Refresh();
} }
else else
{ {

View File

@@ -13,4 +13,5 @@ public partial class HomePage : UserControl, IPageBase
InitializeComponent(); InitializeComponent();
} }
public void Refresh() { }
} }

View File

@@ -3,4 +3,6 @@ namespace SessionZero.Pages;
public interface IPageBase public interface IPageBase
{ {
public string PageName { get; set; } public string PageName { get; set; }
public void Refresh();
} }

View File

@@ -12,5 +12,7 @@ public partial class LibraryPage : UserControl, IPageBase
{ {
InitializeComponent(); InitializeComponent();
} }
public void Refresh() { }
} }

View File

@@ -12,4 +12,6 @@ public partial class SessionsPage : UserControl, IPageBase
{ {
InitializeComponent(); InitializeComponent();
} }
public void Refresh() { }
} }

View File

@@ -12,4 +12,6 @@ public partial class SettingsPage : UserControl, IPageBase
{ {
InitializeComponent(); InitializeComponent();
} }
public void Refresh() { }
} }