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 -- //
[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")]
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))
{
_mainContentControl?.Content = page;
page.Refresh();
}
else
{

View File

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

View File

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

View File

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

View File

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

View File

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