'Declaration Public Property IsCollapsed As System.Boolean
public System.bool IsCollapsed {get; set;}
'Declaration Public Property IsCollapsed As System.Boolean
public System.bool IsCollapsed {get; set;}
<c1:C1OrgChart> <c1:C1OrgChart.ItemTemplate> <DataTemplate> <StackPanel> <TextBlock Text="{Binding Name}" /> <CheckBox Margin="4 0" IsChecked="{Binding IsCollapsed, Mode=TwoWay, RelativeSource={RelativeSource AncestorType=c1:C1OrgChart}}" /> </StackPanel> </DataTemplate> </c1:C1OrgChart.ItemTemplate> </c1:C1OrgChart>
This XAML binds the IsChecked property of the CheckBox to the IsCollapsed property of the C1OrgChart control that contains the item. The user may then collapse or expand the chart by checking the CheckBox.