Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
400
Binding to XamDataTree ActiveNode
posted

Hello,

I am having difficulties binding to the data of the active node on the xamDataTree.

Last thing I was stuck with is (but what doesn't work):

<TextBlock Text="{Binding Path=Data.Name}"
                   DataContext="{Binding Path=ActiveNode, ElementName=modelerTree}"
                   Grid.Row="1"
                   x:Name="textblock"/>
<XamDataTree x:Name="modelerTree">... </XamDataTree>

I tried binding to only the tree, to the ActiveNode (hoping propertychanged would notify binding to update) and to ActiveNode.Data and also binding without datacontext directly to Text={Binding Path=ActiveNode.Data.Name, ElementName=modelerTree}. But nothing seems to work.

With snoop I was able to verify that the active node and the contained data on the tree is always correct. But the property does not get updated in my binding.

The workaround right now is to catch the ActiveNodeChanged-Event in the code behind and set the datacontext to
e.NewActiveTreeNode.Data.

But it would be nice to do that in xaml..

Any help will be appreciated.

Peter.


Parents Reply Children
No Data