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.
88 lines
4.4 KiB
88 lines
4.4 KiB
<Styles xmlns="https://github.com/avaloniaui" |
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
xmlns:controls="using:StabilityMatrix.Avalonia.Controls" |
|
xmlns:local="clr-namespace:StabilityMatrix.Avalonia" |
|
xmlns:mocks="clr-namespace:StabilityMatrix.Avalonia.DesignData" |
|
xmlns:vmInference="clr-namespace:StabilityMatrix.Avalonia.ViewModels.Inference" |
|
xmlns:fluentIcons="clr-namespace:FluentIcons.FluentAvalonia;assembly=FluentIcons.FluentAvalonia" |
|
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia" |
|
xmlns:modules="clr-namespace:StabilityMatrix.Avalonia.ViewModels.Inference.Modules" |
|
xmlns:sg="clr-namespace:SpacedGridControl.Avalonia;assembly=SpacedGridControl.Avalonia" |
|
x:DataType="vmInference:StackEditableCardViewModel"> |
|
|
|
<Design.PreviewWith> |
|
<Grid Width="500" Height="600"> |
|
<controls:StackEditableCard |
|
DataContext="{x:Static mocks:DesignData.StackEditableCardViewModel}"/> |
|
</Grid> |
|
</Design.PreviewWith> |
|
|
|
<!-- Like StackCard but draggable items --> |
|
<Style Selector="controls|StackEditableCard"> |
|
<Setter Property="IsListBoxEditEnabled" Value="{Binding IsEditEnabled, Mode=TwoWay}"/> |
|
<Setter Property="Template"> |
|
<ControlTemplate> |
|
<ScrollViewer> |
|
<Grid RowDefinitions="Auto,*"> |
|
<controls:Card |
|
Classes="transparent" |
|
Margin="0,0,0,3" |
|
Padding="0,4"> |
|
<sg:SpacedGrid ColumnDefinitions="Auto,*,Auto,Auto" ColumnSpacing="8"> |
|
<TextBlock Text="{Binding Title}" VerticalAlignment="Center"/> |
|
<GridSplitter ShowsPreview="False" IsEnabled="False" MaxHeight="10" Grid.Column="1" /> |
|
<!-- Edit button --> |
|
<ToggleButton Grid.Column="2" |
|
Name="PART_EditButton" |
|
VerticalAlignment="Bottom" |
|
CornerRadius="4" |
|
Padding="12,4" |
|
IsEnabled="{Binding !!Cards.Count}" |
|
IsChecked="{Binding IsEditEnabled}"> |
|
<fluentIcons:SymbolIcon Symbol="Edit" /> |
|
</ToggleButton> |
|
<!-- Add button --> |
|
<Button Grid.Column="3" |
|
Name="PART_AddButton" |
|
VerticalAlignment="Bottom" |
|
CornerRadius="4" |
|
Padding="12,4" > |
|
<fluentIcons:SymbolIcon Symbol="Add" IsFilled="True" /> |
|
</Button> |
|
</sg:SpacedGrid> |
|
|
|
</controls:Card> |
|
|
|
<ListBox |
|
x:Name="PART_ListBox" |
|
Grid.Row="1" |
|
Theme="{StaticResource DraggableListBoxTheme}" |
|
ItemsSource="{Binding Cards}"> |
|
<ListBox.DataTemplates> |
|
<local:ViewLocator/> |
|
</ListBox.DataTemplates> |
|
|
|
<ListBox.ItemsPanel> |
|
<ItemsPanelTemplate> |
|
<StackPanel Spacing="0" /> |
|
</ItemsPanelTemplate> |
|
</ListBox.ItemsPanel> |
|
</ListBox> |
|
</Grid> |
|
|
|
|
|
</ScrollViewer> |
|
</ControlTemplate> |
|
</Setter> |
|
|
|
<!--<Style Selector="^:editEnabled"> |
|
<Style Selector="^ /template/ Expander"> |
|
<Setter Property="IsEnabled" Value="False" /> |
|
<Setter Property="Background" Value="Magenta"/> |
|
</Style> |
|
<Style Selector="^ /template/ controls|DraggableListBox#PART_ListBox Expander"> |
|
<Setter Property="IsEnabled" Value="False" /> |
|
</Style> |
|
</Style>--> |
|
</Style> |
|
</Styles>
|
|
|