Browse Source

Add custom title and icons for nav menu

pull/5/head
Ionite 2 years ago
parent
commit
a1fcd71d16
No known key found for this signature in database
  1. 54
      StabilityMatrix/MainWindow.xaml
  2. 12
      StabilityMatrix/MainWindow.xaml.cs

54
StabilityMatrix/MainWindow.xaml

@ -7,17 +7,49 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<NavigationView
x:Name="MainNavigationView"
Loaded="MainNavigationView_OnLoaded"
SelectionChanged="MainNavigationView_OnSelectionChanged"
Header="Stability Matrix">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="32"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid x:Name="AppTitleBar">
<Image Source="Assets\LockScreenLogo.scale-200.png"
HorizontalAlignment="Left"
Width="16" Height="16"
Margin="8,0"/>
<TextBlock x:Name="AppTitleTextBlock"
Text="{StaticResource AppTitle}"
TextWrapping="NoWrap"
Style="{StaticResource CaptionTextBlockStyle}"
VerticalAlignment="Center"
Margin="28,0,0,0"/>
</Grid>
<NavigationView
Grid.Row="1"
x:Name="MainNavigationView"
Loaded="MainNavigationView_OnLoaded"
SelectionChanged="MainNavigationView_OnSelectionChanged"
Header="Stability Matrix">
<NavigationView.MenuItems>
<NavigationViewItem Content="Launch" Tag="LaunchPage" />
<NavigationViewItem Content="Install" Tag="InstallPage" />
</NavigationView.MenuItems>
<NavigationView.MenuItems>
<NavigationViewItem Content="Launch" Tag="LaunchPage">
<NavigationViewItem.Icon>
<SymbolIcon Symbol="Play" />
</NavigationViewItem.Icon>
</NavigationViewItem>
<Frame x:Name="ContentFrame"/>
</NavigationView>
<NavigationViewItem Content="Install" Tag="InstallPage">
<NavigationViewItem.Icon>
<SymbolIcon Symbol="Repair" />
</NavigationViewItem.Icon>
</NavigationViewItem>
</NavigationView.MenuItems>
<Frame x:Name="ContentFrame"/>
</NavigationView>
</Grid>
</Window>

12
StabilityMatrix/MainWindow.xaml.cs

@ -2,6 +2,11 @@ using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using System;
using System.Linq;
using Windows.ApplicationModel.Core;
using Windows.UI.ViewManagement;
using Microsoft.UI;
using Microsoft.UI.Windowing;
using WinRT.Interop;
namespace StabilityMatrix
{
@ -12,10 +17,11 @@ namespace StabilityMatrix
{
public MainWindow()
{
this.InitializeComponent();
InitializeComponent();
Title = "Stability Matrix";
WindowOptions.TrySetCustomTitle(this, AppTitleBar);
}
private void ButtonNavInstallPage_OnClick(object sender, RoutedEventArgs e)
{
ContentFrame.Navigate(typeof(InstallPage));

Loading…
Cancel
Save