|
|
|
<ResourceDictionary
|
|
|
|
xmlns="https://github.com/avaloniaui"
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
xmlns:controls="clr-namespace:StabilityMatrix.Avalonia.Controls"
|
|
|
|
xmlns:fluentIcons="clr-namespace:FluentIcons.FluentAvalonia;assembly=FluentIcons.FluentAvalonia"
|
|
|
|
xmlns:mocks="using:StabilityMatrix.Avalonia.DesignData"
|
|
|
|
xmlns:models="clr-namespace:StabilityMatrix.Core.Models;assembly=StabilityMatrix.Core"
|
|
|
|
xmlns:sg="clr-namespace:SpacedGridControl.Avalonia;assembly=SpacedGridControl.Avalonia"
|
|
|
|
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia">
|
|
|
|
<Design.PreviewWith>
|
|
|
|
<Panel Width="250" Height="600">
|
|
|
|
<StackPanel Margin="8" Spacing="4">
|
|
|
|
<ui:FAComboBox
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
SelectedIndex="0"
|
|
|
|
Theme="{DynamicResource FAComboBoxHybridModelTheme}"
|
|
|
|
ItemsSource="{x:Static mocks:DesignData.SampleHybridModels}"/>
|
|
|
|
</StackPanel>
|
|
|
|
</Panel>
|
|
|
|
</Design.PreviewWith>
|
|
|
|
|
|
|
|
<!-- ReSharper disable once Xaml.StaticResourceNotResolved -->
|
|
|
|
<ControlTheme
|
|
|
|
x:Key="FAComboBoxItemHybridModelTheme"
|
|
|
|
BasedOn="{StaticResource {x:Type ui:FAComboBoxItem}}"
|
|
|
|
TargetType="ui:FAComboBoxItem">
|
|
|
|
<Setter Property="ToolTip.Placement" Value="RightEdgeAlignedTop" />
|
|
|
|
<Setter Property="ToolTip.Tip">
|
|
|
|
<Template>
|
|
|
|
<sg:SpacedGrid
|
|
|
|
x:DataType="models:HybridModelFile"
|
|
|
|
ColumnDefinitions="Auto,*"
|
|
|
|
ColumnSpacing="6"
|
|
|
|
RowSpacing="0">
|
|
|
|
<!-- Image -->
|
|
|
|
<controls:BetterAdvancedImage
|
|
|
|
Width="64"
|
|
|
|
Height="96"
|
|
|
|
CornerRadius="6"
|
|
|
|
IsVisible="{Binding Local.PreviewImageFullPathGlobal, Converter={x:Static StringConverters.IsNotNullOrEmpty}, FallbackValue=''}"
|
|
|
|
RenderOptions.BitmapInterpolationMode="HighQuality"
|
|
|
|
Source="{Binding Local.PreviewImageFullPathGlobal, FallbackValue=''}"
|
|
|
|
Stretch="UniformToFill"
|
|
|
|
StretchDirection="Both" />
|
|
|
|
<StackPanel Grid.Column="1" MaxWidth="300">
|
|
|
|
<!-- Title -->
|
|
|
|
<TextBlock
|
|
|
|
Margin="0,0,0,4"
|
|
|
|
HorizontalAlignment="Left"
|
|
|
|
FontSize="14"
|
|
|
|
FontWeight="Medium"
|
|
|
|
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
|
|
|
|
IsVisible="{Binding Local.ConnectedModelInfo, Converter={x:Static ObjectConverters.IsNotNull}, FallbackValue=False}"
|
|
|
|
Text="{Binding Local.DisplayModelName}"
|
|
|
|
TextWrapping="WrapWithOverflow" />
|
|
|
|
<!-- Version -->
|
|
|
|
<TextBlock
|
|
|
|
Margin="0,0,0,8"
|
|
|
|
HorizontalAlignment="Left"
|
|
|
|
FontSize="13"
|
|
|
|
Foreground="{DynamicResource TextFillColorTertiaryBrush}"
|
|
|
|
IsVisible="{Binding Local.ConnectedModelInfo, Converter={x:Static ObjectConverters.IsNotNull}, FallbackValue=False}"
|
|
|
|
Text="{Binding Local.DisplayModelVersion}"
|
|
|
|
TextWrapping="WrapWithOverflow" />
|
|
|
|
<!-- Path -->
|
|
|
|
<TextBlock
|
|
|
|
HorizontalAlignment="Left"
|
|
|
|
FontSize="13"
|
|
|
|
Foreground="{DynamicResource TextFillColorTertiaryBrush}"
|
|
|
|
Text="{Binding FileName}"
|
|
|
|
TextWrapping="Wrap" />
|
|
|
|
</StackPanel>
|
|
|
|
</sg:SpacedGrid>
|
|
|
|
</Template>
|
|
|
|
</Setter>
|
|
|
|
</ControlTheme>
|
|
|
|
|
|
|
|
<!-- ReSharper disable once Xaml.StaticResourceNotResolved -->
|
|
|
|
<ControlTheme x:Key="FAComboBoxHybridModelTheme"
|
|
|
|
TargetType="ui:FAComboBox"
|
|
|
|
BasedOn="{StaticResource {x:Type ui:FAComboBox}}">
|
|
|
|
<Setter Property="ItemTemplate">
|
|
|
|
<DataTemplate DataType="models:HybridModelFile">
|
|
|
|
<StackPanel>
|
|
|
|
<TextBlock Text="{Binding ShortDisplayName}" TextTrimming="CharacterEllipsis" />
|
|
|
|
</StackPanel>
|
|
|
|
</DataTemplate>
|
|
|
|
</Setter>
|
|
|
|
<Setter Property="ItemContainerTheme" Value="{StaticResource FAComboBoxItemHybridModelTheme}" />
|
|
|
|
</ControlTheme>
|
|
|
|
|
|
|
|
</ResourceDictionary>
|