<UserControl
    x:Class="ExpressionEditorSamples.ExpressionEditorEE"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:IntegrationGridSamples"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:c1="using:C1.Xaml.ExpressionEditor"
    x:Name="editor"
    mc:Ignorable="d" MaxWidth="600">

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Border BorderBrush="Black" BorderThickness="1">
            <Grid Background="White">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Border BorderBrush="Black" BorderThickness="0,0,0,1">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <c1:C1ExpressionEditor x:Name="expressionEditor" HorizontalAlignment="Stretch" Height="50"
                                               ExpressionChanged="ExpressionEditor_ExpressionChanged" ShowErrorBox="False"/>
                        <c1:C1ExpressionEditorPanel x:Name="expressionPanel" ExpressionEditor="{Binding ElementName=expressionEditor}" Grid.Row="1"/>
                        <StackPanel Orientation="Horizontal" Grid.Row="2">
                            <TextBlock Text="Result : " FontWeight="Bold"/>
                            <TextBlock x:Name="result" Text="" />
                        </StackPanel>
                        <TextBlock x:Name="errors" Grid.Row="3" Foreground="Red" TextWrapping="Wrap"  HorizontalAlignment="Left" VerticalAlignment="Top" MinHeight="25" />
                    </Grid>
                </Border>
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Visibility="{Binding OperateVisibility, ElementName=editor}" Grid.Row="1">
                    <Button x:Name="btn_Ok" Click="Ok_Click" Content="{Binding OKContent, ElementName=editor}" MinWidth="60" Margin="5" />
                    <Button Click="Cancel_Click" Content="{Binding CancelContent, ElementName=editor}" MinWidth="60" Margin="5" />
                </StackPanel>
            </Grid>
        </Border>
    </Grid>

</UserControl>
