This is .xaml File
<ig:XamNetworkNode x:Name="xnn" Background="AliceBlue" NodeControlAttachedEvent="Xnn_NodeControlAttachedEvent" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ItemsSource="{Binding Persons}" ZoomLevel="2" LineEndCap="SolidArrow" LineCapSize="10" SelectionType="Single" Grid.Row="3" FontSize="20" SelectedNodesCollectionChanged="xnn_SelectedNodesCollectionChanged" > <ig:XamNetworkNode.GlobalNodeLayouts> <ig:NetworkNodeNodeLayout x:Name="xmnode" TargetTypeName="Person" NodeStyle="{StaticResource MyNodeStyle}" ConnectionsMemberPath="Connections" ConnectionTargetMemberPath="Target" ConnectionWeightMemberPath="Weight" ToolTipMemberPath="ToolTip" DisplayMemberPath="Name" /> </ig:XamNetworkNode.GlobalNodeLayouts>
</ig:XamNetworkNode>
Iin xaml.cs
private void xnn_SelectedNodesCollectionChanged(object sender, Infragistics.Controls.Maps.NetworkNodeSelectionEventArgs e) { for (int i = 0; i < xnn.SelectedNodes.Count; i++) { this.tb_DisaplayNode.Text = ((Person)xnn.SelectedNodes[i].Data).Name; } }
This event is not raising while I am selecting any node but It is raising in some other event,
So not able to find the current selected node
I checked this link but this is not as per my requirement.
I am storing color for each node in DB and I am using property in Model View.
and I am binding this property in style.
So, can you help me in this way. like Dynamic binding.
Thanks for the sample.Can you provide some conditional style code like
node%2= Red
else
blue
So, the color of nodes should be bind with property.
This will be helpful for me.