Browse Source

ColorPicker: added 3 properties; AvailableColorsHeader, StandardColorsHeader, and RecentColorsHeader which will allow you to change the text for the respective sections.

pull/1645/head
brianlagunas_cp 15 years ago
parent
commit
ec4d1c039c
  1. 35
      ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/ColorPicker/Implementation/ColorPicker.cs
  2. 6
      ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/ColorPicker/Themes/Generic.xaml

35
ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/ColorPicker/Implementation/ColorPicker.cs

@ -33,6 +33,17 @@ namespace Microsoft.Windows.Controls
#endregion //AvailableColors
#region AvailableColorsHeader
public static readonly DependencyProperty AvailableColorsHeaderProperty = DependencyProperty.Register("AvailableColorsHeader", typeof(string), typeof(ColorPicker), new UIPropertyMetadata("Available Colors"));
public string AvailableColorsHeader
{
get { return (string)GetValue(AvailableColorsHeaderProperty); }
set { SetValue(AvailableColorsHeaderProperty, value); }
}
#endregion //AvailableColorsHeader
#region ButtonStyle
public static readonly DependencyProperty ButtonStyleProperty = DependencyProperty.Register("ButtonStyle", typeof(Style), typeof(ColorPicker));
@ -77,6 +88,17 @@ namespace Microsoft.Windows.Controls
#endregion //RecentColors
#region RecentColorsHeader
public static readonly DependencyProperty RecentColorsHeaderProperty = DependencyProperty.Register("RecentColorsHeader", typeof(string), typeof(ColorPicker), new UIPropertyMetadata("Recent Colors"));
public string RecentColorsHeader
{
get { return (string)GetValue(RecentColorsHeaderProperty); }
set { SetValue(RecentColorsHeaderProperty, value); }
}
#endregion //RecentColorsHeader
#region SelectedColor
public static readonly DependencyProperty SelectedColorProperty = DependencyProperty.Register("SelectedColor", typeof(Color), typeof(ColorPicker), new FrameworkPropertyMetadata(Colors.Black, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, new PropertyChangedCallback(OnSelectedColorPropertyChanged)));
@ -122,7 +144,7 @@ namespace Microsoft.Windows.Controls
{
get { return (bool)GetValue(ShowAdvancedButtonProperty); }
set { SetValue(ShowAdvancedButtonProperty, value); }
}
}
#endregion //ShowAdvancedButton
@ -170,6 +192,17 @@ namespace Microsoft.Windows.Controls
#endregion //StandardColors
#region StandardColorsHeader
public static readonly DependencyProperty StandardColorsHeaderProperty = DependencyProperty.Register("StandardColorsHeader", typeof(string), typeof(ColorPicker), new UIPropertyMetadata("Standard Colors"));
public string StandardColorsHeader
{
get { return (string)GetValue(StandardColorsHeaderProperty); }
set { SetValue(StandardColorsHeaderProperty, value); }
}
#endregion //StandardColorsHeader
#endregion //Properties
#region Constructors

6
ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/ColorPicker/Themes/Generic.xaml

@ -185,7 +185,7 @@
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock Text="Available Colors" Background="AliceBlue" Padding="2" Margin="0,0,0,1" />
<TextBlock Text="{TemplateBinding AvailableColorsHeader}" Background="AliceBlue" Padding="2" Margin="0,0,0,1" />
<ListBox x:Name="PART_AvailableColors" Grid.Row="1" Background="Transparent" BorderThickness="0" SelectionMode="Single"
ItemsSource="{Binding AvailableColors, RelativeSource={RelativeSource TemplatedParent}}"
ItemTemplate="{StaticResource ColorItemTemplate}"
@ -207,7 +207,7 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Text="Standard Colors" Background="AliceBlue" Padding="2" Margin="0,1,0,1"/>
<TextBlock Text="{TemplateBinding StandardColorsHeader}" Background="AliceBlue" Padding="2" Margin="0,1,0,1"/>
<ListBox x:Name="PART_StandardColors" Grid.Row="1" SelectionMode="Single" Background="Transparent" BorderThickness="0"
ItemsSource="{Binding StandardColors, RelativeSource={RelativeSource TemplatedParent}}"
ItemTemplate="{StaticResource ColorItemTemplate}"
@ -229,7 +229,7 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Text="Recent Colors" Background="AliceBlue" Padding="2" Margin="0,1,0,1"/>
<TextBlock Text="{TemplateBinding RecentColorsHeader}" Background="AliceBlue" Padding="2" Margin="0,1,0,1"/>
<ListBox x:Name="PART_RecentColors" Grid.Row="1" SelectionMode="Single" Background="Transparent" BorderThickness="0"
ItemsSource="{Binding RecentColors, RelativeSource={RelativeSource TemplatedParent}}"
ItemTemplate="{StaticResource ColorItemTemplate}"

Loading…
Cancel
Save