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.
76 lines
3.4 KiB
76 lines
3.4 KiB
<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" |
|
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="Template"> |
|
<ControlTemplate> |
|
<Expander |
|
VerticalContentAlignment="Top" |
|
HorizontalAlignment="{TemplateBinding HorizontalAlignment}" |
|
VerticalAlignment="{TemplateBinding VerticalAlignment}"> |
|
|
|
<Expander.Header> |
|
<Grid ColumnDefinitions="*,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}"/> |
|
</Grid> |
|
</Expander.Header> |
|
|
|
<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> |
|
|
|
</Expander> |
|
</ControlTemplate> |
|
</Setter> |
|
</Style> |
|
</Styles>
|
|
|