35 lines
742 B
C#
35 lines
742 B
C#
using Microsoft.UI.Xaml;
|
|
using TitleBar = Microsoft.UI.Xaml.Controls.TitleBar;
|
|
using winui_learning_2.Services;
|
|
using winui_learning_2.Views;
|
|
|
|
namespace winui_learning_2;
|
|
|
|
public sealed partial class MainWindow : Window
|
|
{
|
|
public MainWindow()
|
|
{
|
|
InitializeComponent();
|
|
ExtendsContentIntoTitleBar = true;
|
|
SetTitleBar(AppTitleBar);
|
|
|
|
if (AuthSession.IsAuthenticated)
|
|
{
|
|
rootFrame.Navigate(typeof(HomePage));
|
|
}
|
|
else
|
|
{
|
|
rootFrame.Navigate(typeof(LoginPage));
|
|
}
|
|
}
|
|
|
|
private void AppTitleBar_BackRequested(TitleBar titleBar, object args)
|
|
{
|
|
if (rootFrame.CanGoBack)
|
|
{
|
|
rootFrame.GoBack();
|
|
}
|
|
}
|
|
}
|
|
|