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.
Hello!
If you submit a sample project that illustrates the XAML and code you are working with, I will refactor the project to demonstrate how you can utilize MVVM with it and re-submit the project back here. Please remove binaries and the XAP file before compressing it and adding it as an attachment to the forums as there is a size limit for attachments.
Sincerely,
We would like to see a simple sample of XamDataTree using ViewModel to get the ActiveNode, that's all.. anybody with a solution on this fail ???
I know this is an old post but it this is a popular problem which is still unsolved. Therefore I decided to reply in order to put emphasize on it.
I definitely agree! xamDataTree is lacking MVVM support. In FeatureBrowser there is ViewModel binding example which is so simple. Just making a ViewModel and assigning it as the DataContext and one of it's properties as as source, doesn't mean that it supports MVVM. What we want is basic Tree actions which has been used for years but this time without using the code-behind. I'm sure developers there know MVVM and what we need, so we shouldn't be sending an example. Believe me if it was something unique and most importantly if I had time I would be sending a sample project but in this case I don't think there is a need for this. As a start you can show a solution to bind the selected item of tree to a MVVM property. Even this is not possible as much as I see. But more importantly do not dismiss MVVM. As much as I see nobody wants code-behind anymore. They want their view logic in ViewModel. So all your examples can also follow this approach in order to minimize questions and requests. As an example nobody even wants to use events anymore because it needs code-behind. People want to change their events to commands in order to do clean binding with ViewModel. So now they use "CommandAction behavior" workaround for this purpose. This is what we (implementers of MVVM) want to see in your examples: no event handling, no code-behind. If you can do that in your examples we can also do that in our applications.
Thanks in advance