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
20
xamDataTree + MVVM + IsExpanded
posted

Hello.

I want to apply to the way the existing code(Binding IsExpanded).

(TreeView -> xamDataTree)

[TreeView source]

<TreeView x:Name="tv3DModel"
ItemsSource="{Binding FirstGeneration}"
MouseDoubleClick="TreeView_MouseDoubleClick"
Visibility="Visible">
<TreeView.ItemContainerStyle>
<Style TargetType="{x:Type TreeViewItem}">
<Setter Property="Foreground" Value="Black" />
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
<Setter Property="FontWeight" Value="Normal" />
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="FontWeight" Value="Bold" />
</Trigger>
</Style.Triggers>
</Style>
</TreeView.ItemContainerStyle>

<TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding Children}">
<DockPanel>
<CheckBox IsChecked="True" Uid="{Binding Name}" Visibility="Collapsed"/>
<TextBlock Text="{Binding Name}" />
</DockPanel>
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>
</TreeView>

[xamDataTree Source]

<ig:XamDataTree Grid.Row="1" x:Name="xdtTreeView" Background="Moccasin" 

NodeLineVisibility="Visible" ItemsSource="{Binding FirstGeneration}" ActiveNodeChanged="xdtTreeView_ActiveNodeChanged" IsExpandedMemberPath="{Binding IsExpanded}" >
<ig:XamDataTree.SelectionSettings>
<ig:TreeSelectionSettings NodeSelection="Single"/>
</ig:XamDataTree.SelectionSettings>
<ig:XamDataTree.GlobalNodeLayouts>
<ig:NodeLayout Key="Children"
TargetTypeName="JTreeItem"
DisplayMemberPath="RefNO" >
<ig:NodeLayout.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Data.Type}" Width="45" ToolTip="{Binding Data.ViewNameToolTip}"/>
<TextBlock Text="{Binding Data.ViewName}" ToolTip="{Binding Data.ViewNameToolTip}"/>
</StackPanel>
</DataTemplate>
</ig:NodeLayout.ItemTemplate>
</ig:NodeLayout>
</ig:XamDataTree.GlobalNodeLayouts>
</ig:XamDataTree>

I want to change only the display Binding Data control.