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"
|
2023-02-12 00:56:45 +08:00
|
|
|
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"
|
2023-02-18 21:02:58 +08:00
|
|
|
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>
|
2023-02-12 00:56:45 +08:00
|
|
|
<UserControl.Resources>
|
|
|
|
<ResourceDictionary>
|
|
|
|
<ResourceDictionary.MergedDictionaries>
|
2023-02-13 03:29:56 +08:00
|
|
|
<ResourceInclude Source="../Themes/ToggleButton.axaml" />
|
2023-02-12 00:56:45 +08:00
|
|
|
<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" />
|
2023-02-12 00:56:45 +08:00
|
|
|
</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>
|
|
|
|
<ToggleButton
|
|
|
|
Name="toggle"
|
|
|
|
HorizontalAlignment="Right"
|
2023-02-13 00:14:56 +08:00
|
|
|
IsChecked="True"
|
2023-02-13 03:29:56 +08:00
|
|
|
Theme="{DynamicResource SplitViewToggleButton}" />
|
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}"
|
|
|
|
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}" />
|
2023-02-12 00:56:45 +08:00
|
|
|
<TabControl>
|
|
|
|
<TabItem Header="Light">
|
2023-02-13 00:14:56 +08:00
|
|
|
<ItemsControl Margin="16" Items="{Binding LightLists}">
|
2023-02-12 00:56:45 +08:00
|
|
|
<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-02-12 00:56:45 +08:00
|
|
|
<ItemsControl Margin="4,0" Items="{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}"
|
2023-02-12 00:56:45 +08:00
|
|
|
Hex="{Binding Hex}" />
|
|
|
|
</DataTemplate>
|
|
|
|
</ItemsControl.ItemTemplate>
|
|
|
|
</ItemsControl>
|
|
|
|
</DataTemplate>
|
|
|
|
</ItemsControl.ItemTemplate>
|
|
|
|
</ItemsControl>
|
|
|
|
</TabItem>
|
|
|
|
<TabItem Header="Dark">
|
2023-02-13 00:14:56 +08:00
|
|
|
<ItemsControl Margin="16" Items="{Binding DarkLists}">
|
2023-02-12 00:56:45 +08:00
|
|
|
<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-02-12 00:56:45 +08:00
|
|
|
<ItemsControl Margin="4,0" Items="{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}"
|
2023-02-12 00:56:45 +08:00
|
|
|
Hex="{Binding Hex}" />
|
|
|
|
</DataTemplate>
|
|
|
|
</ItemsControl.ItemTemplate>
|
|
|
|
</ItemsControl>
|
|
|
|
</DataTemplate>
|
|
|
|
</ItemsControl.ItemTemplate>
|
|
|
|
</ItemsControl>
|
|
|
|
</TabItem>
|
|
|
|
</TabControl>
|
2023-02-13 02:17:38 +08:00
|
|
|
|
|
|
|
<ItemsControl Items="{Binding FunctionalColors}">
|
|
|
|
<ItemsControl.ItemTemplate>
|
|
|
|
<DataTemplate>
|
|
|
|
<!-- -->
|
|
|
|
<controls:FunctionalColorGroupControl
|
|
|
|
Title="{Binding Title}"
|
|
|
|
DarkColors="{Binding DarkColors}"
|
|
|
|
LightColors="{Binding LightColors}" />
|
|
|
|
</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>
|
|
|
|
</UserControl>
|