142 lines
7.6 KiB
Plaintext
Raw Normal View History

2023-02-11 15:50:39 +08:00
<UserControl
x:Class="Semi.Avalonia.Demo.Pages.PaletteDemo"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:Semi.Avalonia.Demo.Controls"
2023-02-11 15:50:39 +08:00
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
2023-02-11 23:04:07 +08:00
xmlns:viewModels="clr-namespace:Semi.Avalonia.Demo.ViewModels"
2023-02-11 15:50:39 +08:00
d:DesignHeight="450"
d:DesignWidth="800"
x:CompileBindings="True"
x:DataType="viewModels:PaletteDemoViewModel"
2023-02-11 15:50:39 +08:00
mc:Ignorable="d">
2023-02-11 23:04:07 +08:00
<Design.DataContext>
<viewModels:PaletteDemoViewModel />
</Design.DataContext>
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="../Themes/ToggleSwitch.axaml" />
<ResourceInclude Source="../Controls/ColorItemControl.axaml" />
2023-02-13 00:14:56 +08:00
<ResourceInclude Source="../Controls/ColorDetailControl.axaml" />
2023-02-13 02:17:38 +08:00
<ResourceInclude Source="../Controls/FunctionalColorGroupControl.axaml" />
2024-11-15 02:20:32 +08:00
<ResourceInclude Source="../Controls/ShadowGroupControl.axaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
2023-02-11 15:50:39 +08:00
<SplitView
2023-02-11 23:04:07 +08:00
Name="splitView"
CompactPaneLength="50"
2023-02-11 15:50:39 +08:00
DisplayMode="CompactInline"
IsPaneOpen="{Binding #toggle.IsChecked, Mode=TwoWay}"
OpenPaneLength="300"
PanePlacement="Right">
<SplitView.Pane>
2023-02-11 23:04:07 +08:00
<StackPanel>
<ToggleSwitch
2023-02-11 23:04:07 +08:00
Name="toggle"
HorizontalAlignment="Right"
2023-02-13 00:14:56 +08:00
IsChecked="True"
Theme="{DynamicResource SplitViewToggleSwitch}" />
2023-02-11 23:04:07 +08:00
<Border IsVisible="{Binding #splitView.IsPaneOpen}" Theme="{DynamicResource CardBorder}">
2023-02-13 03:29:56 +08:00
<Panel>
<TextBlock
IsVisible="{Binding SelectedColor, Converter={x:Static ObjectConverters.IsNull}}"
Text="Click on Color to Check Details"
TextWrapping="Wrap" />
<controls:ColorDetailControl
Background="{Binding SelectedColor.Brush}"
2023-03-27 11:25:47 +08:00
ColorResourceKey="{Binding SelectedColor.ColorResourceKey}"
2023-02-13 03:29:56 +08:00
IsVisible="{Binding SelectedColor, Converter={x:Static ObjectConverters.IsNotNull}}"
ResourceKey="{Binding SelectedColor.ResourceKey}"
ResourceName="{Binding SelectedColor.ColorDisplayName}" />
</Panel>
2023-02-11 23:04:07 +08:00
</Border>
</StackPanel>
2023-02-11 15:50:39 +08:00
</SplitView.Pane>
<SplitView.Content>
2023-02-11 23:04:07 +08:00
<ScrollViewer>
2023-02-13 11:15:01 +08:00
<StackPanel Margin="8,0">
2023-02-13 02:17:38 +08:00
<TextBlock
Classes="H3"
Text="Basic Colors"
Theme="{DynamicResource TitleTextBlock}" />
<TabControl>
<TabItem Header="Light">
2023-04-23 01:10:23 +08:00
<ItemsControl Margin="16" ItemsSource="{Binding LightLists}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
2023-02-13 00:14:56 +08:00
<DataTemplate x:DataType="viewModels:ColorListViewModel">
2023-04-23 01:10:23 +08:00
<ItemsControl Margin="4,0" ItemsSource="{Binding Color}">
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="viewModels:ColorItemViewModel">
<controls:ColorItemControl
2023-02-13 00:14:56 +08:00
Background="{Binding Brush}"
ColorName="{Binding ColorDisplayName}"
Foreground="{Binding TextBrush}"
Hex="{Binding Hex}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</TabItem>
<TabItem Header="Dark">
2023-04-23 01:10:23 +08:00
<ItemsControl Margin="16" ItemsSource="{Binding DarkLists}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
2023-02-13 00:14:56 +08:00
<DataTemplate x:DataType="viewModels:ColorListViewModel">
2023-04-23 01:10:23 +08:00
<ItemsControl Margin="4,0" ItemsSource="{Binding Color}">
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="viewModels:ColorItemViewModel">
<controls:ColorItemControl
2023-02-13 00:14:56 +08:00
Background="{Binding Brush}"
ColorName="{Binding ColorDisplayName}"
Foreground="{Binding TextBrush}"
Hex="{Binding Hex}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</TabItem>
</TabControl>
2023-02-13 02:17:38 +08:00
2023-04-23 01:10:23 +08:00
<ItemsControl ItemsSource="{Binding FunctionalColors}">
2023-02-13 02:17:38 +08:00
<ItemsControl.ItemTemplate>
<DataTemplate>
<controls:FunctionalColorGroupControl
Title="{Binding Title}"
DarkColors="{Binding DarkColors}"
LightColors="{Binding LightColors}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
2024-11-15 02:20:32 +08:00
<ItemsControl ItemsSource="{Binding Shadows}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<controls:ShadowGroupControl
Title="{Binding Title}"
DarkShadows="{Binding DarkShadows}"
LightShadows="{Binding LightShadows}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
2023-02-11 23:04:07 +08:00
</StackPanel>
</ScrollViewer>
2023-02-11 15:50:39 +08:00
</SplitView.Content>
</SplitView>
2024-11-15 02:20:32 +08:00
</UserControl>