<Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
        xmlns:treeView="clr-namespace:Telerik.Windows.Controls.TreeView;assembly=Telerik.Windows.Controls.Navigation"
        xmlns:animation="clr-namespace:Telerik.Windows.Controls.Animation;assembly=Telerik.Windows.Controls" >
    <Window.Resources>
        <telerik:Office_BlackTheme x:Key="Theme" />
        <CornerRadius x:Key="ControlSubItem_OuterCornerRadius">1</CornerRadius>
        <SolidColorBrush x:Key="ControlSubItem_OuterBorder_MouseOver" Color="#FFFFC92B" />
        <Thickness x:Key="ControlSubItem_OuterBorderThickness">1</Thickness>
        <SolidColorBrush x:Key="ControlSubItem_InnerBorder_MouseOver" Color="#FFFFFFFF" />
        <CornerRadius x:Key="ControlSubItem_InnerCornerRadius">0</CornerRadius>
        <Thickness x:Key="ControlSubItem_InnerBorderThickness">1</Thickness>
        <LinearGradientBrush x:Key="ControlSubItem_Background_MouseOver" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FFFFFBA3" Offset="1" />
            <GradientStop Color="#FFFFFBDA" Offset="0" />
        </LinearGradientBrush>
        <SolidColorBrush x:Key="ControlSubItem_OuterBorder_UnFocus" Color="#FFdbdbdb" />
        <SolidColorBrush x:Key="ControlSubItem_InnerBorder_UnFocus" Color="Transparent" />
        <LinearGradientBrush x:Key="ControlSubItem_Background_UnFocus" EndPoint="0,1">
            <GradientStop Color="#FFf8f6f9" Offset="0" />
            <GradientStop Color="#FFf0f0f0" Offset="1" />
        </LinearGradientBrush>
        <SolidColorBrush x:Key="ControlSubItem_OuterBorder_Selected" Color="#FFFFC92B" />
        <SolidColorBrush x:Key="ControlSubItem_InnerBorder_Selected" Color="#FFFFFFFF" />
        <LinearGradientBrush x:Key="ControlSubItem_Background_Selected" EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FFFCE79F" Offset="1" />
            <GradientStop Color="#FFFDD3A8" />
        </LinearGradientBrush>
        <SolidColorBrush x:Key="TreeView_LineColor" Color="#FFCCCCCC" />
        <SolidColorBrush x:Key="FocusBrushBlack" Color="#FF000000" />


        <!-- forbidden icon -->
        <Style x:Key="TreeviewFocusVisual">
            <Setter Property="Control.Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Rectangle Stroke="Transparent"  StrokeThickness="0" Margin="0" />
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>


        <ControlTemplate TargetType="telerik:RadTreeViewItem"
			x:Key="TreeViewItemDefaultTemplate">
            <Grid x:Name="RootElement">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Grid x:Name="HeaderRow" Background="Transparent"
						MinHeight="{TemplateBinding MinHeight}"
						SnapsToDevicePixels="True" >

                    <Grid.ColumnDefinitions>
                        <!-- indent -->
                        <ColumnDefinition Width="Auto" />

                        <!-- collapse/expand -->
                        <ColumnDefinition Width="Auto" />

                        <!-- checkbox, radio-->
                        <ColumnDefinition Width="Auto" />

                        <!-- left image -->
                        <ColumnDefinition Width="Auto" />

                        <!-- selection, text, edit element -->
                        <ColumnDefinition Width="Auto" />

                        <!-- empty -->
                        <ColumnDefinition Width="*" />

                    </Grid.ColumnDefinitions>

                    <!-- normal-->
                    <Border CornerRadius="2" 
							Background="{TemplateBinding Background}"
							BorderBrush="{TemplateBinding BorderBrush}"
							BorderThickness="{TemplateBinding BorderThickness}"
							Grid.Column="2" Grid.ColumnSpan="6" />

                    <!-- Hover -->
                    <Border x:Name="MouseOverVisual" Opacity="0" Grid.ColumnSpan="6" Grid.Column="2"
							CornerRadius="{StaticResource ControlSubItem_OuterCornerRadius}"
							BorderBrush="{StaticResource ControlSubItem_OuterBorder_MouseOver}"
							BorderThickness="{StaticResource ControlSubItem_OuterBorderThickness}">
                        <Border BorderBrush="{StaticResource ControlSubItem_InnerBorder_MouseOver}"
								CornerRadius="{StaticResource ControlSubItem_InnerCornerRadius}"
								BorderThickness="{StaticResource ControlSubItem_InnerBorderThickness}"
								Background="{StaticResource ControlSubItem_Background_MouseOver}" />
                    </Border>

                    <!-- Selection Unfocused-->
                    <Border x:Name="SelectionUnfocusedVisual" Visibility="Collapsed" Grid.ColumnSpan="6"
							Grid.Column="2"
							CornerRadius="{StaticResource ControlSubItem_OuterCornerRadius}"
							BorderBrush="{StaticResource ControlSubItem_OuterBorder_UnFocus}"
							BorderThickness="{StaticResource ControlSubItem_OuterBorderThickness}">
                        <Border BorderBrush="{StaticResource ControlSubItem_InnerBorder_UnFocus}"
								CornerRadius="{StaticResource ControlSubItem_InnerCornerRadius}"
								BorderThickness="{StaticResource ControlSubItem_InnerBorderThickness}"
								Background="{StaticResource ControlSubItem_Background_UnFocus}" />
                    </Border>

                    <!-- Select -->
                    <Border x:Name="SelectionVisual" Visibility="Collapsed" Grid.ColumnSpan="6" Grid.Column="2"
							CornerRadius="{StaticResource ControlSubItem_OuterCornerRadius}"
							BorderBrush="{StaticResource ControlSubItem_OuterBorder_Selected}"
							BorderThickness="{StaticResource ControlSubItem_OuterBorderThickness}">
                        <Border BorderBrush="{StaticResource ControlSubItem_InnerBorder_Selected}"
								CornerRadius="{StaticResource ControlSubItem_InnerCornerRadius}"
								BorderThickness="{StaticResource ControlSubItem_InnerBorderThickness}"
								Background="{StaticResource ControlSubItem_Background_Selected}" />
                    </Border>



                    <!-- indent -->
                    <StackPanel x:Name="IndentContainer" Orientation="Horizontal" >
                        <Rectangle x:Name="IndentFirstVerticalLine"  Width="1" Visibility="Collapsed"
								Stroke="{StaticResource TreeView_LineColor}" VerticalAlignment="Top" >

                        </Rectangle>
                    </StackPanel>

                    <!-- ListRoot decoration -->
                    <Grid Grid.Column="1" x:Name="ListRootContainer" HorizontalAlignment="Center"
							MinWidth="20">

                        <!-- Lines -->
                        <Rectangle x:Name="HorizontalLine" Height="1"
								Stroke="{StaticResource TreeView_LineColor}" VerticalAlignment="Center"
								HorizontalAlignment="Right" >

                        </Rectangle>

                        <Rectangle x:Name="VerticalLine" Width="1"
									Stroke="{StaticResource TreeView_LineColor}" VerticalAlignment="Top"
									HorizontalAlignment="Center" >

                        </Rectangle>

                        <!-- Collapse/Expand -->
                        <ToggleButton x:Name="Expander" IsTabStop="False"
								Background="{TemplateBinding Background}" />

                        <!-- Loading ... -->
                        <Grid x:Name="LoadingVisual" RenderTransformOrigin="0.5,0.5"
								Visibility="Collapsed" VerticalAlignment="Center"
								HorizontalAlignment="Center">
                            <Grid.RenderTransform>
                                <TransformGroup>
                                    <RotateTransform x:Name="LoadingVisualAngleTransform" Angle="0"
											CenterX="0.5" CenterY="0.5" />
                                </TransformGroup>
                            </Grid.RenderTransform>
                            <Path Width="10" Height="10" Stretch="Fill"
									Stroke="{TemplateBinding Foreground}" StrokeThickness="1"
									StrokeStartLineCap="Round" Data="M1,0 A1,1,90,1,1,0,-1" />

                            <Path Margin="5,-1.5,0,0" HorizontalAlignment="Left"
									VerticalAlignment="Top" Width="4" Height="4" Stretch="Fill"
									Fill="{TemplateBinding Foreground}"
									Data="M0,-1.1 L0.1,-1 L0,-0.9" StrokeThickness="1" />
                        </Grid>

                    </Grid>
                    <!--/ ListRoot decoration -->

                    <!-- Checkbox/Radio -->
                    <CheckBox IsTabStop="False" Grid.Column="2" VerticalAlignment="Center"
							telerik:StyleManager.Theme="{StaticResource Theme}"
							Margin="5,0,0,0" x:Name="CheckBoxElement" Visibility="Collapsed" />
                    <RadioButton IsTabStop="False" Grid.Column="2" Margin="5,0,0,0"
							telerik:StyleManager.Theme="{StaticResource Theme}"
							VerticalAlignment="Center" x:Name="RadioButtonElement"
							Visibility="Collapsed" />

                    <!--/ Checkbox/Radio -->

                    <!-- Image and text -->
                    <Image Grid.Column="3" x:Name="Image" Tag="Wow"
							MaxWidth="16" MaxHeight="16" Margin="2" HorizontalAlignment="Center"
							VerticalAlignment="Center" />

                    <!-- Focus -->
                    <Rectangle x:Name="FocusVisual" Visibility="Collapsed" Grid.Column="2"
							Grid.ColumnSpan="6" Stroke="{StaticResource FocusBrushBlack}"
							StrokeThickness="1" StrokeDashArray="1 2" IsHitTestVisible="False"
							RadiusX="3" RadiusY="3" />

                    <!-- Content -->
                    <Grid Grid.Column="4" Grid.ColumnSpan="2">
                        <ContentPresenter x:Name="Header" 
							
                        ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}"
                        
                        Content="{TemplateBinding Header}"
							ContentTemplate="{TemplateBinding HeaderTemplate}"
							HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
							VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
							Margin="{TemplateBinding Padding}" />

                        <ContentPresenter x:Name="EditHeaderElement" Visibility="Collapsed"
							
                            ContentTemplateSelector="{TemplateBinding HeaderEditTemplateSelector}"
							ContentTemplate="{TemplateBinding HeaderEditTemplate}"
                            
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
							VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
							Margin="{TemplateBinding Padding}" />

                    </Grid>

                </Grid>
                <!-- Items Container -->
                <ItemsPresenter Grid.Row="1" x:Name="ItemsHost" Visibility="Collapsed"/>
                <!--/ Items Container -->

            </Grid>

            <ControlTemplate.Triggers>
                <Trigger Property="IsInEditMode" Value="true">
                    <Setter Property="Visibility" TargetName="Header" Value="Collapsed" />
                    <Setter Property="Visibility" TargetName="EditHeaderElement" Value="Visible" />
                </Trigger>
                <Trigger Property="IsSelected" Value="true">
                    <Setter Property="Visibility" TargetName="SelectionVisual" Value="Visible" />
                </Trigger>
                <Trigger Property="IsFocused" Value="true">
                    <Setter Property="Visibility" TargetName="FocusVisual" Value="Visible" />
                </Trigger>
                <MultiTrigger>
                    <MultiTrigger.Conditions>
                        <Condition Property="IsSelected" Value="True" />
                        <Condition Property="IsSelectionActive" Value="False" />
                    </MultiTrigger.Conditions>
                    <Setter Property="Opacity" TargetName="SelectionVisual" Value="0" />
                    <Setter Property="Visibility" TargetName="SelectionUnfocusedVisual" Value="Visible" />
                </MultiTrigger>
                <Trigger Property="IsEnabled" Value="false">
                    <Setter Property="Opacity" TargetName="Header" Value="0.5" />
                </Trigger>

                <Trigger Property="IsExpanded" Value="true">
                    <Setter TargetName="ItemsHost" Property="Visibility" Value="Visible" />
                </Trigger>
                <Trigger Property="IsLoadingOnDemand" Value="true">
                    <Setter TargetName="LoadingVisual" Property="Visibility" Value="Visible" />
                    <Setter TargetName="Expander" Property="Visibility" Value="Collapsed" />
                    <Trigger.EnterActions>
                        <BeginStoryboard x:Name="LoadingVisualTransform">
                            <Storyboard>
                                <DoubleAnimation From="0" To="359" Duration="0:0:1"
									RepeatBehavior="Forever"
									Storyboard.TargetName="LoadingVisualAngleTransform"
									Storyboard.TargetProperty="Angle" />
                            </Storyboard>
                        </BeginStoryboard>
                    </Trigger.EnterActions>
                    <Trigger.ExitActions>
                        <StopStoryboard BeginStoryboardName="LoadingVisualTransform" />
                    </Trigger.ExitActions>
                </Trigger>
                <Trigger Property="IsDragOver" Value="True">
                    <Setter Property="Opacity" Value="1" TargetName="MouseOverVisual" />
                </Trigger>
                <Trigger Property="IsMouseOver" SourceName="HeaderRow" Value="True">
                    <Setter Property="Opacity" Value="1" TargetName="MouseOverVisual" />
                </Trigger>
            </ControlTemplate.Triggers>

        </ControlTemplate>

        <Style TargetType="telerik:RadTreeViewItem" x:Key="RadTreeViewItemSyle" >
            <Setter Property="FocusVisualStyle" Value="{StaticResource TreeviewFocusVisual}"/>
            <Setter Property="HorizontalContentAlignment" Value="Left" />
            <Setter Property="VerticalContentAlignment" Value="Center" />
            <Setter Property="BorderThickness" Value="1" />
            <Setter Property="Padding" Value="1 0 5 0" />
            <Setter Property="IsDropAllowed" Value="True" />
            <Setter Property="ItemsOptionListType" Value="Default" />
            <Setter Property="IsEnabled" Value="True" />
            <Setter Property="MinHeight" Value="24" />
            <Setter Property="Template" Value="{StaticResource TreeViewItemDefaultTemplate}" />
            <Setter Property="ItemsPanel">
                <Setter.Value>
                    <ItemsPanelTemplate>
                        <treeView:TreeViewPanel VerticalAlignment="Bottom" />
                    </ItemsPanelTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>
    <Grid>
        <telerik:RadTreeView animation:AnimationManager.IsAnimationEnabled="False">
            <telerik:RadTreeViewItem Header="Item 1" Style="{StaticResource RadTreeViewItemSyle}" >
                <telerik:RadTreeViewItem Header="Item 1.1" Style="{StaticResource RadTreeViewItemSyle}"/>
                <telerik:RadTreeViewItem Header="Item 1.2" Style="{StaticResource RadTreeViewItemSyle}"/>
                <telerik:RadTreeViewItem Header="Item 1.3" Style="{StaticResource RadTreeViewItemSyle}"/>
                <telerik:RadTreeViewItem Header="Item 1.4" Style="{StaticResource RadTreeViewItemSyle}"/>
                <telerik:RadTreeViewItem Header="Item 1.5" Style="{StaticResource RadTreeViewItemSyle}"/>
                <telerik:RadTreeViewItem Header="Item 1.6" Style="{StaticResource RadTreeViewItemSyle}"/>
                <telerik:RadTreeViewItem Header="Item 1.7" Style="{StaticResource RadTreeViewItemSyle}"/>
                <telerik:RadTreeViewItem Header="Item 1.8" Style="{StaticResource RadTreeViewItemSyle}"/>
                <telerik:RadTreeViewItem Header="Item 1.9" Style="{StaticResource RadTreeViewItemSyle}"/>
                <telerik:RadTreeViewItem Header="Item 1.10" Style="{StaticResource RadTreeViewItemSyle}"/>
            </telerik:RadTreeViewItem>
            <telerik:RadTreeViewItem Header="Item 2" Style="{StaticResource RadTreeViewItemSyle}">
                <telerik:RadTreeViewItem Header="Item 2.1" Style="{StaticResource RadTreeViewItemSyle}"/>
                <telerik:RadTreeViewItem Header="Item 2.2" Style="{StaticResource RadTreeViewItemSyle}"/>
                <telerik:RadTreeViewItem Header="Item 2.3" Style="{StaticResource RadTreeViewItemSyle}"/>
                <telerik:RadTreeViewItem Header="Item 2.4" Style="{StaticResource RadTreeViewItemSyle}"/>
                <telerik:RadTreeViewItem Header="Item 2.5" Style="{StaticResource RadTreeViewItemSyle}"/>
                <telerik:RadTreeViewItem Header="Item 2.6" Style="{StaticResource RadTreeViewItemSyle}"/>
                <telerik:RadTreeViewItem Header="Item 2.7" Style="{StaticResource RadTreeViewItemSyle}"/>
                <telerik:RadTreeViewItem Header="Item 2.8" Style="{StaticResource RadTreeViewItemSyle}"/>
                <telerik:RadTreeViewItem Header="Item 2.9" Style="{StaticResource RadTreeViewItemSyle}"/>
                <telerik:RadTreeViewItem Header="Item 2.10" Style="{StaticResource RadTreeViewItemSyle}"/>
            </telerik:RadTreeViewItem>
            <telerik:RadTreeViewItem Header="Item 3" Style="{StaticResource RadTreeViewItemSyle}">
                <telerik:RadTreeViewItem Header="Item 3.1" Style="{StaticResource RadTreeViewItemSyle}"/>
                <telerik:RadTreeViewItem Header="Item 3.2" Style="{StaticResource RadTreeViewItemSyle}"/>
                <telerik:RadTreeViewItem Header="Item 3.3" Style="{StaticResource RadTreeViewItemSyle}"/>
                <telerik:RadTreeViewItem Header="Item 3.4" Style="{StaticResource RadTreeViewItemSyle}"/>
                <telerik:RadTreeViewItem Header="Item 3.5" Style="{StaticResource RadTreeViewItemSyle}"/>
                <telerik:RadTreeViewItem Header="Item 3.6" Style="{StaticResource RadTreeViewItemSyle}"/>
                <telerik:RadTreeViewItem Header="Item 3.7" Style="{StaticResource RadTreeViewItemSyle}"/>
                <telerik:RadTreeViewItem Header="Item 3.8" Style="{StaticResource RadTreeViewItemSyle}"/>
                <telerik:RadTreeViewItem Header="Item 3.9" Style="{StaticResource RadTreeViewItemSyle}"/>
                <telerik:RadTreeViewItem Header="Item 3.10" Style="{StaticResource RadTreeViewItemSyle}"/>
            </telerik:RadTreeViewItem>
        </telerik:RadTreeView>
    </Grid>
</Window>
