Adding page refresh to IPageBase
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -35,6 +35,7 @@ public partial class MainWindow : Window
|
||||
if (_pages.TryGetValue(pageName.ToLower(), out var page))
|
||||
{
|
||||
_mainContentControl?.Content = page;
|
||||
page.Refresh();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -13,4 +13,5 @@ public partial class HomePage : UserControl, IPageBase
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void Refresh() { }
|
||||
}
|
||||
@@ -3,4 +3,6 @@ namespace SessionZero.Pages;
|
||||
public interface IPageBase
|
||||
{
|
||||
public string PageName { get; set; }
|
||||
|
||||
public void Refresh();
|
||||
}
|
||||
@@ -12,5 +12,7 @@ public partial class LibraryPage : UserControl, IPageBase
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void Refresh() { }
|
||||
|
||||
}
|
||||
@@ -12,4 +12,6 @@ public partial class SessionsPage : UserControl, IPageBase
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void Refresh() { }
|
||||
}
|
||||
@@ -12,4 +12,6 @@ public partial class SettingsPage : UserControl, IPageBase
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void Refresh() { }
|
||||
}
|
||||
Reference in New Issue
Block a user