<UserControl x:Class="Q3.SL.Demos.Demos.Calculator"
             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:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:vms="clr-namespace:Q3.SL.Demos.ViewModels"
             mc:Ignorable="d"
             d:DesignHeight="600"
             d:DesignWidth="800">
    <UserControl.Resources>
        <vms:CalcViewModel x:Key="xCalcViewModel" />
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot"
          DataContext="{StaticResource xCalcViewModel}"
          Background="White">
        <Border HorizontalAlignment="Center"
                VerticalAlignment="Center"
                Width="700"
                Height="400"
                Background="{StaticResource MainBrush}"
                BorderThickness="1"
                BorderBrush="{StaticResource BasicBrush}">
            <Border.Effect>
                <DropShadowEffect BlurRadius="5"
                                  Color="Black"
                                  ShadowDepth="5"
                                  Opacity=".5" />
            </Border.Effect>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="60" />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <TextBlock Text="How Much is...?" MouseLeftButtonDown="TextBlock_MouseLeftButtonDown"
                           Style="{StaticResource zTitleBlockStyle}" />
                <telerik:RadCalculator x:Name="xCalc"
                                       Grid.Row="1" />
                <telerik:RadGridView x:Name="xRadGrid"
                                     Visibility="Collapsed"
                                     ItemsSource="{Binding CalcCollection}"
                                     Grid.Row="1"
                                     Grid.Column="1"
                                     Margin="20,30"
                                     AutoGenerateColumns="False">
                    <telerik:RadGridView.Columns>
                        <telerik:GridViewDataColumn Header="ID"
                                                    DataMemberBinding="{Binding Id}" />
                        <telerik:GridViewDataColumn Header="Name"
                                                    DataMemberBinding="{Binding Name}" />
                        <telerik:GridViewDataColumn Header="Super Value"
                                                    DataMemberBinding="{Binding CalcValue}">
                            <telerik:GridViewDataColumn.CellEditTemplate>
                                <DataTemplate>
                                    <telerik:RadCalculatorPicker Value="{Binding CalcValue, Mode=TwoWay}" />
                                </DataTemplate>
                            </telerik:GridViewDataColumn.CellEditTemplate>
                        </telerik:GridViewDataColumn>
                    </telerik:RadGridView.Columns>
                </telerik:RadGridView>
            </Grid>
        </Border>
    </Grid>
</UserControl>
