2023-02-09 18:43:02 +08:00
|
|
|
<UserControl
|
|
|
|
|
x:Class="Semi.Avalonia.Demo.Pages.ColorPickerDemo"
|
|
|
|
|
xmlns="https://github.com/avaloniaui"
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
2025-03-10 11:04:09 +08:00
|
|
|
xmlns:semi="https://irihi.tech/semi"
|
2023-02-09 18:43:02 +08:00
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
2024-08-11 19:11:11 +08:00
|
|
|
d:DesignHeight="1450"
|
2023-02-09 18:43:02 +08:00
|
|
|
d:DesignWidth="800"
|
|
|
|
|
mc:Ignorable="d">
|
2024-08-12 16:35:51 +08:00
|
|
|
<ScrollViewer>
|
|
|
|
|
<StackPanel Spacing="20">
|
2025-03-10 11:19:56 +08:00
|
|
|
<StackPanel Orientation="Horizontal" Spacing="20">
|
2024-08-13 14:45:10 +08:00
|
|
|
<ColorView Name="Test" ColorSpectrumShape="Ring" />
|
2024-08-12 16:35:51 +08:00
|
|
|
<ColorView ColorSpectrumShape="Box" />
|
|
|
|
|
<ColorView Palette="{DynamicResource SemiColorPalette}" />
|
|
|
|
|
</StackPanel>
|
2025-03-10 11:19:56 +08:00
|
|
|
<StackPanel Orientation="Horizontal">
|
2024-08-12 16:35:51 +08:00
|
|
|
<ColorView
|
2024-08-13 14:45:10 +08:00
|
|
|
Name="SimpleColorViewTest"
|
2025-03-10 11:19:56 +08:00
|
|
|
HsvColor="hsv(180,80%,70%)"
|
2024-08-12 16:35:51 +08:00
|
|
|
IsAlphaVisible="True"
|
2024-10-18 14:19:32 +08:00
|
|
|
Theme="{StaticResource SimpleColorView}" />
|
2024-08-13 14:45:10 +08:00
|
|
|
<StackPanel>
|
|
|
|
|
<TextBlock Text="{Binding #SimpleColorViewTest.HsvColor}" />
|
|
|
|
|
<TextBlock Text="{Binding #SimpleColorViewTest.Color}" />
|
|
|
|
|
</StackPanel>
|
2024-08-12 16:35:51 +08:00
|
|
|
</StackPanel>
|
2025-03-10 11:19:56 +08:00
|
|
|
<StackPanel Orientation="Horizontal" Spacing="8">
|
|
|
|
|
<ColorPicker ColorSpectrumShape="Ring">
|
2024-08-12 16:35:51 +08:00
|
|
|
<ColorPicker.Palette>
|
2025-03-10 11:04:09 +08:00
|
|
|
<FlatHalfColorPalette />
|
2024-08-12 16:35:51 +08:00
|
|
|
</ColorPicker.Palette>
|
|
|
|
|
</ColorPicker>
|
2025-03-10 11:19:56 +08:00
|
|
|
<ColorPicker ColorSpectrumShape="Box">
|
2024-08-12 16:35:51 +08:00
|
|
|
<ColorPicker.Palette>
|
2025-03-10 11:04:09 +08:00
|
|
|
<semi:SemiColorLightPalette />
|
2024-08-12 16:35:51 +08:00
|
|
|
</ColorPicker.Palette>
|
|
|
|
|
</ColorPicker>
|
2024-10-18 14:19:32 +08:00
|
|
|
<ColorPicker
|
2025-03-10 11:19:56 +08:00
|
|
|
Theme="{DynamicResource HexColorPicker}"
|
|
|
|
|
ColorSpectrumShape="Box">
|
2024-08-12 16:35:51 +08:00
|
|
|
<ColorPicker.Palette>
|
2025-03-10 11:04:09 +08:00
|
|
|
<semi:SemiColorLightPalette />
|
2024-08-12 16:35:51 +08:00
|
|
|
</ColorPicker.Palette>
|
|
|
|
|
</ColorPicker>
|
|
|
|
|
</StackPanel>
|
2025-03-10 11:19:56 +08:00
|
|
|
<StackPanel HorizontalAlignment="Left">
|
|
|
|
|
<TextBlock Text="Use Style to customize button" />
|
2024-10-18 14:19:32 +08:00
|
|
|
<ColorPicker
|
|
|
|
|
Margin="8"
|
2025-03-12 13:59:32 +08:00
|
|
|
MinWidth="32"
|
2025-03-10 11:19:56 +08:00
|
|
|
HsvColor="hsv(180,80%,70%)">
|
2024-10-18 14:19:32 +08:00
|
|
|
<ColorPicker.Content>
|
|
|
|
|
<Border
|
|
|
|
|
Margin="1"
|
2025-03-10 11:19:56 +08:00
|
|
|
Background="{Binding $parent[ColorPicker].HsvColor, Converter={StaticResource ToBrushConverter}}"
|
2024-10-18 14:19:32 +08:00
|
|
|
CornerRadius="1" />
|
|
|
|
|
</ColorPicker.Content>
|
|
|
|
|
<ColorPicker.Styles>
|
|
|
|
|
<Style Selector="DropDownButton">
|
2025-03-10 11:19:56 +08:00
|
|
|
<Setter Property="Padding" Value="0" />
|
2024-10-18 14:19:32 +08:00
|
|
|
<Style Selector="^ /template/ PathIcon">
|
2025-03-10 11:19:56 +08:00
|
|
|
<Setter Property="IsVisible" Value="False" />
|
2024-10-18 14:19:32 +08:00
|
|
|
</Style>
|
|
|
|
|
</Style>
|
|
|
|
|
</ColorPicker.Styles>
|
|
|
|
|
</ColorPicker>
|
|
|
|
|
</StackPanel>
|
2025-03-10 11:19:56 +08:00
|
|
|
|
|
|
|
|
<StackPanel Orientation="Horizontal" Spacing="8">
|
2024-10-18 14:19:32 +08:00
|
|
|
<ColorPicker
|
2025-03-10 11:19:56 +08:00
|
|
|
Theme="{StaticResource SimpleColorPicker}"
|
|
|
|
|
HsvColor="hsv(180,80%,70%)" />
|
2024-10-18 14:19:32 +08:00
|
|
|
<ColorPicker
|
2025-03-10 11:19:56 +08:00
|
|
|
Theme="{StaticResource HexSimpleColorPicker}"
|
|
|
|
|
HsvColor="hsv(180,80%,70%)" />
|
2024-08-12 16:35:51 +08:00
|
|
|
</StackPanel>
|
2023-02-09 18:43:02 +08:00
|
|
|
</StackPanel>
|
2024-08-12 16:35:51 +08:00
|
|
|
</ScrollViewer>
|
|
|
|
|
</UserControl>
|