Browse Source

Added Card control

pull/55/head
JT 1 year ago
parent
commit
10d878a43f
  1. 23
      StabilityMatrix.Avalonia/Controls/Card.cs
  2. 11
      StabilityMatrix.Avalonia/Views/LaunchPageView.axaml

23
StabilityMatrix.Avalonia/Controls/Card.cs

@ -0,0 +1,23 @@
using Avalonia.Controls;
using Avalonia.Controls.Primitives;
using Avalonia.Styling;
namespace StabilityMatrix.Avalonia.Controls;
public class Card : Expander
{
public Card()
{
// Expander /template/ ToggleButton#PART_toggle
var customStyle = new Style(x =>
x.OfType<Expander>().Template().OfType<ToggleButton>().Name("PART_toggle"));
customStyle.Setters.Add(new Setter
{
Property = IsVisibleProperty,
Value = false
});
Styles.Add(customStyle);
}
}

11
StabilityMatrix.Avalonia/Views/LaunchPageView.axaml

@ -117,14 +117,9 @@
VerticalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"
FontFamily="Cascadia Code,Consolas,Menlo,Monospace" /> FontFamily="Cascadia Code,Consolas,Menlo,Monospace" />
<Expander IsExpanded="True" Grid.Row="1" Header="Header Stuff" Margin="16"> <controls:Card IsExpanded="True" Grid.Row="1" Header="Header Stuff" Margin="16">
<Expander.Styles> <TextBlock Text="Hello World"></TextBlock>
<Style Selector="Expander /template/ ToggleButton#PART_toggle"> </controls:Card>
<Setter Property="IsVisible" Value="False"/>
</Style>
</Expander.Styles>
<TextBlock Text="Hello World"></TextBlock>
</Expander>
<!--Command="{Binding LaunchWebUiCommand}"--> <!--Command="{Binding LaunchWebUiCommand}"-->
<!--Visibility="{Binding ShowWebUiButton, Converter={StaticResource BoolToVisConverter}}"--> <!--Visibility="{Binding ShowWebUiButton, Converter={StaticResource BoolToVisConverter}}"-->

Loading…
Cancel
Save