Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Well, it looks like you are trying to use a "normal" DependencyProperty on the parent UserControl, and an "attached" DependencyProperty on the child UserControl. You need to pick one way. :)</p> <p>EDIT for clarification: There are two ways of registering a dependency property, "Normal", like so:</p> <pre><code>public static readonly DependencyProperty BobProperty = DependencyProperty.Register("Bob",....) </code></pre> <p>and Attached:</p> <pre><code>public static readonly DependencyProperty BobAttachedProperty = DependencyProperty.RegisterAttached("BobAttached",...) </code></pre> <p>Let's say the control you are registering these properties on is called "MyPanel". To use each property:</p> <pre><code>&lt;MyPanel Bob="somevalue" MyPanel.BobAttached="somevalue"/&gt; </code></pre> <p>Note the need to specify "where the attached property is defined". Attached properties are great when you have some bit of behavior or functionality that applies to multiple types of controls.</p> <p>That said, perhaps there is a better way to do this - If the parent UserControl contained an ItemsControl, the ItemTemplate for that control could be a DataTemplate that contained the ItemDetailsView, in which case you could use standard data binding to do what you needed to:</p> <pre><code>&lt;UserControl blahblahblah&gt; &lt;ItemsControl ItemsSource="{Binding WhereYourItemsAre}"&gt; &lt;ItemsControl.ItemTemplate&gt; &lt;DataTemplate&gt; &lt;ns:WhatYourChildViewIsCalled DataContext="{Binding}"/&gt; &lt;/DataTemplate&gt; &lt;/ItemsControl.ItemTemplate&gt; &lt;/ItemsControl&gt; &lt;/UserControl&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload