<Window
        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:local="clr-namespace:CustomEngineSamples"
        xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml" x:Class="CustomEngineSamples.MainWindow"
        mc:Ignorable="d"
        Title="CustomEngine Sample" Height="550" Width="825">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition />
        </Grid.RowDefinitions>

        <StackPanel>
            <TextBlock Text="Expression :" Margin="5" />
            <c1:C1ExpressionEditor x:Name="editor" Margin="5" Width="200" Height="300" ShowErrorBox="False"/>
        </StackPanel>
        <StackPanel Grid.Row="1">
            <Button x:Name="Evaluate" Content="Evaluate" Margin="5" Click="Evaluate_Click" />
            <Button x:Name="Clear" Content="Clear" Margin="5" Click="Clear_Click" />
            <TextBlock x:Name="text" Margin="5" Width="200" TextWrapping="Wrap" />
        </StackPanel>
        <c1:C1TreeView x:Name="treeView" Grid.Column="1" Grid.RowSpan="2" >
            <c1:C1TreeView.Resources>
                <Style TargetType="c1:C1TreeViewItem">
                    <Setter Property="IsExpanded" Value="True" />
                </Style>
            </c1:C1TreeView.Resources>
            <c1:C1TreeView.ItemTemplate>
                <c1:C1HierarchicalDataTemplate ItemsSource="{Binding ProductsGroups}">
                    <c1:C1HierarchicalDataTemplate.ItemTemplate>
                        <c1:C1HierarchicalDataTemplate ItemsSource="{Binding Products}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition />
                                    <ColumnDefinition />
                                    <ColumnDefinition />
                                </Grid.ColumnDefinitions>
                                <TextBlock Text="{Binding Name}" Width="100" Grid.Column="0" />
                                <TextBlock Text="{Binding Price}" Width="50" Grid.Column="1" />
                                <TextBlock Text="{Binding Count}" Width="50" Grid.Column="2" />
                            </Grid>
                        </c1:C1HierarchicalDataTemplate>
                    </c1:C1HierarchicalDataTemplate.ItemTemplate>
                    <TextBlock Text="{Binding Name}"/>
                </c1:C1HierarchicalDataTemplate>
            </c1:C1TreeView.ItemTemplate>
        </c1:C1TreeView>
    </Grid>
</Window>
