<Window x:Class="RadTreeView_Line.Window1"
    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">
	<Window.Resources>
		<!-- Line Brush -->
		<SolidColorBrush Color="Red" x:Key="LineBrush" />
		
		<ControlTemplate x:Key="RadTreeViewItemControlTemplate1" TargetType="{x:Type telerik:RadTreeViewItem}">
			<Grid x:Name="RootElement">
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto"/>
					<RowDefinition/>
				</Grid.RowDefinitions>
				<Grid x:Name="HeaderRow" MinHeight="{TemplateBinding MinHeight}" Background="Transparent">
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="Auto"/>
						<ColumnDefinition Width="Auto"/>
						<ColumnDefinition Width="Auto"/>
						<ColumnDefinition Width="Auto"/>
						<ColumnDefinition Width="Auto"/>
						<ColumnDefinition Width="*"/>
					</Grid.ColumnDefinitions>
					<Rectangle Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="{TemplateBinding BorderThickness}" RadiusX="2" RadiusY="2" Grid.Column="2" Grid.ColumnSpan="6"/>
					<Rectangle x:Name="MouseOverVisual" RadiusX="2" RadiusY="2" Opacity="0" Grid.Column="2" Grid.ColumnSpan="6">
						<Rectangle.Fill>
							<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
								<GradientStop Color="#FFFDFDF1" Offset="0"/>
								<GradientStop Color="#FFFDEDBD" Offset="1"/>
								<GradientStop Color="#FFFDF2CC" Offset="0.5"/>
								<GradientStop Color="#FFFDE6A5" Offset="0.51"/>
							</LinearGradientBrush>
						</Rectangle.Fill>
						<Rectangle.Stroke>
							<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
								<GradientStop Color="#FFE8E0C2" Offset="0"/>
								<GradientStop Color="#FFE6E2D0" Offset="1"/>
							</LinearGradientBrush>
						</Rectangle.Stroke>
					</Rectangle>
					<Rectangle x:Name="SelectionUnfocusedVisual" Stroke="#FFDBDBDB" RadiusX="2" RadiusY="2" IsHitTestVisible="False" Visibility="Collapsed" Grid.Column="2" Grid.ColumnSpan="6">
						<Rectangle.Fill>
							<LinearGradientBrush EndPoint="0,1">
								<GradientStop Color="#FFF8F6F9" Offset="0"/>
								<GradientStop Color="#FFF0F0F0" Offset="1"/>
							</LinearGradientBrush>
						</Rectangle.Fill>
					</Rectangle>
					<Rectangle x:Name="SelectionVisual" RadiusX="2" RadiusY="2" IsHitTestVisible="False" Visibility="Collapsed" Grid.Column="2" Grid.ColumnSpan="6">
						<Rectangle.Fill>
							<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
								<GradientStop Color="#FFFEFDF1" Offset="0"/>
								<GradientStop Color="#FFFEE699" Offset="1"/>
								<GradientStop Color="#FFFEEBAA" Offset="0.5"/>
								<GradientStop Color="#FFFED560" Offset="0.51"/>
							</LinearGradientBrush>
						</Rectangle.Fill>
						<Rectangle.Stroke>
							<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
								<GradientStop Color="#FFDBCF9C" Offset="0"/>
								<GradientStop Color="#FFD8D1B3" Offset="1"/>
							</LinearGradientBrush>
						</Rectangle.Stroke>
					</Rectangle>
					<StackPanel x:Name="IndentContainer" Opacity="0.2" Orientation="Horizontal">
						<Rectangle x:Name="IndentFirstVerticalLine" Stroke="{StaticResource LineBrush}" VerticalAlignment="Top" Width="1" Visibility="Collapsed">
							<Rectangle.Clip>
								<RectangleGeometry Rect="0,0,1,10000"/>
							</Rectangle.Clip>
						</Rectangle>
					</StackPanel>
					<Grid x:Name="ListRootContainer" HorizontalAlignment="Center" MinWidth="20" Grid.Column="1">
						<Rectangle x:Name="HorizontalLine" Stroke="{StaticResource LineBrush}" SnapsToDevicePixels="True" HorizontalAlignment="Right" VerticalAlignment="Center" Height="1" Opacity="0.2" />
						<Rectangle x:Name="VerticalLine" Stroke="{StaticResource LineBrush}" SnapsToDevicePixels="True" HorizontalAlignment="Center" VerticalAlignment="Top" Width="1" Opacity="0.2" />
						<ToggleButton x:Name="Expander" Background="{TemplateBinding Background}" IsTabStop="False"/>
						<Grid x:Name="LoadingVisual" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5" Visibility="Collapsed">
							<Grid.RenderTransform>
								<TransformGroup>
									<RotateTransform Angle="0" CenterX="0.5" CenterY="0.5"/>
								</TransformGroup>
							</Grid.RenderTransform>
							<Path Stretch="Fill" Stroke="{TemplateBinding Foreground}" StrokeStartLineCap="Round" StrokeThickness="1" Width="10" Height="10" Data="M1,0A1,1,90,1,1,0,-1"/>
							<Path Fill="{TemplateBinding Foreground}" Stretch="Fill" StrokeThickness="1" HorizontalAlignment="Left" Margin="5,-1.5,0,0" VerticalAlignment="Top" Width="4" Height="4" Data="M0,-1.1L0.1,-1 0,-0.9"/>
						</Grid>
					</Grid>
					<CheckBox x:Name="CheckBoxElement" Margin="5,0,0,0" VerticalAlignment="Center" IsTabStop="False" Visibility="Collapsed" Grid.Column="2">
						<telerik:StyleManager.Theme>
							<telerik:Office_BlackTheme/>
						</telerik:StyleManager.Theme>
					</CheckBox>
					<RadioButton x:Name="RadioButtonElement" Margin="5,0,0,0" VerticalAlignment="Center" IsTabStop="False" Visibility="Collapsed" Grid.Column="2">
						<telerik:StyleManager.Theme>
							<telerik:Office_BlackTheme/>
						</telerik:StyleManager.Theme>
					</RadioButton>
					<Image x:Name="Image" HorizontalAlignment="Center" Margin="2" MaxHeight="16" MaxWidth="16" VerticalAlignment="Center" Grid.Column="3" Source="{TemplateBinding DefaultImageSrc}"/>
					<Rectangle x:Name="FocusVisual" Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" RadiusX="3" RadiusY="3" IsHitTestVisible="False" Visibility="Collapsed" Grid.Column="2" Grid.ColumnSpan="6"/>
					<Grid Grid.Column="4" Grid.ColumnSpan="2">
						<ContentPresenter x:Name="Header" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}"/>
						<ContentPresenter x:Name="EditHeaderElement" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Visibility="Collapsed" ContentTemplate="{TemplateBinding HeaderEditTemplate}"/>
					</Grid>
					<Border x:Name="EditElementContainer" HorizontalAlignment="Left" VerticalAlignment="Center" Width="Auto" Visibility="Collapsed" Grid.Column="4" Background="White" BorderBrush="White" BorderThickness="1" CornerRadius="3">
						<Border Width="Auto" Height="Auto" BorderBrush="#FF979994" BorderThickness="1" CornerRadius="2">
							<TextBox x:Name="EditElement" BorderThickness="0" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
						</Border>
					</Border>
					<Rectangle x:Name="DisabledVisual" IsHitTestVisible="True" Visibility="Collapsed" Grid.Column="2" Grid.ColumnSpan="3"/>
				</Grid>
				<ItemsPresenter x:Name="ItemsHost" VerticalAlignment="Bottom" Visibility="Collapsed" Grid.Row="1"/>
			</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="Visibility" TargetName="SelectionVisual" Value="Collapsed"/>
					<Setter Property="Visibility" TargetName="SelectionUnfocusedVisual" Value="Visible"/>
				</MultiTrigger>
				<Trigger Property="IsEnabled" Value="False">
					<Setter Property="Opacity" TargetName="RootElement" Value="0.5"/>
				</Trigger>
				<Trigger Property="IsExpanded" Value="True">
					<Trigger.EnterActions>
						<BeginStoryboard>
							<Storyboard>
								<DoubleAnimation Duration="00:00:00.2000000" Storyboard.TargetName="ItemsHost" Storyboard.TargetProperty="Opacity" From="0.1" To="1"/>
							</Storyboard>
						</BeginStoryboard>
					</Trigger.EnterActions>
					<Setter Property="Visibility" TargetName="ItemsHost" Value="Visible"/>
				</Trigger>
				<Trigger Property="IsLoadingOnDemand" Value="True">
					<Trigger.EnterActions>
						<BeginStoryboard>
							<Storyboard>
								<DoubleAnimation Duration="00:00:01" RepeatBehavior="Forever" Storyboard.TargetName="LoadingVisualAngleTransform" Storyboard.TargetProperty="Angle" From="0" To="359"/>
							</Storyboard>
						</BeginStoryboard>
					</Trigger.EnterActions>
					<Setter Property="Visibility" TargetName="LoadingVisual" Value="Visible"/>
					<Setter Property="Visibility" TargetName="Expander" Value="Collapsed"/>
				</Trigger>
				<Trigger Property="IsDragOver" Value="True">
					<Setter Property="Opacity" TargetName="MouseOverVisual" Value="1"/>
				</Trigger>
				<Trigger Property="IsMouseOver" SourceName="HeaderRow" Value="True">
					<Setter Property="Opacity" TargetName="MouseOverVisual" Value="1"/>
				</Trigger>
			</ControlTemplate.Triggers>
		</ControlTemplate>
	</Window.Resources>
    <Grid>
		<telerik:RadTreeView Margin="20 5" IsEditable="true"  HorizontalAlignment="Left"
				 SelectionMode="Extended" ItemsOptionListType="OptionList" IsOptionElementsEnabled="True" 
					IsLineEnabled="True"					 >
			<telerik:RadTreeViewItem Header="Personal Folders" IsExpanded="True" Template="{DynamicResource RadTreeViewItemControlTemplate1}" >
				<telerik:RadTreeViewItem Header="Deleted Items(6)" Template="{DynamicResource RadTreeViewItemControlTemplate1}"/>
				<telerik:RadTreeViewItem Header="Drafts" Template="{DynamicResource RadTreeViewItemControlTemplate1}"/>
				<telerik:RadTreeViewItem Header="Inbox(14)" IsExpanded="True" Template="{DynamicResource RadTreeViewItemControlTemplate1}">
					<telerik:RadTreeViewItem Header="Folders" Template="{DynamicResource RadTreeViewItemControlTemplate1}"/>
				</telerik:RadTreeViewItem>
				<telerik:RadTreeViewItem  Header="Junk E-mails" Template="{DynamicResource RadTreeViewItemControlTemplate1}"/>
				<telerik:RadTreeViewItem Header="Outbox" Template="{DynamicResource RadTreeViewItemControlTemplate1}"/>
				<telerik:RadTreeViewItem Header="Sent Items" Template="{DynamicResource RadTreeViewItemControlTemplate1}"/>
				<telerik:RadTreeViewItem Header="Search Folder" IsExpanded="True" Template="{DynamicResource RadTreeViewItemControlTemplate1}">
					<telerik:RadTreeViewItem Header="From Follow up" Template="{DynamicResource RadTreeViewItemControlTemplate1}"/>
					<telerik:RadTreeViewItem Header="Large Mail" Template="{DynamicResource RadTreeViewItemControlTemplate1}"/>
					<telerik:RadTreeViewItem Header="Unread Mail" Template="{DynamicResource RadTreeViewItemControlTemplate1}"/>
				</telerik:RadTreeViewItem>
			</telerik:RadTreeViewItem>
		</telerik:RadTreeView>

	</Grid>
</Window>
