|
|
|
<controls:AppWindowBase xmlns="https://github.com/avaloniaui"
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
xmlns:vm="using:StabilityMatrix.Avalonia.ViewModels"
|
|
|
|
xmlns:ui="using:FluentAvalonia.UI.Controls"
|
|
|
|
xmlns:local="using:StabilityMatrix.Avalonia"
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
|
xmlns:mocks="clr-namespace:StabilityMatrix.Avalonia.DesignData"
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
|
xmlns:controls="clr-namespace:StabilityMatrix.Avalonia.Controls"
|
|
|
|
xmlns:base="clr-namespace:StabilityMatrix.Avalonia.ViewModels.Base"
|
|
|
|
xmlns:lang="clr-namespace:StabilityMatrix.Avalonia.Languages"
|
|
|
|
xmlns:fluentIcons="clr-namespace:FluentIcons.Avalonia.Fluent;assembly=FluentIcons.Avalonia.Fluent"
|
|
|
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="550"
|
|
|
|
d:DataContext="{x:Static mocks:DesignData.MainWindowViewModel}"
|
|
|
|
x:DataType="vm:MainWindowViewModel"
|
|
|
|
Icon="/Assets/Icon.ico"
|
|
|
|
Width="1300"
|
|
|
|
Height="950"
|
|
|
|
BackRequested="TopLevel_OnBackRequested"
|
|
|
|
Title="Stability Matrix"
|
|
|
|
DockProperties.IsDragEnabled="True"
|
|
|
|
DockProperties.IsDropEnabled="True"
|
|
|
|
x:Class="StabilityMatrix.Avalonia.Views.MainWindow">
|
|
|
|
|
|
|
|
<controls:AppWindowBase.Resources>
|
|
|
|
<SolidColorBrush x:Key="BrushB0" Color="#FFFFFFFF" />
|
|
|
|
<DrawingImage x:Key="BrandsPatreonSymbolWhite">
|
|
|
|
<DrawingGroup>
|
|
|
|
<GeometryDrawing Brush="{DynamicResource BrushB0}" Geometry="F1 M1033.05 324.45C1032.86 186.55 925.46 73.53 799.45 32.75C642.97 -17.89 436.59 -10.55 287.17 59.95C106.07 145.41 49.18 332.61 47.06 519.31C45.32 672.81 60.64 1077.1 288.68 1079.98C458.12 1082.13 483.35 863.8 561.75 758.65C617.53 683.84 689.35 662.71 777.76 640.83C929.71 603.22 1033.27 483.3 1033.05 324.45Z" />
|
|
|
|
</DrawingGroup>
|
|
|
|
</DrawingImage>
|
|
|
|
</controls:AppWindowBase.Resources>
|
|
|
|
|
|
|
|
<Grid RowDefinitions="Auto,Auto,*">
|
|
|
|
<Grid Name="TitleBarHost"
|
|
|
|
ColumnDefinitions="Auto,Auto,*,Auto"
|
|
|
|
Height="32"
|
|
|
|
Background="Transparent">
|
|
|
|
<Image Margin="12 4"
|
|
|
|
IsHitTestVisible="False"
|
|
|
|
Source="/Assets/Icon.ico"
|
|
|
|
Width="18" Height="18"
|
|
|
|
DockPanel.Dock="Left"
|
|
|
|
Name="WindowIcon"
|
|
|
|
RenderOptions.BitmapInterpolationMode="HighQuality">
|
|
|
|
<Image.IsVisible>
|
|
|
|
<OnPlatform Default="False">
|
|
|
|
<On Options="Windows" Content="True" />
|
|
|
|
</OnPlatform>
|
|
|
|
</Image.IsVisible>
|
|
|
|
</Image>
|
|
|
|
<TextBlock
|
|
|
|
Text="{Binding Title,
|
|
|
|
RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}"
|
|
|
|
FontSize="12"
|
|
|
|
IsHitTestVisible="False"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
Grid.Column="1">
|
|
|
|
<TextBlock.IsVisible>
|
|
|
|
<OnPlatform Default="False">
|
|
|
|
<On Options="Windows" Content="True" />
|
|
|
|
</OnPlatform>
|
|
|
|
</TextBlock.IsVisible>
|
|
|
|
</TextBlock>
|
|
|
|
|
|
|
|
<Border Grid.Column="2" Padding="6" />
|
|
|
|
</Grid>
|
|
|
|
<ui:NavigationView
|
|
|
|
Grid.Row="1"
|
|
|
|
Grid.RowSpan="2"
|
|
|
|
Name="NavigationView"
|
|
|
|
ItemInvoked="NavigationView_OnItemInvoked"
|
|
|
|
BackRequested="NavigationView_OnBackRequested"
|
|
|
|
PaneDisplayMode="Left"
|
|
|
|
IsPaneOpen="False"
|
|
|
|
OpenPaneLength="{Binding PaneWidth}"
|
|
|
|
IsSettingsVisible="False"
|
|
|
|
IsBackEnabled="True"
|
|
|
|
IsBackButtonVisible="True"
|
|
|
|
MenuItemsSource="{Binding Pages, Mode=OneWay}"
|
|
|
|
FooterMenuItemsSource="{Binding FooterPages, Mode=OneWay}"
|
|
|
|
SelectedItem="{Binding SelectedCategory}">
|
|
|
|
|
|
|
|
<ui:NavigationView.MenuItemTemplate>
|
|
|
|
<DataTemplate DataType="{x:Type base:PageViewModelBase}">
|
|
|
|
<ui:NavigationViewItem
|
|
|
|
Margin="0,0,0,0"
|
|
|
|
Tag="{Binding}"
|
|
|
|
IconSource="{Binding IconSource}"
|
|
|
|
Content="{Binding Title}"/>
|
|
|
|
</DataTemplate>
|
|
|
|
</ui:NavigationView.MenuItemTemplate>
|
|
|
|
|
|
|
|
<ui:NavigationView.PaneFooter>
|
|
|
|
<StackPanel>
|
|
|
|
<!-- Update button -->
|
|
|
|
<ui:NavigationViewItem Name="FooterUpdateItem"
|
|
|
|
Content="{x:Static lang:Resources.Label_UpdateAvailable}"
|
|
|
|
IsVisible="{Binding IsUpdateAvailable}"
|
|
|
|
IsEnabled="{Binding IsUpdateAvailable}"
|
|
|
|
DataContext="{Binding UpdateViewModel}"
|
|
|
|
Tapped="FooterUpdateItem_OnTapped">
|
|
|
|
<ui:NavigationViewItem.IconSource>
|
|
|
|
<fluentIcons:SymbolIconSource
|
|
|
|
FontSize="18"
|
|
|
|
Symbol="ArrowDownload"
|
|
|
|
IsFilled="True"
|
|
|
|
Foreground="LimeGreen"/>
|
|
|
|
</ui:NavigationViewItem.IconSource>
|
|
|
|
</ui:NavigationViewItem>
|
|
|
|
|
|
|
|
<!-- Patreon -->
|
|
|
|
<ui:NavigationViewItem Name="PatreonPatreonItem"
|
|
|
|
Content="{x:Static lang:Resources.Label_BecomeAPatron}"
|
|
|
|
Tapped="PatreonPatreonItem_OnTapped">
|
|
|
|
<ui:NavigationViewItem.IconSource>
|
|
|
|
<ui:ImageIconSource Source="{StaticResource BrandsPatreonSymbolWhite}" />
|
|
|
|
</ui:NavigationViewItem.IconSource>
|
|
|
|
</ui:NavigationViewItem>
|
|
|
|
|
|
|
|
<!-- Discord -->
|
|
|
|
<ui:NavigationViewItem Name="FooterDiscordItem"
|
|
|
|
Content="{x:Static lang:Resources.Label_JoinDiscord}"
|
|
|
|
Tapped="FooterDiscordItem_OnTapped">
|
|
|
|
<ui:NavigationViewItem.IconSource>
|
|
|
|
<controls:FASymbolIconSource Symbol="fa-brands fa-discord"/>
|
|
|
|
</ui:NavigationViewItem.IconSource>
|
|
|
|
</ui:NavigationViewItem>
|
|
|
|
|
|
|
|
<!-- Download flyout -->
|
|
|
|
<ui:NavigationViewItem Name="FooterDownloadItem"
|
|
|
|
Content="{x:Static lang:Resources.Label_Downloads}"
|
|
|
|
IconSource="{Binding IconSource}"
|
|
|
|
DataContext="{Binding ProgressManagerViewModel}"
|
|
|
|
IsVisible="{Binding !!ProgressItems.Count}"
|
|
|
|
Tapped="FooterDownloadItem_OnTapped">
|
|
|
|
<ui:NavigationViewItem.ContextFlyout>
|
|
|
|
<controls:BetterFlyout Placement="RightEdgeAlignedBottom"
|
|
|
|
HorizontalScrollBarVisibility="Hidden"
|
|
|
|
VerticalScrollBarVisibility="Auto"
|
|
|
|
Content="{Binding }"/>
|
|
|
|
</ui:NavigationViewItem.ContextFlyout>
|
|
|
|
<ui:NavigationViewItem.InfoBadge>
|
|
|
|
<ui:InfoBadge Value="{Binding ProgressItems.Count}"
|
|
|
|
IsVisible="{Binding !!ProgressItems.Count}"/>
|
|
|
|
</ui:NavigationViewItem.InfoBadge>
|
|
|
|
</ui:NavigationViewItem>
|
|
|
|
</StackPanel>
|
|
|
|
</ui:NavigationView.PaneFooter>
|
|
|
|
|
|
|
|
<!-- Since the data context is set dynamically, cannot use compiled bindings -->
|
|
|
|
<ui:Frame Name="FrameView">
|
|
|
|
<ui:Frame.NavigationPageFactory>
|
|
|
|
<local:ViewLocator/>
|
|
|
|
</ui:Frame.NavigationPageFactory>
|
|
|
|
</ui:Frame>
|
|
|
|
|
|
|
|
</ui:NavigationView>
|
|
|
|
<ui:TeachingTip
|
|
|
|
Grid.Row="1"
|
|
|
|
Grid.RowSpan="2"
|
|
|
|
Name="UpdateAvailableTeachingTip"
|
|
|
|
Target="{Binding #FooterUpdateItem}"
|
|
|
|
Title="{x:Static lang:Resources.Label_UpdateAvailable}"
|
|
|
|
PreferredPlacement="Right" />
|
|
|
|
|
|
|
|
<ui:TeachingTip
|
|
|
|
Grid.Row="1"
|
|
|
|
Grid.RowSpan="2"
|
|
|
|
Name="DownloadsTeachingTip"
|
|
|
|
Target="{Binding #FooterDownloadItem}"
|
|
|
|
Title="{x:Static lang:Resources.Label_Downloads}"
|
|
|
|
PreferredPlacement="Right" />
|
|
|
|
</Grid>
|
|
|
|
</controls:AppWindowBase>
|