|
|
|
@ -5,14 +5,18 @@
|
|
|
|
|
d:DesignHeight="1000" |
|
|
|
|
d:DesignWidth="650" |
|
|
|
|
mc:Ignorable="d" |
|
|
|
|
ui:Design.Background="{DynamicResource ApplicationBackgroundBrush}" |
|
|
|
|
ui:Design.Foreground="{DynamicResource TextFillColorPrimaryBrush}" |
|
|
|
|
x:Class="StabilityMatrix.CheckpointManagerPage" |
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|
|
|
|
xmlns:controls="clr-namespace:StabilityMatrix.Controls" |
|
|
|
|
xmlns:converters="clr-namespace:StabilityMatrix.Converters" |
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
|
|
|
|
xmlns:designData="clr-namespace:StabilityMatrix.DesignData" |
|
|
|
|
xmlns:i="http://schemas.microsoft.com/xaml/behaviors" |
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
|
|
|
|
xmlns:models="clr-namespace:StabilityMatrix.Models" |
|
|
|
|
xmlns:system="clr-namespace:System;assembly=System.Runtime" |
|
|
|
|
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml" |
|
|
|
|
xmlns:viewModels="clr-namespace:StabilityMatrix.ViewModels" |
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|
|
|
@ -26,6 +30,10 @@
|
|
|
|
|
<converters:BoolNegationConverter /> |
|
|
|
|
<converters:BooleanToHiddenVisibleConverter /> |
|
|
|
|
</converters:ValueConverterGroup> |
|
|
|
|
<converters:ValueConverterGroup x:Key="InvertBoolToVisibilityConverter"> |
|
|
|
|
<converters:BoolNegationConverter /> |
|
|
|
|
<BooleanToVisibilityConverter /> |
|
|
|
|
</converters:ValueConverterGroup> |
|
|
|
|
|
|
|
|
|
<DropShadowEffect |
|
|
|
|
BlurRadius="8" |
|
|
|
@ -35,61 +43,120 @@
|
|
|
|
|
ShadowDepth="0" |
|
|
|
|
x:Key="TextDropShadowEffect" /> |
|
|
|
|
|
|
|
|
|
<!-- Template for a single badge --> |
|
|
|
|
<DataTemplate DataType="{x:Type system:String}" x:Key="BadgeTemplate"> |
|
|
|
|
<ui:Card |
|
|
|
|
Height="18" |
|
|
|
|
Margin="4,0,0,0" |
|
|
|
|
Padding="3" |
|
|
|
|
Visibility="{Binding Converter={StaticResource StringNullOrEmptyToVisibilityConverter}, FallbackValue=Collapsed}" |
|
|
|
|
Width="40"> |
|
|
|
|
<TextBlock |
|
|
|
|
FontSize="10" |
|
|
|
|
FontWeight="Medium" |
|
|
|
|
Foreground="{DynamicResource TextFillColorSecondaryBrush}" |
|
|
|
|
HorizontalAlignment="Center" |
|
|
|
|
Text="{Binding}" |
|
|
|
|
VerticalAlignment="Center" /> |
|
|
|
|
</ui:Card> |
|
|
|
|
</DataTemplate> |
|
|
|
|
|
|
|
|
|
<DataTemplate DataType="{x:Type models:CheckpointFile}" x:Key="CheckpointFileDataTemplate"> |
|
|
|
|
<Border Background="Transparent" BorderThickness="0"> |
|
|
|
|
<Border |
|
|
|
|
Background="Transparent" |
|
|
|
|
BorderThickness="0" |
|
|
|
|
Margin="8"> |
|
|
|
|
<i:Interaction.Behaviors> |
|
|
|
|
<i:MouseDragElementBehavior /> |
|
|
|
|
</i:Interaction.Behaviors> |
|
|
|
|
<ui:Card |
|
|
|
|
Margin="8,8,8,8" |
|
|
|
|
MaxHeight="512" |
|
|
|
|
MaxWidth="300" |
|
|
|
|
MinWidth="240" |
|
|
|
|
Padding="12,16"> |
|
|
|
|
<ui:Card Width="260"> |
|
|
|
|
<ui:Card.ContextMenu> |
|
|
|
|
<ContextMenu> |
|
|
|
|
<MenuItem Header="Rename" /> |
|
|
|
|
<!-- ReSharper disable once Xaml.RedundantResource --> |
|
|
|
|
<MenuItem Command="{Binding RenameCommand}" Header="Rename" /> |
|
|
|
|
<!-- ReSharper disable once Xaml.RedundantResource --> |
|
|
|
|
<MenuItem Command="{Binding DeleteCommand}" Header="Delete" /> |
|
|
|
|
</ContextMenu> |
|
|
|
|
</ui:Card.ContextMenu> |
|
|
|
|
<Grid> |
|
|
|
|
<!-- Main contents, hidden when IsLoading is true --> |
|
|
|
|
<VirtualizingStackPanel Orientation="Vertical"> |
|
|
|
|
<StackPanel MinHeight="70"> |
|
|
|
|
<ui:Image |
|
|
|
|
CornerRadius="4" |
|
|
|
|
Margin="0,0,0,8" |
|
|
|
|
Source="{Binding PreviewImagePath}" |
|
|
|
|
Source="{Binding PreviewImage}" |
|
|
|
|
Stretch="Uniform" |
|
|
|
|
Visibility="Collapsed" /> |
|
|
|
|
<Grid |
|
|
|
|
HorizontalAlignment="Stretch" |
|
|
|
|
Name="ModelInfoGrid" |
|
|
|
|
VerticalAlignment="Stretch" |
|
|
|
|
Visibility="{Binding IsLoading, Converter={StaticResource InvertAndVisibleOrHidden}}"> |
|
|
|
|
<Grid Name="ModelInfoGrid" Visibility="{Binding IsLoading, Converter={StaticResource InvertAndVisibleOrHidden}}"> |
|
|
|
|
<Grid.ColumnDefinitions> |
|
|
|
|
<ColumnDefinition Width="*" /> |
|
|
|
|
<ColumnDefinition Width="0.6*" /> |
|
|
|
|
<ColumnDefinition Width="*" /> |
|
|
|
|
<ColumnDefinition Width="*" /> |
|
|
|
|
<ColumnDefinition Width="*" /> |
|
|
|
|
<ColumnDefinition Width="*" /> |
|
|
|
|
</Grid.ColumnDefinitions> |
|
|
|
|
<StackPanel Orientation="Vertical"> |
|
|
|
|
<Grid.RowDefinitions> |
|
|
|
|
<RowDefinition Height="*" /> |
|
|
|
|
<RowDefinition Height="0.1*" /> |
|
|
|
|
</Grid.RowDefinitions> |
|
|
|
|
<StackPanel |
|
|
|
|
Grid.ColumnSpan="4" |
|
|
|
|
HorizontalAlignment="Left" |
|
|
|
|
IsEnabled="True" |
|
|
|
|
Margin="4" |
|
|
|
|
Orientation="Vertical" |
|
|
|
|
ToolTipService.BetweenShowDelay="100" |
|
|
|
|
ToolTipService.InitialShowDelay="300"> |
|
|
|
|
<!-- Tooltip for title and version --> |
|
|
|
|
<StackPanel.ToolTip> |
|
|
|
|
<ToolTip Padding="8"> |
|
|
|
|
<VirtualizingStackPanel> |
|
|
|
|
<!-- Title --> |
|
|
|
|
<TextBlock |
|
|
|
|
FontSize="14" |
|
|
|
|
FontWeight="Medium" |
|
|
|
|
Foreground="{DynamicResource TextFillColorPrimaryBrush}" |
|
|
|
|
HorizontalAlignment="Left" |
|
|
|
|
Margin="0,0,0,4" |
|
|
|
|
Text="{Binding Title}" |
|
|
|
|
TextWrapping="WrapWithOverflow" /> |
|
|
|
|
<!-- Version --> |
|
|
|
|
<TextBlock |
|
|
|
|
FontSize="13" |
|
|
|
|
Foreground="{DynamicResource TextFillColorTertiaryBrush}" |
|
|
|
|
HorizontalAlignment="Left" |
|
|
|
|
Margin="0,0,0,4" |
|
|
|
|
Text="{Binding ConnectedModel.VersionName, FallbackValue=''}" |
|
|
|
|
TextWrapping="WrapWithOverflow" |
|
|
|
|
Visibility="{Binding IsConnectedModel, Converter={StaticResource BoolToVisibilityConverter}}" /> |
|
|
|
|
<!-- Image --> |
|
|
|
|
<ui:Image |
|
|
|
|
CornerRadius="4" |
|
|
|
|
Margin="0,0,0,4" |
|
|
|
|
Source="{Binding PreviewImage}" |
|
|
|
|
Stretch="Uniform" |
|
|
|
|
Visibility="{Binding IsConnectedModel, Converter={StaticResource BoolToVisibilityConverter}}" /> |
|
|
|
|
</VirtualizingStackPanel> |
|
|
|
|
</ToolTip> |
|
|
|
|
</StackPanel.ToolTip> |
|
|
|
|
<TextBlock |
|
|
|
|
Foreground="{DynamicResource TextFillColorPrimaryBrush}" |
|
|
|
|
HorizontalAlignment="Left" |
|
|
|
|
IsEnabled="True" |
|
|
|
|
MaxWidth="150" |
|
|
|
|
Text="{Binding Title}" |
|
|
|
|
TextWrapping="WrapWithOverflow" /> |
|
|
|
|
TextTrimming="CharacterEllipsis" |
|
|
|
|
TextWrapping="NoWrap" /> |
|
|
|
|
<TextBlock |
|
|
|
|
FontSize="12" |
|
|
|
|
FontSize="13" |
|
|
|
|
Foreground="{DynamicResource TextFillColorTertiaryBrush}" |
|
|
|
|
HorizontalAlignment="Left" |
|
|
|
|
IsEnabled="True" |
|
|
|
|
Text="{Binding ConnectedModel.VersionName, FallbackValue=''}" |
|
|
|
|
TextWrapping="WrapWithOverflow" |
|
|
|
|
Visibility="{Binding IsConnectedModel, Converter={StaticResource BoolToVisibilityConverter}}" /> |
|
|
|
|
<TextBlock |
|
|
|
|
FontSize="11" |
|
|
|
|
Foreground="{DynamicResource TextFillColorTertiaryBrush}" |
|
|
|
|
Margin="0,4,0,4" |
|
|
|
|
Text="{Binding FileName}" |
|
|
|
|
TextWrapping="WrapWithOverflow" |
|
|
|
|
VerticalAlignment="Bottom" /> |
|
|
|
|
</StackPanel> |
|
|
|
|
<Grid Grid.Column="1" Visibility="{Binding IsConnectedModel, Mode=OneWay, Converter={StaticResource BoolToHiddenVisibleConverter}}"> |
|
|
|
|
<Grid Grid.Column="4" Grid.Row="0"> |
|
|
|
|
<Button |
|
|
|
|
Background="Transparent" |
|
|
|
|
BorderBrush="Transparent" |
|
|
|
@ -108,6 +175,24 @@
|
|
|
|
|
Symbol="CloudCheckmark24" |
|
|
|
|
ToolTip="Connected Model" /> |
|
|
|
|
</Button> |
|
|
|
|
<Button |
|
|
|
|
Background="Transparent" |
|
|
|
|
BorderBrush="Transparent" |
|
|
|
|
FontSize="20" |
|
|
|
|
HorizontalAlignment="Right" |
|
|
|
|
IsEnabled="True" |
|
|
|
|
MaxHeight="48" |
|
|
|
|
MaxWidth="64" |
|
|
|
|
Padding="0" |
|
|
|
|
ToolTip="Local Model" |
|
|
|
|
VerticalAlignment="Top" |
|
|
|
|
Visibility="{Binding IsConnectedModel, Mode=OneWay, Converter={StaticResource InvertBoolToVisibilityConverter}}"> |
|
|
|
|
<ui:SymbolIcon |
|
|
|
|
FontSize="12" |
|
|
|
|
Foreground="DimGray" |
|
|
|
|
Symbol="CloudOff24" |
|
|
|
|
ToolTip="Local Model" /> |
|
|
|
|
</Button> |
|
|
|
|
<ui:Button |
|
|
|
|
Background="Transparent" |
|
|
|
|
BorderBrush="Transparent" |
|
|
|
@ -127,43 +212,37 @@
|
|
|
|
|
ToolTip="Update Available" /> |
|
|
|
|
</ui:Button.Icon> |
|
|
|
|
</ui:Button> |
|
|
|
|
<VirtualizingStackPanel |
|
|
|
|
HorizontalAlignment="Right" |
|
|
|
|
Orientation="Horizontal" |
|
|
|
|
VerticalAlignment="Bottom" |
|
|
|
|
Visibility="{Binding IsConnectedModel, Mode=OneWay, Converter={StaticResource BoolToHiddenVisibleConverter}}"> |
|
|
|
|
<ui:Card |
|
|
|
|
Height="18" |
|
|
|
|
Margin="4,0,0,0" |
|
|
|
|
Padding="3" |
|
|
|
|
Visibility="{Binding FpType, Converter={StaticResource StringNullOrEmptyToVisibilityConverter}, FallbackValue=Collapsed}" |
|
|
|
|
Width="40"> |
|
|
|
|
<TextBlock |
|
|
|
|
FontSize="10" |
|
|
|
|
FontWeight="Medium" |
|
|
|
|
Foreground="{DynamicResource TextFillColorSecondaryBrush}" |
|
|
|
|
HorizontalAlignment="Center" |
|
|
|
|
Text="{Binding FpType}" |
|
|
|
|
VerticalAlignment="Center" /> |
|
|
|
|
</ui:Card> |
|
|
|
|
<ui:Card |
|
|
|
|
Height="18" |
|
|
|
|
Margin="4,0,0,0" |
|
|
|
|
Padding="3" |
|
|
|
|
Visibility="{Binding BaseModel, Converter={StaticResource StringNullOrEmptyToVisibilityConverter}, FallbackValue=Collapsed}" |
|
|
|
|
Width="40"> |
|
|
|
|
<TextBlock |
|
|
|
|
FontSize="10" |
|
|
|
|
FontWeight="Medium" |
|
|
|
|
Foreground="{DynamicResource TextFillColorSecondaryBrush}" |
|
|
|
|
HorizontalAlignment="Center" |
|
|
|
|
Text="{Binding BaseModel}" |
|
|
|
|
VerticalAlignment="Center" /> |
|
|
|
|
</ui:Card> |
|
|
|
|
</VirtualizingStackPanel> |
|
|
|
|
</Grid> |
|
|
|
|
<TextBlock |
|
|
|
|
FontSize="11" |
|
|
|
|
Foreground="{DynamicResource TextFillColorTertiaryBrush}" |
|
|
|
|
Grid.Column="0" |
|
|
|
|
Grid.ColumnSpan="3" |
|
|
|
|
Grid.Row="1" |
|
|
|
|
IsEnabled="True" |
|
|
|
|
Margin="4,4" |
|
|
|
|
Text="{Binding FileName}" |
|
|
|
|
TextTrimming="CharacterEllipsis" |
|
|
|
|
ToolTip="{Binding FileName}" |
|
|
|
|
VerticalAlignment="Bottom" /> |
|
|
|
|
<ItemsControl |
|
|
|
|
Grid.Column="3" |
|
|
|
|
Grid.ColumnSpan="2" |
|
|
|
|
Grid.Row="1" |
|
|
|
|
ItemTemplate="{StaticResource BadgeTemplate}" |
|
|
|
|
ItemsSource="{Binding Badges}" |
|
|
|
|
VerticalAlignment="Bottom"> |
|
|
|
|
<ItemsControl.ItemsPanel> |
|
|
|
|
<ItemsPanelTemplate> |
|
|
|
|
<StackPanel |
|
|
|
|
HorizontalAlignment="Right" |
|
|
|
|
Orientation="Horizontal" |
|
|
|
|
VerticalAlignment="Bottom" /> |
|
|
|
|
</ItemsPanelTemplate> |
|
|
|
|
</ItemsControl.ItemsPanel> |
|
|
|
|
</ItemsControl> |
|
|
|
|
</Grid> |
|
|
|
|
</VirtualizingStackPanel> |
|
|
|
|
</StackPanel> |
|
|
|
|
|
|
|
|
|
<!-- Progress ring --> |
|
|
|
|
<ui:ProgressRing |
|
|
|
@ -186,7 +265,9 @@
|
|
|
|
|
AllowDrop="True" |
|
|
|
|
Header="{Binding Title}" |
|
|
|
|
IsExpanded="True" |
|
|
|
|
Margin="8"> |
|
|
|
|
Margin="8" |
|
|
|
|
Padding="8,8,8,16" |
|
|
|
|
Visibility="{Binding IsCategoryEnabled, Converter={StaticResource BoolToVisibilityConverter}, FallbackValue=Visible}"> |
|
|
|
|
<i:Interaction.Triggers> |
|
|
|
|
<i:EventTrigger EventName="PreviewDragEnter"> |
|
|
|
|
<i:InvokeCommandAction Command="{Binding OnPreviewDragEnterCommand}" /> |
|
|
|
@ -264,9 +345,9 @@
|
|
|
|
|
IsIndeterminate="{Binding Progress.IsIndeterminate, FallbackValue=False}" |
|
|
|
|
Margin="64,8" |
|
|
|
|
Name="ImportProgressBar" |
|
|
|
|
Value="{Binding Progress.Value, FallbackValue=20}" |
|
|
|
|
VerticalAlignment="Center" |
|
|
|
|
Visibility="{Binding Progress.ProgressVisibility, FallbackValue=Visible}" /> |
|
|
|
|
Visibility="{Binding Progress.ProgressVisibility, FallbackValue=Visible}" |
|
|
|
|
controls:ProgressBarSmoother.SmoothValue="{Binding Progress.Value, FallbackValue=20}" /> |
|
|
|
|
</VirtualizingStackPanel> |
|
|
|
|
</Grid> |
|
|
|
|
</Expander> |
|
|
|
@ -281,17 +362,91 @@
|
|
|
|
|
</ContentControl.Style> |
|
|
|
|
</ContentControl> |
|
|
|
|
</DataTemplate> |
|
|
|
|
|
|
|
|
|
<!-- Template for dropdown category checkbox item --> |
|
|
|
|
<DataTemplate DataType="{x:Type models:CheckpointFolder}" x:Key="CategoryItemTemplate"> |
|
|
|
|
<CheckBox Content="{Binding Title}" IsChecked="{Binding IsCategoryEnabled, Mode=TwoWay}" /> |
|
|
|
|
</DataTemplate> |
|
|
|
|
|
|
|
|
|
<!-- Template for dropdown box --> |
|
|
|
|
<ControlTemplate TargetType="{x:Type ComboBoxItem}" x:Key="CategoryDropDownStyle"> |
|
|
|
|
<Grid> |
|
|
|
|
<Border |
|
|
|
|
CornerRadius="{TemplateBinding Border.CornerRadius}" |
|
|
|
|
Margin="{TemplateBinding Margin}" |
|
|
|
|
Name="ContentBorder" |
|
|
|
|
Padding="0" |
|
|
|
|
SnapsToDevicePixels="True" |
|
|
|
|
VerticalAlignment="Stretch"> |
|
|
|
|
<Grid> |
|
|
|
|
<Rectangle |
|
|
|
|
Height="16" |
|
|
|
|
HorizontalAlignment="Left" |
|
|
|
|
Margin="0" |
|
|
|
|
RadiusX="2" |
|
|
|
|
RadiusY="2" |
|
|
|
|
VerticalAlignment="Center" |
|
|
|
|
Visibility="Collapsed" |
|
|
|
|
Width="3" |
|
|
|
|
x:Name="ActiveRectangle"> |
|
|
|
|
<Rectangle.Fill> |
|
|
|
|
<SolidColorBrush Color="{DynamicResource SystemAccentColorSecondary}" /> |
|
|
|
|
</Rectangle.Fill> |
|
|
|
|
</Rectangle> |
|
|
|
|
<Grid> |
|
|
|
|
<Grid.ColumnDefinitions> |
|
|
|
|
<ColumnDefinition Width="*" /> |
|
|
|
|
<ColumnDefinition Width="Auto" /> |
|
|
|
|
</Grid.ColumnDefinitions> |
|
|
|
|
<!-- Setup grid rows --> |
|
|
|
|
<StackPanel |
|
|
|
|
Grid.Column="0" |
|
|
|
|
Margin="10,0,0,0" |
|
|
|
|
VerticalAlignment="Top" |
|
|
|
|
d:DataContext="{d:DesignInstance Type=models:CheckpointFolder, |
|
|
|
|
IsDesignTimeCreatable=True}"> |
|
|
|
|
<CheckBox Content="{Binding TitleWithFilesCount}" IsChecked="{Binding IsCategoryEnabled, Mode=TwoWay}" /> |
|
|
|
|
</StackPanel> |
|
|
|
|
</Grid> |
|
|
|
|
</Grid> |
|
|
|
|
</Border> |
|
|
|
|
</Grid> |
|
|
|
|
</ControlTemplate> |
|
|
|
|
|
|
|
|
|
</Page.Resources> |
|
|
|
|
|
|
|
|
|
<!-- Folder Cards --> |
|
|
|
|
<Grid> |
|
|
|
|
<Grid.RowDefinitions> |
|
|
|
|
<RowDefinition Height="0.1*" /> |
|
|
|
|
<RowDefinition Height="*" /> |
|
|
|
|
</Grid.RowDefinitions> |
|
|
|
|
<VirtualizingStackPanel Margin="16,8" Orientation="Horizontal"> |
|
|
|
|
<ui:ToggleSwitch Content="Preview Images" /> |
|
|
|
|
</VirtualizingStackPanel> |
|
|
|
|
<!-- Top settings bar --> |
|
|
|
|
<StackPanel |
|
|
|
|
HorizontalAlignment="Right" |
|
|
|
|
Margin="16,0" |
|
|
|
|
Orientation="Horizontal"> |
|
|
|
|
<ComboBox |
|
|
|
|
HorizontalAlignment="Right" |
|
|
|
|
ItemsSource="{Binding CheckpointFolders}" |
|
|
|
|
MinWidth="180" |
|
|
|
|
SelectedIndex="0"> |
|
|
|
|
<ComboBox.ItemContainerStyle> |
|
|
|
|
<Style TargetType="ComboBoxItem"> |
|
|
|
|
<Setter Property="Template" Value="{StaticResource CategoryDropDownStyle}" /> |
|
|
|
|
</Style> |
|
|
|
|
</ComboBox.ItemContainerStyle> |
|
|
|
|
|
|
|
|
|
<ComboBox.ItemTemplate> |
|
|
|
|
<DataTemplate DataType="{x:Type models:CheckpointFolder}"> |
|
|
|
|
<StackPanel Margin="10,0,0,0" VerticalAlignment="Top"> |
|
|
|
|
<TextBlock Margin="0,5,0,5" Text="Categories" /> |
|
|
|
|
</StackPanel> |
|
|
|
|
</DataTemplate> |
|
|
|
|
</ComboBox.ItemTemplate> |
|
|
|
|
</ComboBox> |
|
|
|
|
</StackPanel> |
|
|
|
|
|
|
|
|
|
<!-- Main view with model cards --> |
|
|
|
|
<ui:DynamicScrollViewer |
|
|
|
|
CanContentScroll="True" |
|
|
|
|
Grid.Row="1" |
|
|
|
@ -303,7 +458,7 @@
|
|
|
|
|
HorizontalAlignment="Stretch" |
|
|
|
|
ItemTemplate="{StaticResource CheckpointFolderGridDataTemplate}" |
|
|
|
|
ItemsSource="{Binding CheckpointFolders, Mode=OneWay}" |
|
|
|
|
Margin="8" /> |
|
|
|
|
Margin="8,0,8,8" /> |
|
|
|
|
</StackPanel> |
|
|
|
|
</Grid> |
|
|
|
|
</ui:DynamicScrollViewer> |
|
|
|
|