<UserControl
    x:Class="ControlExplorer.Controls.TreeView.Edit"
    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:c1="using:C1.Xaml"
    mc:Ignorable="d"
    d:DesignHeight="300"
    d:DesignWidth="400">

    <Grid x:Name="Root">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <c1:C1TreeView x:Name="EditableTreeView" Grid.Row="1">
            <c1:C1TreeView.ItemContainerStyle>
                <Style TargetType="c1:C1TreeViewItem">
                    <Setter Property="IsExpanded" Value="True" />
                </Style>
            </c1:C1TreeView.ItemContainerStyle>
            <c1:C1TreeView.ItemTemplate>
                <c1:C1HierarchicalDataTemplate x:Name="nodeTemplate" ItemsSource="{Binding Children}">
                    <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <Image HorizontalAlignment="Left" Width="16" Height="16" Source="{Binding Icon}" Stretch="Fill" Margin="0 0 5 0" />
                        <TextBlock Text="{Binding Name}" />
                    </StackPanel>
                    </DataTemplate>
                </c1:C1HierarchicalDataTemplate>
            </c1:C1TreeView.ItemTemplate>
            <c1:C1TreeView.EditTemplate>
                <DataTemplate>
                    <TextBox Text="{Binding Name, Mode=TwoWay}" BorderThickness="0" Padding="0" Background="Transparent" />
                </DataTemplate>
            </c1:C1TreeView.EditTemplate>
        </c1:C1TreeView>
    </Grid>
</UserControl>
