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
259
XamDataTree + MVVM + IsSelected
posted

Hi,

I am working with the 'XamDataTree 2010 vol 3', as infragistics previous version lacks a TreeView control I am trying to migrate from my previous standard TreeView to Infragistics XamDataTree (main reason is theming and styling), for my surprise infragistics treeview follows a diferent path than the standard one. Not similar to the Silverlight XamTree which follows a much more common approach compared to the standard treeview.

However, everything resumes to find out how to put all the functionalities together again. My code so far can bind to a collection, display hierarchical information and bind to an 'IsExpanded' property on my view model.

<ig:XamDataTree ItemsSource="{Binding Catalogs}" Grid.Row="1">

<ig:XamDataTree.GlobalNodeLayouts>

<ig:NodeLayout Key="itemLayout" TargetTypeName="TreeViewItemViewModel" IsExpandedMemberPath="IsExpanded">

<ig:NodeLayout.ItemTemplate>

<DataTemplate>

<StackPanel Orientation="Horizontal">

<Image Width="16" Height="16" Margin="3,0" Source="{Binding Data.ImagePath}" />

<TextBlock Text="{Binding Data.Name}" />

</StackPanel>

</DataTemplate>

</ig:NodeLayout.ItemTemplate>

</ig:NodeLayout>

</ig:XamDataTree.GlobalNodeLayouts>

</ig:XamDataTree>

Right now, I am looking forward to bind the XamDataTreeNode item to an IsSelected property on my view model, but I cannot figure out how to target the XamDataTreeNode item.

Any help would be appreciated,

Regards,

Pablo

PS: Sorry about the code snippet formatting.