Note that there are some explanatory texts on larger screens.

plurals
  1. POBinding between two custom dependencyobjects
    primarykey
    data
    text
    <p>i have a custom dependecyobject created in xaml and i would like to bind the whole instance of it to a property of another custom dependecyobject. all that is happening inside a control. As example something like this</p> <pre><code>class row : dependencyobject { // this is a dp property public static readonly dependencyproperty widthproperty = dependencyproperty.register... } class cell : dependencyobject { public static readonly dependencyproperty dataproperty = dependencyproperty.register.... } class customGridView:Control { List&lt;Row&gt;Rows { get;set;} List&lt;Cell&gt; Cells { get;set;} } </code></pre> <p>and now i would like to bind an instance of a row to cell.data property, also something like this:</p> <pre><code>&lt;customGridView&gt; &lt;row x:name:row1 width=200/&gt; (this is a class that derives for dependencyobject) &lt;row .../&gt; &lt;cell data={Binding ElementName=row1}/&gt; (this is another class that derives from dependencyobj and tries to bind to entire instance of row class) &lt;cell ..../&gt; &lt;cell ..../&gt; &lt;/customGridView/&gt; </code></pre> <p>any help?</p> <p>as desired this is the dp property of cell.data:</p> <pre><code> public Row Data { get { return (Row)GetValue(DataProperty); } set { SetValue(DataProperty, value); } } // Using a DependencyProperty as the backing store for ColumnName. This enables animation, styling, binding, etc... public static readonly DependencyProperty DataProperty= DependencyProperty.Register("Data", typeof(Row), typeof(Cell), new PropertyMetadata(null)); </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.
 

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