Hello there,
I have a project where i use the xamdatachart, xamdatatree and xamdiagram. When I try to set the node layout of my XamDataTree, the compiler gives me an error:
Ambiguous type reference. A type named 'NodeLayout' occurs in at least two namespaces... (Infragistics.Controls.Menus.NodeLayout and Infragistics.Controls.Charts.Nodelayout)
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ig="http://schemas.infragistics.com/xaml" x:Class="WpfApplication1.MainWindow" Title="MainWindow" Height="350" Width="525"> <Grid> <ig:XamDataTree x:Name="tets" HorizontalAlignment="Left" Margin="0,142,0,0" VerticalAlignment="Top"> <ig:XamDataTree.GlobalNodeLayouts> <ig:NodeLayout Key="Children" DisplayMemberPath="NodeName" TargetTypeName="Node"> </ig:NodeLayout> </ig:XamDataTree.GlobalNodeLayouts> </ig:XamDataTree> </Grid> </Window>
So I guess the compiler is searching for the NodeLayout in the "Infragistics.Controls.Charts.NodeLayout". How can i tell the compiler to look in ""Infragistics.Controls.Menus.Layout"? I think it can be solved by setting the correct namespace and assembly, but i dont know how. Thank you very much for your help.
Hello Adrian,
Thank you for your post.
You are correct in that the compiler is looking for NodeLayout, but this type exists in both the Infragistics.Controls.Charts and the Infragistics.Controls.Menus namespace. For it to look specifically in a certain namespace, you will need to define one that points directly to it. I believe that this error is coming directly from the usage of the XamDataTree and the XamDiagram assemblies, and so I have included the xmlns namespaces to point to these two controls specifically:
XamDiagram:xmlns:igDiagram="clr-namespace:Infragistics.Controls.Charts;assembly=InfragisticsWPF4.Controls.Charts.XamDiagram.v15.2"
XamDataTree:xmlns:igTree="clr-namespace:Infragistics.Controls.Menus;assembly=InfragisticsWPF4.Controls.Menus.XamDataTree.v15.2"
I hope this helps you. Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
Hello Andrew,
This is exactly what i need. It works perfectly. Thank you.