title: WPF set a default value for exist property for custom control
body: <p>i made that custom button that lets me change the background color normal-hover-pressed-disabled</p>
  
  <p>i made a new properties for all of them with default values except for normal because it's already there but i don't know how  to set a default value for it</p>
  
  <pre><code>using System.Windows;
  using System.Windows.Controls;
  using System.Windows.Media;
  
  namespace ProPharmacyManagerW.Controls
  {
      class IconButton : Button
      {
          public static readonly DependencyProperty ImageProperty = DependencyProperty.Register("Image", typeof(ImageSource), typeof(IconButton), new PropertyMetadata(null));
          public static readonly DependencyProperty ImageHeightProperty = DependencyProperty.Register("ImageHeight", typeof(double), typeof(IconButton), new PropertyMetadata(double.NaN));
          public static readonly DependencyProperty ImageWidthProperty = DependencyProperty.Register("ImageWidth", typeof(double), typeof(IconButton), new PropertyMetadata(double.NaN));
          public static readonly DependencyProperty HoverColorProperty = DependencyProperty.Register("ColorHover", typeof(SolidColorBrush), typeof(IconButton), new PropertyMetadata(Brushes.LightGray));
          public static readonly DependencyProperty PressedColorProperty = DependencyProperty.Register("ColorPressed", typeof(SolidColorBrush), typeof(IconButton), new PropertyMetadata(Brushes.Gray));
          public static readonly DependencyProperty DisabledColorProperty = DependencyProperty.Register("ColorDisabled", typeof(SolidColorBrush), typeof(IconButton), new PropertyMetadata(Brushes.Gray));
  
          static IconButton()
          {
              DefaultStyleKeyProperty.OverrideMetadata(typeof(IconButton), new FrameworkPropertyMetadata(typeof(IconButton)));
          }
  
          public ImageSource Image
          {
              get { return (ImageSource)GetValue(ImageProperty); }
              set { SetValue(ImageProperty, value); }
          }
  
          public double ImageHeight
          {
              get { return (double)GetValue(ImageHeightProperty); }
              set { SetValue(ImageHeightProperty, value); }
          }
  
          public double ImageWidth
          {
              get { return (double)GetValue(ImageWidthProperty); }
              set { SetValue(ImageWidthProperty, value); }
          }
  
          public SolidColorBrush ColorHover
          {
              get { return (SolidColorBrush)GetValue(HoverColorProperty); }
              set { SetValue(HoverColorProperty, value); }
          }
  
          public SolidColorBrush ColorPressed
          {
              get { return (SolidColorBrush)GetValue(PressedColorProperty); }
              set { SetValue(PressedColorProperty, value); }
          }
  
          public SolidColorBrush ColorDisabled
          {
              get { return (SolidColorBrush)GetValue(DisabledColorProperty); }
              set { SetValue(DisabledColorProperty, value); }
          }
      }
  }
  </code></pre>
  
  <p>theme</p>
  
  <pre><code>&lt;ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                      xmlns:local="clr-namespace:ProPharmacyManagerW"
                      xmlns:f="clr-namespace:ProPharmacyManagerW.Controls"
                      xmlns:vm="clr-namespace:ProPharmacyManagerW.ViewModel"&gt;
      &lt;vm:VisibilityConvertor x:Key="VisibilityConvertor"/&gt;
      &lt;Style TargetType="{x:Type f:IconButton}"&gt;
          &lt;Setter Property="Template"&gt;
              &lt;Setter.Value&gt;
                  &lt;ControlTemplate TargetType="{x:Type f:IconButton}"&gt;
                      &lt;Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}"&gt;
                          &lt;StackPanel Orientation="Horizontal" HorizontalAlignment="Center"&gt;
                              &lt;Image x:Name="Buttonicon" 
                                     Margin="10 0"
                                     Source="{TemplateBinding Image}"
                                     Width="{TemplateBinding ImageWidth}"
                                     Height="{TemplateBinding ImageHeight}"
                                     Visibility="{TemplateBinding Image,Converter={StaticResource VisibilityConvertor}}"
                                     HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                     VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                     Grid.Column="0"/&gt;
                              &lt;TextBlock x:Name="contentText"
                                         Text="{TemplateBinding Content}"
                                         HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                         Margin="{TemplateBinding Padding}" 
                                         VerticalAlignment="Center"
                                         Grid.Column="1"/&gt;
                          &lt;/StackPanel&gt;
                      &lt;/Border&gt;
                      &lt;ControlTemplate.Triggers&gt;
                          &lt;Trigger Property="IsMouseOver" Value="true"&gt;
                              &lt;Setter Property="Background" TargetName="border" Value="{Binding ColorHover, RelativeSource={RelativeSource TemplatedParent}}" /&gt;
                          &lt;/Trigger&gt;
                          &lt;Trigger Property="IsPressed" Value="true"&gt;
                              &lt;Setter Property="Background" TargetName="border" Value="{Binding ColorPressed, RelativeSource={RelativeSource TemplatedParent}}" /&gt;
                          &lt;/Trigger&gt;
                          &lt;Trigger Property="IsEnabled" Value="false"&gt;
                              &lt;Setter Property="Background" TargetName="border" Value="{Binding ColorDisabled, RelativeSource={RelativeSource TemplatedParent}}" /&gt;
                          &lt;/Trigger&gt;
                      &lt;/ControlTemplate.Triggers&gt;
                  &lt;/ControlTemplate&gt;
              &lt;/Setter.Value&gt;
          &lt;/Setter&gt;
      &lt;/Style&gt;
  &lt;/ResourceDictionary&gt;
  </code></pre>
  
  <p>the default value for normal background color -without triggers (over - pressed - disabled)- is none and i want to change it to white or something with ability to change it from the control properties at design time  </p>