Adding page refresh to IPageBase
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
@@ -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
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,4 +13,5 @@ public partial class HomePage : UserControl, IPageBase
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Refresh() { }
|
||||||
}
|
}
|
||||||
@@ -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();
|
||||||
}
|
}
|
||||||
@@ -12,5 +12,7 @@ public partial class LibraryPage : UserControl, IPageBase
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Refresh() { }
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -12,4 +12,6 @@ public partial class SessionsPage : UserControl, IPageBase
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Refresh() { }
|
||||||
}
|
}
|
||||||
@@ -12,4 +12,6 @@ public partial class SettingsPage : UserControl, IPageBase
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Refresh() { }
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user