Files
egtstone3d/EgtColorPicker/EgtColorPickerV.xaml
Demetrio Cassarino a4b32b186f -aggiunto scelta toppaneltema
-piccoli aggiustamenti
2025-01-28 16:07:13 +01:00

200 lines
10 KiB
XML

<EgtWPFLib5:EgtMainWindow x:Class="EgtColorPickerV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
Title="{Binding sTitle}"
WindowStartupLocation="CenterOwner"
Style="{StaticResource ColorPicker_Window}">
<Grid Style="{StaticResource TopPanel_Grid}">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid Style="{StaticResource TopPanel_Grid}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid Style="{StaticResource TopPanel_Grid}">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TabControl Style="{StaticResource TreeView_TC}">
<TabItem Header="{Binding BasicColor_Msg}">
<Grid Style="{StaticResource EgtColorPicker_Grid}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<ListBox ItemsSource="{Binding BasicColors}"
SelectedItem="{Binding SelColor}"
ItemContainerStyle="{StaticResource BasicColorsItem_ListBox}"
Style="{StaticResource BasicColors_ListBox}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="13"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Rectangle Fill="{Binding Fill}"
Style="{StaticResource EgtColorPicker_Rect}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</TabItem>
<TabItem Header="{Binding ColorPicker_Msg}">
<TabItem.Resources>
<Style TargetType="{x:Type EgtWPFLib5:EgtHexItem}" BasedOn="{StaticResource EgtHexItem}">
<Setter Property="BorderThickness" Value="1.5"/>
<Setter Property="BorderBrush" Value="{StaticResource EgalwareWhite}"/>
</Style>
</TabItem.Resources>
<EgtWPFLib5:EgtHexList ItemsSource="{Binding HexList}"
SelectedItem="{Binding sHexSelColor}"
Style="{StaticResource EgtHexList}">
<EgtWPFLib5:EgtHexList.ItemTemplate>
<DataTemplate/>
</EgtWPFLib5:EgtHexList.ItemTemplate>
<EgtWPFLib5:EgtHexList.ItemContainerStyle>
<Style TargetType="EgtWPFLib5:EgtHexItem" BasedOn="{StaticResource EgtHexItem}">
<Setter Property="Grid.Row" Value="{Binding nRow}"/>
<Setter Property="Grid.Column" Value="{Binding nColumn}"/>
<Setter Property="Background" Value="{Binding Background}"/>
</Style>
</EgtWPFLib5:EgtHexList.ItemContainerStyle>
</EgtWPFLib5:EgtHexList>
</TabItem>
<TabItem Header="{Binding ColorPickerTheme_Msg}">
<Grid Style="{StaticResource EgtColorPicker_Grid}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<ListBox ItemsSource="{Binding BasicColorsTheme}"
SelectedItem="{Binding SelColorTheme}"
ItemContainerStyle="{StaticResource BasicColorsItem_ListBox}"
Style="{StaticResource BasicColorsTheme_ListBox}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="13"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Rectangle Fill="{Binding Fill}"
Style="{StaticResource EgtColorPicker_Rect}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</TabItem>
</TabControl>
</Grid>
<Grid Grid.Column="1"
Style="{StaticResource CustomColor_Grid}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding CustomColor_Msg}"
Style="{StaticResource CustomColor_TxBl}"/>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<ListBox ItemsSource="{Binding CustomColors}"
SelectedItem="{Binding SelCustomColor}"
ItemContainerStyle="{StaticResource BasicColorsItem_ListBox}"
Style="{StaticResource BasicColors_ListBox}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="13"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Rectangle Fill="{Binding Fill}"
Style="{StaticResource EgtColorPicker_Rect}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
<Grid Grid.Row="2"
Style="{StaticResource CurrColor_Grid}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid Style="{StaticResource SaveColor_Grid}">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Rectangle Fill="{Binding CurrColor}"
Style="{StaticResource CurrColor_Rect}"/>
<Button Grid.Row="1"
x:Name="SaveColor"
Content="{Binding AddCColor_Msg}"
Command="{Binding SaveColor_Command}"
Style="{StaticResource LeftPanel_TextButton}"/>
</Grid>
<Grid Grid.Column="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<TextBlock Text="{Binding Red_Msg}"
Style="{StaticResource Red_TxBl}"/>
<TextBox Grid.Column="1"
Text="{Binding Red, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource Red_TxBx}"/>
<TextBlock Grid.Row="1"
Text="{Binding Green_Msg}"
Style="{StaticResource Color_TxBl}"/>
<TextBox Grid.Column="1"
Grid.Row="1"
Text="{Binding Green, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource ColorPicker_TxBx}"/>
<TextBlock Grid.Row="2"
Text="{Binding Blu_Msg}"
Style="{StaticResource Color_TxBl}"/>
<TextBox Grid.Column="1"
Grid.Row="2"
Text="{Binding Blue, UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource ColorPicker_TxBx}"/>
<TextBlock Grid.Row="3"
Text="{Binding Hexadecimal_Msg}"
Style="{StaticResource Color_TxBl}"/>
<TextBox Grid.Column="1"
Grid.Row="3"
Text="{Binding Hexadecimal}"
Style="{StaticResource ColorPicker_TxBx}"/>
</Grid>
</Grid>
</Grid>
</Grid>
<UniformGrid Grid.Row="2"
Rows="1"
Style="{StaticResource EgtColorPicker_UniformGrid}">
<Button IsDefault="True"
Content="OK"
Command="{Binding Ok_Command}"
Style="{StaticResource EgtColorPicker_Btn}"/>
<Button Content="Cancel"
Command="{Binding Cancel_Command}"
Style="{StaticResource EgtColorPicker_Btn}"/>
</UniformGrid>
</Grid>
</EgtWPFLib5:EgtMainWindow>