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
70
XamDataTree - Item template not displaying correctly
posted

I have the following XamDataTree:

<ig:XamDataTree ItemsSource="{Binding WaterLines}">
    <ig:XamDataTree.GlobalNodeLayouts>
        <ig:NodeLayout Key="Children" TargetTypeName="Line" ItemTemplate="{StaticResource LineNodeTemplate}" />
        <ig:NodeLayout Key="HydrantLayout" TargetTypeName="Hydrant" ItemTemplate="{StaticResource HydrantNodeTemplate}" />
    </ig:XamDataTree.GlobalNodeLayouts>
</ig:XamDataTree>

and here is an example of my template (hydrant template is nearly identical):

<DataTemplate x:Key="LineNodeTemplate" DataType="{x:Type ents:Line}">
	<StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
		<TextBlock Text="{Binding Name}" ig:DragDropManager.DragSource="{StaticResource DragSource}">
		<ig:ContextMenuService.Manager>                
			<ig:ContextMenuManager>
				<ig:ContextMenuManager.ContextMenu>
					<ig:XamContextMenu ItemClicked="LineMenu_ItemClicked" IsVisibleChanged="XamContextMenu_IsVisibleChanged">
						<ig:XamContextMenu.Items>
							<ig:XamMenuItem Name="LineAddHydrant" Header="Add Hydrant" />
							<ig:XamMenuItem Name="LineAddLine" Header="Add Line" />
							<ig:XamMenuItem Name="LineRename" Header="Rename" />
							<ig:XamMenuItem Name="LineDelete" Header="Delete" />
						</ig:XamContextMenu.Items>
					</ig:XamContextMenu>
				</ig:ContextMenuManager.ContextMenu>
			</ig:ContextMenuManager>
		</ig:ContextMenuService.Manager>
		</TextBlock>
	</StackPanel>
</DataTemplate>

For some reason, regardless what I do with it, the template simply doesn't show. I can't see a single reason why that would be? I know the item has a 'Name' property and it's populated, because if I nix the template and add DisplayMemberPath="Name" to the NodeLayout, it shows perfectly.

Parents Reply Children