|
|
|
<Styles xmlns="https://github.com/avaloniaui"
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
xmlns:controls="using:StabilityMatrix.Avalonia.Controls"
|
|
|
|
xmlns:mocks="clr-namespace:StabilityMatrix.Avalonia.DesignData"
|
|
|
|
xmlns:vmInference="clr-namespace:StabilityMatrix.Avalonia.ViewModels.Inference"
|
|
|
|
xmlns:local="clr-namespace:StabilityMatrix.Avalonia"
|
|
|
|
xmlns:fluentIcons="clr-namespace:FluentIcons.FluentAvalonia;assembly=FluentIcons.FluentAvalonia"
|
|
|
|
x:DataType="vmInference:StackExpanderViewModel">
|
|
|
|
|
|
|
|
<Design.PreviewWith>
|
|
|
|
<Grid Width="500" Height="800">
|
|
|
|
<StackPanel>
|
|
|
|
<controls:StackExpander
|
|
|
|
DataContext="{x:Static mocks:DesignData.StackExpanderViewModel}"/>
|
|
|
|
</StackPanel>
|
|
|
|
</Grid>
|
|
|
|
</Design.PreviewWith>
|
|
|
|
|
|
|
|
<Style Selector="controls|StackExpander">
|
|
|
|
<!-- Set Defaults -->
|
|
|
|
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
|
|
|
<Setter Property="Template">
|
|
|
|
<ControlTemplate>
|
|
|
|
<Expander
|
|
|
|
VerticalContentAlignment="Top"
|
|
|
|
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
|
|
|
HorizontalContentAlignment="Stretch"
|
|
|
|
VerticalAlignment="{TemplateBinding VerticalAlignment}">
|
|
|
|
|
|
|
|
<Expander.Styles>
|
|
|
|
<Style Selector="Expander /template/ ToggleButton#PART_toggle">
|
|
|
|
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
|
|
|
</Style>
|
|
|
|
</Expander.Styles>
|
|
|
|
|
|
|
|
<Expander.Header>
|
|
|
|
<Grid ColumnDefinitions="Auto,Auto,*,Auto">
|
|
|
|
<ToggleSwitch
|
|
|
|
Margin="2,0,0,2"
|
|
|
|
IsChecked="{Binding IsEnabled}"
|
|
|
|
VerticalContentAlignment="Center"
|
|
|
|
OnContent=""
|
|
|
|
OffContent=""/>
|
|
|
|
<TextBlock
|
|
|
|
Grid.Column="1"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
Text="{Binding TitleExtra}"
|
|
|
|
IsVisible="{Binding TitleExtra, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
|
|
|
<TextBlock
|
|
|
|
Grid.Column="2"
|
|
|
|
VerticalAlignment="Center"
|
|
|
|
Text="{Binding Title}"/>
|
|
|
|
<Button
|
|
|
|
IsVisible="{Binding IsEditEnabled}"
|
|
|
|
Command="{Binding RemoveFromParentListCommand}"
|
|
|
|
Classes="transparent-red"
|
|
|
|
Grid.Column="3"
|
|
|
|
Padding="10,4"
|
|
|
|
HorizontalAlignment="Right">
|
|
|
|
<fluentIcons:SymbolIcon Symbol="Delete" FontSize="16" />
|
|
|
|
</Button>
|
|
|
|
</Grid>
|
|
|
|
</Expander.Header>
|
|
|
|
|
|
|
|
<Panel>
|
|
|
|
<ItemsControl
|
|
|
|
VerticalAlignment="Top"
|
|
|
|
ItemsSource="{Binding Cards}">
|
|
|
|
|
|
|
|
<ItemsControl.Styles>
|
|
|
|
<Style Selector="controls|Card">
|
|
|
|
<Setter Property="IsCardVisualsEnabled" Value="False"/>
|
|
|
|
</Style>
|
|
|
|
</ItemsControl.Styles>
|
|
|
|
|
|
|
|
<ItemsControl.DataTemplates>
|
|
|
|
<local:ViewLocator/>
|
|
|
|
</ItemsControl.DataTemplates>
|
|
|
|
|
|
|
|
<ItemsControl.ItemsPanel>
|
|
|
|
<ItemsPanelTemplate>
|
|
|
|
<StackPanel
|
|
|
|
x:Name="PART_ItemsPanel"
|
|
|
|
VerticalAlignment="Top"
|
|
|
|
Spacing="{TemplateBinding Spacing}" />
|
|
|
|
</ItemsPanelTemplate>
|
|
|
|
</ItemsControl.ItemsPanel>
|
|
|
|
</ItemsControl>
|
|
|
|
</Panel>
|
|
|
|
|
|
|
|
|
|
|
|
</Expander>
|
|
|
|
</ControlTemplate>
|
|
|
|
</Setter>
|
|
|
|
</Style>
|
|
|
|
</Styles>
|