You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
95 lines
4.6 KiB
95 lines
4.6 KiB
1 year ago
|
<ResourceDictionary
|
||
|
xmlns="https://github.com/avaloniaui"
|
||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||
|
xmlns:controls="clr-namespace:StabilityMatrix.Avalonia.Controls"
|
||
|
xmlns:models="clr-namespace:StabilityMatrix.Core.Models;assembly=StabilityMatrix.Core"
|
||
|
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia">
|
||
|
<Design.PreviewWith>
|
||
|
<Panel Width="400" Height="600">
|
||
|
<Panel Width="350" Height="200" />
|
||
|
</Panel>
|
||
|
</Design.PreviewWith>
|
||
|
|
||
|
<!-- ReSharper disable once Xaml.StaticResourceNotResolved -->
|
||
|
<ControlTheme
|
||
|
x:Key="FAComboBoxItemHybridModelTheme"
|
||
|
BasedOn="{StaticResource {x:Type ui:FAComboBoxItem}}"
|
||
|
TargetType="ui:FAComboBoxItem">
|
||
|
<!--<Setter Property="ContentTemplate">
|
||
|
<DataTemplate DataType="models:HybridModelFile">
|
||
|
<StackPanel>
|
||
|
<TextBlock Text="{Binding ShortDisplayName}" TextTrimming="CharacterEllipsis" />
|
||
|
</StackPanel>
|
||
|
</DataTemplate>
|
||
|
</Setter>-->
|
||
|
<Setter Property="ToolTip.Placement" Value="RightEdgeAlignedTop" />
|
||
|
<Setter Property="ToolTip.Tip">
|
||
|
<Template>
|
||
|
<StackPanel
|
||
|
x:DataType="models:HybridModelFile"
|
||
|
Orientation="Horizontal"
|
||
|
Spacing="6">
|
||
|
<!-- 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" />
|
||
|
<Grid
|
||
|
MaxWidth="300"
|
||
|
VerticalAlignment="Stretch"
|
||
|
RowDefinitions="Auto,Auto,*">
|
||
|
<!-- 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.ConnectedModelInfo.ModelName, FallbackValue=''}"
|
||
|
TextWrapping="WrapWithOverflow" />
|
||
|
<!-- Version -->
|
||
|
<TextBlock
|
||
|
Grid.Row="1"
|
||
|
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.ConnectedModelInfo.VersionName, FallbackValue=''}"
|
||
|
TextWrapping="WrapWithOverflow" />
|
||
|
<!-- Path -->
|
||
|
<TextBlock
|
||
|
Grid.Row="2"
|
||
|
HorizontalAlignment="Left"
|
||
|
FontSize="13"
|
||
|
Foreground="{DynamicResource TextFillColorTertiaryBrush}"
|
||
|
Text="{Binding FileName}"
|
||
|
TextWrapping="Wrap" />
|
||
|
</Grid>
|
||
|
</StackPanel>
|
||
|
</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>
|