title: Wpf - Update custom user control at runtime
body: <p>hey guys i created an wpf application with custom usercontrol , the problem is that i am unable to update or say change the properties of custom control at runtime, 
  -->heres a code of user control
  File:usercontrol.xaml</p>
  
  <pre><code>&lt;UserControl x:Class="ExampleWpf.UserControlExample"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
  
            Width="Auto" Height="Auto"&gt;
  &lt;Rectangle Width="60" Height="200" Fill="#FFB65959" Name="Box1"&gt;&lt;/Rectangle&gt;
  </code></pre>
  
  <p></p>
  
  <p>File:usercontrol.xaml.cs</p>
  
  <pre><code>namespace ExampleWpf{
  public partial class UserControlExample : UserControl
  {
      public UserControlExample()
      {
          InitializeComponent();
      }
      public double Box1Width
      {
          get { return (Box1.Width); }
          set { Box1.Width = value; }
      }
  }
  </code></pre>
  
  <p>--->Heres a simple code for Wpfapplication
  File:Mainwindow.xaml.cs</p>
  
  <pre><code>public partial class MainWindow : Window
  {
      public MainWindow()
      {
          InitializeComponent();
      }
  
      private void Button_Click_1(object sender, RoutedEventArgs e)
      {
          UserControlExample uc = new UserControlExample();
          uc.Box1Width = 100;
  
      }
  }
  </code></pre>
  
  <p>All i wanted to change the width of a custom control at run time when user click on the button----> but unfortunately i doesn't succeed
  please help me out </p>