title: How to add Custom Properties to WPF User Control
body: <p>I've my own User Control including a few buttons and etc.</p>
  <p>I use this code to bring that UC to screen.</p>
  <pre><code>&lt;AppUI:XXXX x:Name=&quot;ucStaticBtns&quot; HorizontalAlignment=&quot;Left&quot; Margin=&quot;484,0,0,0&quot; VerticalAlignment=&quot;Top&quot; Width=&quot;68&quot; /&gt;
  </code></pre>
  <p>I've added two property like Property1 and Property2 to XXXX user control. And changed my code with</p>
  <pre><code>&lt;AppUI:XXXX x:Name=&quot;ucStaticBtns&quot; HorizontalAlignment=&quot;Left&quot; Margin=&quot;484,0,0,0&quot; VerticalAlignment=&quot;Top&quot; Width=&quot;68&quot; Property1=&quot;False&quot; Property2=&quot;False&quot;/&gt;
  </code></pre>
  <p>When I add this 2 parameters to XAML page, system throws an exception like <strong>&quot;The member 'Property1' is not recognized or is not accessible&quot;</strong></p>
  <p>Here is my UC code.</p>
  <pre><code> public partial class XXXX : UserControl
      {
          public event EventHandler CloseClicked;
          public event EventHandler MinimizeClicked;
          //public bool ShowMinimize { get; set; }
          public static DependencyProperty Property1Property;
          public static DependencyProperty Property2Property;
          public XXXX()
          {
              InitializeComponent();
          }
  
          static XXXX()
          {
              Property1Property = DependencyProperty.Register(&quot;Property1&quot;, typeof(bool), typeof(XXXX));
              Property2Property = DependencyProperty.Register(&quot;Property2&quot;, typeof(bool), typeof(XXXX));
          }
  
          public bool Property1
          {
              get { return (bool)base.GetValue(Property1Property); }
              set { base.SetValue(Property1Property, value); }
          }
  
          public bool Property2
          {
              get { return (bool)base.GetValue(Property2Property); }
              set { base.SetValue(Property2Property, value); }
          }
  }
  </code></pre>
  <p>Can you help me with doing that?
  Thank you so much!</p>