<UserControl x:Class="TriStateModeInDeep.MainPage"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
	xmlns:local="clr-namespace:TreeViewCheckNotPropagated"
	xmlns:tristatemodeindeep="clr-namespace:TriStateModeInDeep"
	mc:Ignorable="d"
	d:DesignHeight="300" d:DesignWidth="400">

	<UserControl.Resources>

		<tristatemodeindeep:BooleanToToggleStateConverter x:Key="Bool2ToggleConverter"/>

		<telerik:ContainerBindingCollection x:Key="Bindings">
			<telerik:ContainerBinding PropertyName="CheckState"
									  Binding="{Binding IsChecked, Mode=TwoWay, Converter={StaticResource Bool2ToggleConverter}}"/>
		</telerik:ContainerBindingCollection>

		<telerik:HierarchicalDataTemplate x:Key="ItemTemplate" ItemsSource="{Binding Items}"
										  telerik:ContainerBinding.ContainerBindings="{StaticResource Bindings}">
			<TextBlock Text="{Binding Name}"/>
		</telerik:HierarchicalDataTemplate>



		<telerik:ContainerBindingCollection x:Key="Bindings2">
			<telerik:ContainerBinding PropertyName="IsChecked" Binding="{Binding IsChecked, Mode=TwoWay}"/>
		</telerik:ContainerBindingCollection>

		<telerik:HierarchicalDataTemplate x:Key="ItemTemplate2" ItemsSource="{Binding Items}"
										  telerik:ContainerBinding.ContainerBindings="{StaticResource Bindings2}">
			<TextBlock Text="{Binding Name}"/>
		</telerik:HierarchicalDataTemplate>

	</UserControl.Resources>



	<StackPanel Orientation="Horizontal">
		<StackPanel Width="300">
			<TextBlock Text="Using the CheckState"/>
			<telerik:RadTreeView x:Name="treeView" IsOptionElementsEnabled="True" IsTriStateMode="True"
							 ItemsSource="{Binding .}" ItemTemplate="{StaticResource ItemTemplate}"
							 telerik:ContainerBinding.ContainerBindings="{StaticResource Bindings}"
							 Selected="treeView_Selected"/>

			<Button Content="Check Data 2.2" Name="CheckButton" Click="CheckButton_Click"/>
		</StackPanel>

		<StackPanel Width="300">
			<TextBlock Text="Using the IsChecked"/>
			<telerik:RadTreeView x:Name="treeView2" IsOptionElementsEnabled="True" IsTriStateMode="True"
							 ItemsSource="{Binding .}" ItemTemplate="{StaticResource ItemTemplate2}"
							 telerik:ContainerBinding.ContainerBindings="{StaticResource Bindings2}"
							 Selected="treeView_Selected"/>

			<Button Content="Check Data 2.2" Name="CheckButton2" Click="CheckButton2_Click"/>
		</StackPanel>
	</StackPanel>
</UserControl>
