title: WPF Changing dependency property of custom control in XAML doesnt update XAML preview
body: <p>Here is code of my custom control  (it will be something like my own panel). And here I have textblock, property Text of this TextBlock is binded to dependency property which was declared in code-behind of this control</p>
  <p><strong>Custom Panel - <em>ExtensibleViewPanel.xaml</em></strong></p>
  <pre class="lang-xml prettyprint-override"><code>&lt;UserControl x:Class=&quot;OrderTrackingSystem.Presentation.CustomControls.ExtensibleViewPanel&quot;
               xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
               xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;
               xmlns:mc=&quot;http://schemas.openxmlformats.org/markup-compatibility/2006&quot; 
               xmlns:d=&quot;http://schemas.microsoft.com/expression/blend/2008&quot; 
               xmlns:local=&quot;clr-namespace:OrderTrackingSystem.Presentation.CustomControls&quot;
               mc:Ignorable=&quot;d&quot; 
               xmlns:materialDesign=&quot;http://materialdesigninxaml.net/winfx/xaml/themes&quot;
               d:DesignHeight=&quot;950&quot; d:DesignWidth=&quot;160&quot;&gt;
      &lt;Grid&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition MaxHeight=&quot;100&quot; MinHeight=&quot;100&quot;/&gt;
              &lt;RowDefinition/&gt;
          &lt;/Grid.RowDefinitions&gt;
          &lt;!-- Header for each View --&gt;
          &lt;Border Grid.Row=&quot;0&quot;
                  Background=&quot;DeepPink&quot;&gt;
              &lt;Grid&gt;
                  &lt;Grid.ColumnDefinitions&gt;
                      &lt;ColumnDefinition/&gt;
                      &lt;ColumnDefinition/&gt;
                      &lt;ColumnDefinition/&gt;
                  &lt;/Grid.ColumnDefinitions&gt;
                  &lt;TextBlock VerticalAlignment=&quot;Center&quot;
                         HorizontalAlignment=&quot;Center&quot;
                         FontSize=&quot;17&quot;
                         Grid.Column=&quot;1&quot;
                         Foreground=&quot;Black&quot;
                         Text=&quot;{Binding Caption}&quot;/&gt;
                  &lt;Button
                      Grid.Column=&quot;2&quot;
                      Style=&quot;{StaticResource MaterialDesignFloatingActionMiniAccentButton}&quot;
                      HorizontalAlignment=&quot;Right&quot;
                      VerticalAlignment=&quot;Bottom&quot;
                      Margin=&quot;5&quot;
                      Height=&quot;20&quot;
                      Width=&quot;20&quot;&gt;
                      &lt;materialDesign:PackIcon Kind=&quot;ChevronRight&quot; /&gt;
                  &lt;/Button&gt;
              &lt;/Grid&gt;
          &lt;/Border&gt;
          &lt;!-- ContentPresenter for User content --&gt;
          &lt;ContentPresenter Grid.Row=&quot;1&quot; Content=&quot;{Binding ViewContent}&quot;/&gt;
      &lt;/Grid&gt;
  &lt;/UserControl&gt;
  </code></pre>
  <p><strong>Code-behind - <em>ExtensibleViewPanel.xaml.cs</em></strong></p>
  <pre class="lang-cs prettyprint-override"><code>public partial class ExtensibleViewPanel : UserControl, INotifyPropertyChanged
      {
          #region Dependency properties
  
          /* DP to set panel header name */
          public string Caption
          {
              get { return (string)GetValue(CaptionProperty); }
              set
              {
                  SetValue(CaptionProperty, value);
                  PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Caption)));
              }
          }
  
          public static readonly DependencyProperty CaptionProperty =
              DependencyProperty.Register(&quot;Caption&quot;,
                  typeof(string),
                  typeof(ExtensibleViewPanel),
                  new FrameworkPropertyMetadata(default(string), FrameworkPropertyMetadataOptions.BindsTwoWayByDefault | FrameworkPropertyMetadataOptions.AffectsRender));
  
  
          /* DP to set panel content */
          public object ViewContent
          {
              get { return (object)GetValue(ViewContentProperty); }
              set { SetValue(ViewContentProperty, value); }
          }
  
  
          public static readonly DependencyProperty ViewContentProperty =
              DependencyProperty.Register(&quot;ViewContent&quot;, 
                  typeof(object), 
                  typeof(ExtensibleViewPanel), 
                  new FrameworkPropertyMetadata(default(object), FrameworkPropertyMetadataOptions.BindsTwoWayByDefault | FrameworkPropertyMetadataOptions.AffectsRender));
  
  
  
          public event PropertyChangedEventHandler PropertyChanged;
  
          #endregion
  
          public ExtensibleViewPanel()
          {
              InitializeComponent();
              DataContext = this;
          }
      }
  </code></pre>
  <p>As you can see i set DataContent of MyControl to it's code-behind. And then the <em><strong>main problem</strong></em>:</p>
  <ol>
  <li>I Add my control to XAML</li>
  </ol>
  <pre class="lang-xml prettyprint-override"><code>&lt;ctrls:ExtensibleViewPanel Grid.Column=&quot;0&quot; 
                                     Grid.RowSpan=&quot;4&quot;
                                     Caption=&quot;XXL&quot;
                                     Grid.Row=&quot;0&quot;&gt;
  &lt;/ctrls:ExtensibleViewPanel&gt;
  </code></pre>
  <ol start="2">
  <li>I dont run program, only set Caption dependency property to &quot;XXL&quot; and view of my control doesnt change (XAML preview), i want the same effect as when you add textblock and set property Text it into xaml designer, xaml designer of textblock show this text immediately</li>
  </ol>
  <p><strong>When i start my program, my properties working good, and i see my Caption in opened program, but i want to understand how to update xaml preview after changing dependency property</strong>*</p>