title: Binding UserControl inside a ListView datatemplate WPF
body: <p>So i have this issue: </p>
  
  <ul>
  <li>I have created a UserControl (basically a textbox and label). This user control I am able to Bind using a Dependency Property.</li>
  <li>I have a ListView in which I can put a textbox in the datatemplate and bind the "text" property to the binded value. </li>
  </ul>
  
  <p>so far so good. but now if I try to put the UserControl into that very same scenario the DependencyProperty stops working.</p>
  
  <p>Here is the code: <strong>[ListView]</strong></p>
  
  <pre><code>&lt;ListView x:Name="DtContactDetailListView" ItemsSource="{Binding}"&gt;
     &lt;ListBox.ItemTemplate&gt;
        &lt;DataTemplate&gt;
           &lt;UserControl:tbx label="{Binding detail}" text="{Binding value}"/&gt;
        &lt;/DataTemplate&gt;
     &lt;/ListBox.ItemTemplate&gt;
  &lt;/ListView&gt;
  </code></pre>
  
  <p>The binding in this situation works when its outside the listview, in other parts of the form... so its not an issue with my DepedencyProperty. Also substituting the UserControl for a Textbox, and adding the exact same Binding also works. But it doesn't work under this... why?!</p>
  
  <p>UPDATE
  As requested, I have updated the code for the UserControl. Keep in mind this works perfectly when binding it to other elements on the window or page. Just doesn't work inside a listview.</p>
  
  <pre><code>Public Sub New()
      InitializeComponent()
      Me.DataContext = Me
  End Sub
  
  'TextBox property
  Public Shared ReadOnly tbxTextProperty As DependencyProperty = DependencyProperty.Register("text", GetType([String]), GetType(tbx), New FrameworkPropertyMetadata(String.Empty))
  Public Property text() As [String]
      Get
          Return GetValue(tbxTextProperty).ToString()
      End Get
      Set(value As [String])
          SetValue(tbxTextProperty, value)
      End Set
  End Property
  </code></pre>