<?xml version="1.0" encoding="utf-8"?>
<UserControl x:Class="C1DataGrid_Demo2010.HierarchicalTasks" mc:Ignorable="d" d:DataContext="{d:DesignData Source=/DesignData/SampleTasks.xaml}" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml" xmlns:local="clr-namespace:C1DataGrid_Demo2010" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">
    <UserControl.Resources>
        <Style x:Key="TButtonStyle" TargetType="ToggleButton">
            <Setter Property="Cursor" Value="Hand" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ToggleButton">
                        <Grid Background="Transparent">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal" />
                                    <VisualState x:Name="MouseOver" />
                                    <VisualState x:Name="Pressed" />
                                    <VisualState x:Name="Disabled" />
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="CheckStates">
                                    <VisualState x:Name="Checked">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="path" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Visible" />
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Unchecked">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="path" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Visible" />
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="path1" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="0">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Visible" />
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused" />
                                    <VisualState x:Name="Unfocused" />
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Grid>
                                <Grid x:Name="icos">
                                    <Rectangle x:Name="path" Fill="{TemplateBinding Foreground}" VerticalAlignment="Center" HorizontalAlignment="Center" Height="1" Width="5" Visibility="Collapsed" />
                                    <Rectangle x:Name="path1" Fill="{TemplateBinding Foreground}" Height="5" Width="1" Visibility="Collapsed" />
                                </Grid>
                            </Grid>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <local:TimeConverter x:Key="timeConverter" />
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot">
        <c1:C1DataGrid x:Name="grid" CanUserFilter="False" CanUserSort="False" CanUserAddRows="False" RowBackground="White" AlternatingRowBackground="White" GridLinesVisibility="All" LoadingRow="grid_LoadingRow" LoadedRowHeaderPresenter="grid_LoadedRowHeaderPresenter" LoadedRowPresenter="grid_LoadedRowPresenter" LoadedCellPresenter="grid_LoadedCellPresenter" AutoGenerateColumns="False" ItemsSource="{Binding}">
            <c1:C1DataGrid.Columns>
                <c1:DataGridBoundColumn Binding="{Binding WBS}" Header="WBS" Width="Auto" />
                <c1:DataGridTextColumn Binding="{Binding Name, Mode=TwoWay}" Header="Task Name" />
                <c1:DataGridTextColumn Binding="{Binding Duration,Converter={StaticResource timeConverter}}" Header="Duration" />
                <c1:DataGridDateTimeColumn Binding="{Binding Start, Mode=TwoWay}" Header="Start" EditMode="Date" Format="ddd d/M/yyyy" />
                <c1:DataGridDateTimeColumn Binding="{Binding Finish}" Header="Finish" Format="ddd d/M/yyyy" />
            </c1:C1DataGrid.Columns>
        </c1:C1DataGrid>
    </Grid>
</UserControl>