|
|
|
<Styles xmlns="https://github.com/avaloniaui"
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
xmlns:controls="using:StabilityMatrix.Avalonia.Controls"
|
|
|
|
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
|
|
|
xmlns:inference="clr-namespace:StabilityMatrix.Avalonia.ViewModels.Inference"
|
|
|
|
xmlns:mocks="clr-namespace:StabilityMatrix.Avalonia.DesignData"
|
|
|
|
xmlns:models="clr-namespace:StabilityMatrix.Core.Models;assembly=StabilityMatrix.Core"
|
|
|
|
xmlns:lang="clr-namespace:StabilityMatrix.Avalonia.Languages"
|
|
|
|
x:DataType="inference:ModelCardViewModel">
|
|
|
|
<Design.PreviewWith>
|
|
|
|
<Panel Width="400" Height="200">
|
|
|
|
<StackPanel VerticalAlignment="Center" Width="300">
|
|
|
|
<controls:ModelCard DataContext="{x:Static mocks:DesignData.ModelCardViewModel}"/>
|
|
|
|
</StackPanel>
|
|
|
|
</Panel>
|
|
|
|
</Design.PreviewWith>
|
|
|
|
|
|
|
|
<Style Selector="controls|ModelCard">
|
|
|
|
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
|
|
|
<Setter Property="Template">
|
|
|
|
<ControlTemplate>
|
|
|
|
<controls:Card Padding="12">
|
|
|
|
<Grid RowDefinitions="*,*,*" ColumnDefinitions="Auto,*,Auto">
|
|
|
|
<!-- Model -->
|
|
|
|
<TextBlock
|
|
|
|
Grid.Column="0"
|
|
|
|
TextAlignment="Left"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
MinWidth="60"
|
|
|
|
Text="{x:Static lang:Resources.Label_Model}" />
|
|
|
|
<ui:FAComboBox
|
|
|
|
Grid.Row="0"
|
|
|
|
Grid.Column="1"
|
|
|
|
IsTextSearchEnabled="True"
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
ItemsSource="{Binding ClientManager.Models}"
|
|
|
|
DisplayMemberBinding="{Binding ShortDisplayName}"
|
|
|
|
SelectedItem="{Binding SelectedModel}">
|
|
|
|
<!--<ui:FAComboBox.ItemTemplate>
|
|
|
|
<DataTemplate DataType="models:HybridModelFile">
|
|
|
|
<Grid RowDefinitions="Auto,Auto" ColumnDefinitions="Auto,*">
|
|
|
|
<controls:BetterAdvancedImage
|
|
|
|
Grid.Row="0"
|
|
|
|
Grid.Column="0"
|
|
|
|
Grid.RowSpan="2"
|
|
|
|
Margin="0,0,8,0"
|
|
|
|
Height="32"
|
|
|
|
Width="32"
|
|
|
|
Stretch="UniformToFill"
|
|
|
|
StretchDirection="Both"
|
|
|
|
RenderOptions.BitmapInterpolationMode="HighQuality"
|
|
|
|
Source="{Binding Local.PreviewImageFullPathGlobal}">
|
|
|
|
<controls:BetterAdvancedImage.Clip>
|
|
|
|
<EllipseGeometry Rect="0,0,32,32" />
|
|
|
|
</controls:BetterAdvancedImage.Clip>
|
|
|
|
</controls:BetterAdvancedImage>
|
|
|
|
<TextBlock
|
|
|
|
Grid.Row="0"
|
|
|
|
Grid.Column="1"
|
|
|
|
Text="{Binding Local.ConnectedModelInfo.VersionName}"/>
|
|
|
|
<TextBlock
|
|
|
|
FontSize="11"
|
|
|
|
Grid.Row="1"
|
|
|
|
Grid.Column="1"
|
|
|
|
Text="{Binding Local.ConnectedModelInfo.ModelName}"/>
|
|
|
|
</Grid>
|
|
|
|
</DataTemplate>
|
|
|
|
</ui:FAComboBox.ItemTemplate>-->
|
|
|
|
</ui:FAComboBox>
|
|
|
|
|
|
|
|
<Button
|
|
|
|
Grid.Row="0"
|
|
|
|
Grid.Column="2"
|
|
|
|
Margin="8,0,0,0">
|
|
|
|
<ui:SymbolIcon FontSize="16" Symbol="Setting" />
|
|
|
|
<Button.Flyout>
|
|
|
|
<ui:FAMenuFlyout Placement="BottomEdgeAlignedLeft">
|
|
|
|
<ui:ToggleMenuFlyoutItem
|
|
|
|
IsChecked="{Binding IsRefinerSelectionEnabled}"
|
|
|
|
Text="{x:Static lang:Resources.Label_Refiner}"/>
|
|
|
|
<ui:ToggleMenuFlyoutItem
|
|
|
|
IsChecked="{Binding IsVaeSelectionEnabled}"
|
|
|
|
Text="{x:Static lang:Resources.Label_VAE}"/>
|
|
|
|
</ui:FAMenuFlyout>
|
|
|
|
</Button.Flyout>
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
<!-- Refiner -->
|
|
|
|
<TextBlock
|
|
|
|
Grid.Column="0"
|
|
|
|
Grid.Row="1"
|
|
|
|
MinWidth="60"
|
|
|
|
IsVisible="{Binding IsRefinerSelectionEnabled}"
|
|
|
|
Margin="0,8,0,0"
|
|
|
|
TextAlignment="Left"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
Text="{x:Static lang:Resources.Label_Refiner}" />
|
|
|
|
|
|
|
|
<ui:FAComboBox
|
|
|
|
Grid.Row="1"
|
|
|
|
Grid.Column="1"
|
|
|
|
Grid.ColumnSpan="2"
|
|
|
|
Margin="0,8,0,0"
|
|
|
|
IsTextSearchEnabled="True"
|
|
|
|
IsVisible="{Binding IsRefinerSelectionEnabled}"
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
ItemsSource="{Binding ClientManager.Models}"
|
|
|
|
DisplayMemberBinding="{Binding ShortDisplayName}"
|
|
|
|
SelectedItem="{Binding SelectedRefiner}" />
|
|
|
|
|
|
|
|
<!-- VAE -->
|
|
|
|
<TextBlock
|
|
|
|
Grid.Column="0"
|
|
|
|
Grid.Row="2"
|
|
|
|
MinWidth="60"
|
|
|
|
IsVisible="{Binding IsVaeSelectionEnabled}"
|
|
|
|
Margin="0,8,0,0"
|
|
|
|
TextAlignment="Left"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
Text="{x:Static lang:Resources.Label_VAE}" />
|
|
|
|
|
|
|
|
<ui:FAComboBox
|
|
|
|
Grid.Row="2"
|
|
|
|
Grid.Column="1"
|
|
|
|
Grid.ColumnSpan="2"
|
|
|
|
Margin="0,8,0,0"
|
|
|
|
IsTextSearchEnabled="True"
|
|
|
|
IsVisible="{Binding IsVaeSelectionEnabled}"
|
|
|
|
HorizontalAlignment="Stretch"
|
|
|
|
ItemsSource="{Binding ClientManager.VaeModels}"
|
|
|
|
DisplayMemberBinding="{Binding ShortDisplayName}"
|
|
|
|
SelectedItem="{Binding SelectedVae}" />
|
|
|
|
|
|
|
|
</Grid>
|
|
|
|
</controls:Card>
|
|
|
|
</ControlTemplate>
|
|
|
|
</Setter>
|
|
|
|
</Style>
|
|
|
|
</Styles>
|