title: How to use DependencyProperty in ViewModel at wpf Prism
body: <p>I am working on WPF Prism. trying to display usercontrols(in my case, ItemTest) using itemscontorl.</p>
  <p>I am trying to use DependencyProperty to bind the values of properties of usercontrol in itemscontrol. however, some problems have occurred.</p>
  <p>I'm not sure how to wire UserControlView (DependencyProperty TitleProperty) and ViewModel (TitleViewModel).</p>
  <p>InputView</p>
  <pre><code>&lt;ItemsControl ItemsSource=&quot;{Binding InputItems}&quot;&gt;
              &lt;ItemsControl.ItemTemplate&gt;
                  &lt;DataTemplate&gt;
                      &lt;Grid&gt;
                          &lt;Grid.RowDefinitions&gt;
                              &lt;RowDefinition/&gt;
                              &lt;RowDefinition/&gt;
                          &lt;/Grid.RowDefinitions&gt;
                          &lt;local:ItemTest Title=&quot;{Binding title}&quot;/&gt;
                      &lt;/Grid&gt;
                      
                  &lt;/DataTemplate&gt;
              &lt;/ItemsControl.ItemTemplate&gt;
          &lt;/ItemsControl&gt;
  </code></pre>
  <p>ItemsTestView</p>
  <pre><code>&lt;UserControl x:Class=&quot;HMI.Modules.InputArea.Views.ItemTest&quot;
               xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
               xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;
               xmlns:prism=&quot;http://prismlibrary.com/&quot;
               xmlns:local=&quot;clr-namespace:HMI.Modules.InputArea.Views&quot;
               xmlns:mtest=&quot;clr-namespace:HMI.Modules.InputArea.ViewModels&quot;
               prism:ViewModelLocator.AutoWireViewModel=&quot;True&quot;
               &gt;
  
     
      &lt;Grid Background=&quot;Red&quot;&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition/&gt;
          &lt;/Grid.RowDefinitions&gt;
          &lt;TextBlock Grid.Row=&quot;1&quot; Text=&quot;{Binding TitleViewModel}&quot;/&gt;
      &lt;/Grid&gt;
  &lt;/UserControl&gt;
  </code></pre>
  <p>ItemsTestView.cs</p>
  <pre><code>public static readonly DependencyProperty TitleProperty =
               DependencyProperty.Register(&quot;Title&quot;, typeof(string), typeof(ItemTest),
               new PropertyMetadata(null));
  
  
          public string Title
          {
              get { return (string)GetValue(TitleProperty); }
              set { 
                  SetValue(TitleProperty, value); 
              }
          }
  </code></pre>
  <p>ItemTestViewModel</p>
  <pre><code>string _titleViewModel;
  
  
          public string TitleViewModel {
              get =&gt; _titleViewModel;
              set { 
                  SetProperty(ref _titleViewModel, value); 
              }
          }
  </code></pre>
  <p>I want to display the binding value when I input the &quot;Title&quot; of &quot;Itemtest&quot; in the Main Xaml.</p>
  <p><strong>current status</strong>
  <a href="https://i.stack.imgur.com/pgT8X.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pgT8X.png" alt="current" /></a></p>
  <p><strong>desired result</strong>
  <a href="https://i.stack.imgur.com/rmyzS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rmyzS.png" alt="enter image description here" /></a>
  thanks</p>