|
1 | | -<UserControl xmlns="https://github.com/avaloniaui" |
2 | | - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
3 | | - xmlns:cb="using:HedgeModManager.UI.Controls.Basic" |
4 | | - xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
5 | | - xmlns:cc="using:HedgeModManager.UI.Controls.Codes" |
6 | | - xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
7 | | - xmlns:vmc="using:HedgeModManager.UI.ViewModels.Codes" |
8 | | - mc:Ignorable="d" d:DesignWidth="720" d:DesignHeight="390" |
9 | | - x:Class="HedgeModManager.UI.Controls.Codes.CodeCategory" |
10 | | - x:DataType="vmc:CodeCategoryViewModel"> |
11 | | - <StackPanel Orientation="Horizontal" Margin="0,4,0,0"> |
12 | | - <TextBlock Text="↳" FontWeight="Bold" /> |
13 | | - <StackPanel Margin="16,0,0,0"> |
14 | | - <TextBlock Text="{Binding Name}" Margin="0,0,0,2" FontWeight="Bold" /> |
15 | | - <ItemsControl ItemsSource="{Binding Categories}"> |
16 | | - <ItemsControl.ItemTemplate> |
17 | | - <DataTemplate> |
18 | | - <cc:CodeCategory /> |
19 | | - </DataTemplate> |
20 | | - </ItemsControl.ItemTemplate> |
21 | | - </ItemsControl> |
22 | | - <ItemsControl ItemsSource="{Binding Codes}"> |
23 | | - <ItemsControl.ItemTemplate> |
24 | | - <DataTemplate> |
25 | | - <cb:CheckBox Text="{Binding Code.Name}" IsChecked="{Binding Enabled}" /> |
26 | | - </DataTemplate> |
27 | | - </ItemsControl.ItemTemplate> |
28 | | - </ItemsControl> |
29 | | - </StackPanel> |
| 1 | +<cp:ButtonUserControl xmlns="https://github.com/avaloniaui" |
| 2 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 3 | + xmlns:cb="using:HedgeModManager.UI.Controls.Basic" |
| 4 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 5 | + xmlns:cc="using:HedgeModManager.UI.Controls.Codes" |
| 6 | + xmlns:cp="using:HedgeModManager.UI.Controls.Primitives" |
| 7 | + xmlns:materialIcons="using:Material.Icons.Avalonia" |
| 8 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 9 | + xmlns:vmc="using:HedgeModManager.UI.ViewModels.Codes" |
| 10 | + mc:Ignorable="d" d:DesignWidth="300" d:DesignHeight="500" |
| 11 | + x:Class="HedgeModManager.UI.Controls.Codes.CodeCategory" |
| 12 | + x:DataType="vmc:CodeCategoryViewModel" |
| 13 | + Background="{DynamicResource BackgroundL0Brush}" |
| 14 | + Initialized="OnInitialized" |
| 15 | + Loaded="OnLoaded"> |
| 16 | + <StackPanel> |
| 17 | + <Border Classes.codeCategory="True" |
| 18 | + Classes.pressed="{Binding Pressed, RelativeSource={RelativeSource AncestorType=cc:CodeCategory}}" |
| 19 | + Height="38" Margin="4" Cursor="Hand" |
| 20 | + CornerRadius="12" BorderThickness="1" |
| 21 | + PointerPressed="OnPointerPressed" |
| 22 | + PointerReleased="OnPointerReleased" |
| 23 | + PointerEntered="OnPointerEntered"> |
| 24 | + <StackPanel Margin="0,0,24,0" Orientation="Horizontal"> |
| 25 | + <materialIcons:MaterialIcon Kind="ChevronRight" Width="30" Height="30" Foreground="{DynamicResource Text.SubBrush}"> |
| 26 | + <materialIcons:MaterialIcon.RenderTransform> |
| 27 | + <RotateTransform Angle="{Binding RotationAngle, RelativeSource={RelativeSource AncestorType=cc:CodeCategory}}" /> |
| 28 | + </materialIcons:MaterialIcon.RenderTransform> |
| 29 | + </materialIcons:MaterialIcon> |
| 30 | + <TextBlock Text="{Binding Name, Converter={StaticResource StringLocalizeConverter}}" VerticalAlignment="Center"/> |
| 31 | + </StackPanel> |
| 32 | + <Border.Transitions> |
| 33 | + <Transitions> |
| 34 | + <BrushTransition Property="Background" Duration="0:0:0.1"/> |
| 35 | + <BrushTransition Property="BorderBrush" Duration="0:0:0.1"/> |
| 36 | + <DoubleTransition Property="Opacity" Duration="0:0:0.1"/> |
| 37 | + </Transitions> |
| 38 | + </Border.Transitions> |
| 39 | + <Border.Styles> |
| 40 | + <Style Selector="Border.codeCategory"> |
| 41 | + <Setter Property="Opacity" Value="0.6" /> |
| 42 | + <Setter Property="Background" Value="{DynamicResource BackgroundL1Brush}" /> |
| 43 | + <Style Selector="^:pointerover"> |
| 44 | + <Setter Property="Background" Value="{DynamicResource Button.HoverBrush}"/> |
| 45 | + </Style> |
| 46 | + <Style Selector="^.pressed"> |
| 47 | + <Setter Property="Background" Value="{DynamicResource Button.PressedBrush}"/> |
| 48 | + </Style> |
| 49 | + </Style> |
| 50 | + </Border.Styles> |
| 51 | + </Border> |
| 52 | + <ItemsControl ItemsSource="{Binding Categories}" IsVisible="{Binding Expanded}"> |
| 53 | + <ItemsControl.ItemTemplate> |
| 54 | + <DataTemplate> |
| 55 | + <Grid ColumnDefinitions="32,*"> |
| 56 | + <Grid Grid.Column="0" VerticalAlignment="Stretch"> |
| 57 | + <Border Classes.treeElement="True" |
| 58 | + Classes.isLastElement="{Binding IsLastElement}" |
| 59 | + Width="2" |
| 60 | + Background="{DynamicResource BackgroundL1Brush}"> |
| 61 | + <Border.Styles> |
| 62 | + <Style Selector="Border.treeElement"> |
| 63 | + <Setter Property="Margin" Value="8,0,0,0" /> |
| 64 | + </Style> |
| 65 | + <Style Selector="Border.treeElement.isLastElement"> |
| 66 | + <Setter Property="Margin" Value="8,0,0,24" /> |
| 67 | + </Style> |
| 68 | + </Border.Styles> |
| 69 | + </Border> |
| 70 | + <Border Margin="22,22,0,0" Width="16" Height="2" |
| 71 | + VerticalAlignment="Top" |
| 72 | + Background="{DynamicResource BackgroundL1Brush}"/> |
| 73 | + </Grid> |
| 74 | + <cc:CodeCategory Grid.Column="1" /> |
| 75 | + </Grid> |
| 76 | + </DataTemplate> |
| 77 | + </ItemsControl.ItemTemplate> |
| 78 | + </ItemsControl> |
| 79 | + <ItemsControl ItemsSource="{Binding Codes}" IsVisible="{Binding Expanded}"> |
| 80 | + <ItemsControl.ItemTemplate> |
| 81 | + <DataTemplate> |
| 82 | + <Grid ColumnDefinitions="32,*"> |
| 83 | + <Grid Grid.Column="0" VerticalAlignment="Stretch"> |
| 84 | + <Border Classes.treeElement="True" |
| 85 | + Classes.isLastElement="{Binding IsLastElement}" |
| 86 | + Width="2" |
| 87 | + Background="{DynamicResource BackgroundL1Brush}"> |
| 88 | + <Border.Styles> |
| 89 | + <Style Selector="Border.treeElement"> |
| 90 | + <Setter Property="Margin" Value="8,0,0,0" /> |
| 91 | + </Style> |
| 92 | + <Style Selector="Border.treeElement.isLastElement"> |
| 93 | + <Setter Property="Margin" Value="8,0,0,24" /> |
| 94 | + </Style> |
| 95 | + </Border.Styles> |
| 96 | + </Border> |
| 97 | + <Border Margin="22,22,0,0" Width="16" Height="2" |
| 98 | + VerticalAlignment="Top" |
| 99 | + Background="{DynamicResource BackgroundL1Brush}"/> |
| 100 | + </Grid> |
| 101 | + <cc:CodeEntry Grid.Column="1" /> |
| 102 | + </Grid> |
| 103 | + </DataTemplate> |
| 104 | + </ItemsControl.ItemTemplate> |
| 105 | + </ItemsControl> |
30 | 106 | </StackPanel> |
31 | | -</UserControl> |
| 107 | +</cp:ButtonUserControl> |
0 commit comments