<UserControl x:Class="CalculatorApp.CalculatorStandardOperators"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:common="using:CalculatorApp.Common"
             xmlns:controls="using:CalculatorApp.Controls"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:local="using:CalculatorApp"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             x:Name="ControlRoot"
             mc:Ignorable="d">

    <Grid x:Name="Root">
        <Grid.RowDefinitions>
            <RowDefinition x:Name="R0" Height="1*"/>
            <RowDefinition x:Name="R1" Height="1*"/>
            <RowDefinition x:Name="R2" Height="1*"/>
            <RowDefinition x:Name="R3" Height="1*"/>
            <RowDefinition x:Name="R4" Height="1*"/>
            <RowDefinition x:Name="R5" Height="1*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition x:Name="GutterLeft" Width="0"/>
            <ColumnDefinition x:Name="C0" Width="0"/>
            <ColumnDefinition x:Name="C1" Width="1*"/>
            <ColumnDefinition x:Name="C2" Width="1*"/>
            <ColumnDefinition x:Name="C3" Width="1*"/>
            <ColumnDefinition x:Name="C4" Width="1*"/>
            <ColumnDefinition x:Name="GutterRight" Width="0"/>
        </Grid.ColumnDefinitions>

        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="ErrorVisualStates">
                <VisualState x:Name="NoErrorLayout"/>
                <VisualState x:Name="ErrorLayout">
                    <VisualState.Setters>
                        <Setter Target="PercentButton.IsEnabled" Value="False"/>
                        <Setter Target="SquareRootButton.IsEnabled" Value="False"/>
                        <Setter Target="XPower2Button.IsEnabled" Value="False"/>
                        <Setter Target="XPower3Button.IsEnabled" Value="False"/>
                        <Setter Target="InvertButton.IsEnabled" Value="False"/>
                        <Setter Target="DivideButton.IsEnabled" Value="False"/>
                        <Setter Target="MultiplyButton.IsEnabled" Value="False"/>
                        <Setter Target="MinusButton.IsEnabled" Value="False"/>
                        <Setter Target="PlusButton.IsEnabled" Value="False"/>
                        <Setter Target="NegateButton.IsEnabled" Value="False"/>
                    </VisualState.Setters>
                </VisualState>
            </VisualStateGroup>
            <VisualStateGroup>
                <VisualState x:Name="NormalFontSize">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowHeight="440" MinWindowWidth="0"/>
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                        <Setter Target="PercentButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
                        <Setter Target="SquareRootButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
                        <Setter Target="XPower2Button.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
                        <Setter Target="InvertButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
                        <Setter Target="NegateButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
                        <Setter Target="ClearEntryButton.Style" Value="{StaticResource OperatorButtonStyle}"/>
                        <Setter Target="ClearButton.Style" Value="{StaticResource OperatorButtonStyle}"/>
                        <Setter Target="BackSpaceButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
                        <Setter Target="DivideButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
                        <Setter Target="MultiplyButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
                        <Setter Target="MinusButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
                        <Setter Target="PlusButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
                        <Setter Target="EqualButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>

                        <Setter Target="NumberPad.ButtonStyle" Value="{StaticResource NumericButtonStyle24}"/>
                    </VisualState.Setters>
                </VisualState>
                <VisualState x:Name="SmallFontSize">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowHeight="260" MinWindowWidth="0"/>
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                        <Setter Target="NumberPad.ButtonStyle" Value="{StaticResource NumericButtonStyle18}"/>
                    </VisualState.Setters>
                </VisualState>
                <VisualState x:Name="TinyFontSize">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowHeight="0" MinWindowWidth="0"/>
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                        <Setter Target="PercentButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeTiny}"/>
                        <Setter Target="SquareRootButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeTiny}"/>
                        <Setter Target="XPower2Button.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeTiny}"/>
                        <Setter Target="InvertButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeTiny}"/>
                        <Setter Target="NegateButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeTiny}"/>
                        <Setter Target="ClearEntryButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeTiny}"/>
                        <Setter Target="ClearButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeTiny}"/>
                        <Setter Target="BackSpaceButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeTiny}"/>
                        <Setter Target="DivideButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeTiny}"/>
                        <Setter Target="MultiplyButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeTiny}"/>
                        <Setter Target="MinusButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeTiny}"/>
                        <Setter Target="PlusButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeTiny}"/>
                        <Setter Target="EqualButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeTiny}"/>

                        <Setter Target="NumberPad.ButtonStyle" Value="{StaticResource NumericButtonStyle12}"/>
                    </VisualState.Setters>
                </VisualState>
            </VisualStateGroup>
            <VisualStateGroup>
                <VisualState x:Name="Portrait768x1366">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowHeight="1366" MinWindowWidth="768"/>
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                        <Setter Target="PercentButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="SquareRootButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="XPower2Button.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="XPower3Button.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="InvertButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="NegateButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="ClearEntryButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="ClearButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="BackSpaceButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="DivideButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="MultiplyButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="MinusButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="PlusButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="EqualButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>

                        <Setter Target="NumberPad.ButtonStyle" Value="{StaticResource NumericButtonStyle46}"/>
                    </VisualState.Setters>
                </VisualState>
                <VisualState x:Name="Landscape13InchLaptop">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowHeight="768" MinWindowWidth="1366"/>
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                        <Setter Target="C0.Width" Value="1*"/>
                        <Setter Target="R0.Height" Value="0"/>

                        <Setter Target="StandardFunctions.(Grid.Row)" Value="1"/>
                        <Setter Target="StandardFunctions.(Grid.Column)" Value="1"/>
                        <Setter Target="StandardFunctions.(Grid.RowSpan)" Value="5"/>
                        <Setter Target="StandardFunctions.(Grid.ColumnSpan)" Value="1"/>
                        <Setter Target="FnR1.Height" Value="1*"/>
                        <Setter Target="FnR2.Height" Value="1*"/>
                        <Setter Target="FnR3.Height" Value="1*"/>
                        <Setter Target="FnR4.Height" Value="1*"/>
                        <Setter Target="FnC1.Width" Value="0"/>
                        <Setter Target="FnC2.Width" Value="0"/>
                        <Setter Target="FnC3.Width" Value="0"/>

                        <Setter Target="SquareRootButton.(Grid.Row)" Value="1"/>
                        <Setter Target="SquareRootButton.(Grid.Column)" Value="0"/>
                        <Setter Target="XPower2Button.(Grid.Row)" Value="2"/>
                        <Setter Target="XPower2Button.(Grid.Column)" Value="0"/>
                        <Setter Target="XPower3Button.Visibility" Value="Visible"/>
                        <Setter Target="InvertButton.(Grid.Row)" Value="4"/>
                        <Setter Target="InvertButton.(Grid.Column)" Value="0"/>

                        <Setter Target="NegateButton.(Grid.Row)" Value="5"/>
                        <Setter Target="NegateButton.(Grid.Column)" Value="2"/>

                        <Setter Target="PercentButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
                        <Setter Target="SquareRootButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
                        <Setter Target="XPower2Button.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
                        <Setter Target="InvertButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
                        <Setter Target="NegateButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
                        <Setter Target="ClearEntryButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
                        <Setter Target="ClearButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
                        <Setter Target="BackSpaceButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
                        <Setter Target="DivideButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
                        <Setter Target="MultiplyButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
                        <Setter Target="MinusButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
                        <Setter Target="PlusButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
                        <Setter Target="EqualButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>

                        <Setter Target="NumberPad.ButtonStyle" Value="{StaticResource NumericButtonStyle34}"/>
                    </VisualState.Setters>
                </VisualState>
                <VisualState x:Name="Landscape8InchTab">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowHeight="640" MinWindowWidth="1024"/>
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                        <Setter Target="C0.Width" Value="1*"/>
                        <Setter Target="R0.Height" Value="0"/>

                        <Setter Target="StandardFunctions.(Grid.Row)" Value="1"/>
                        <Setter Target="StandardFunctions.(Grid.Column)" Value="1"/>
                        <Setter Target="StandardFunctions.(Grid.RowSpan)" Value="5"/>
                        <Setter Target="StandardFunctions.(Grid.ColumnSpan)" Value="1"/>
                        <Setter Target="FnR1.Height" Value="1*"/>
                        <Setter Target="FnR2.Height" Value="1*"/>
                        <Setter Target="FnR3.Height" Value="1*"/>
                        <Setter Target="FnR4.Height" Value="1*"/>
                        <Setter Target="FnC1.Width" Value="0"/>
                        <Setter Target="FnC2.Width" Value="0"/>
                        <Setter Target="FnC3.Width" Value="0"/>

                        <Setter Target="SquareRootButton.(Grid.Row)" Value="1"/>
                        <Setter Target="SquareRootButton.(Grid.Column)" Value="0"/>
                        <Setter Target="XPower2Button.(Grid.Row)" Value="2"/>
                        <Setter Target="XPower2Button.(Grid.Column)" Value="0"/>
                        <Setter Target="XPower3Button.Visibility" Value="Visible"/>
                        <Setter Target="InvertButton.(Grid.Row)" Value="4"/>
                        <Setter Target="InvertButton.(Grid.Column)" Value="0"/>

                        <Setter Target="NegateButton.(Grid.Row)" Value="5"/>
                        <Setter Target="NegateButton.(Grid.Column)" Value="2"/>

                        <Setter Target="PercentButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="SquareRootButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="XPower2Button.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="XPower3Button.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="InvertButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="NegateButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="ClearEntryButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="ClearButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="BackSpaceButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="DivideButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="MultiplyButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="MinusButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="PlusButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="EqualButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>

                        <Setter Target="NumberPad.ButtonStyle" Value="{StaticResource NumericButtonStyle28}"/>
                    </VisualState.Setters>
                </VisualState>
                <VisualState x:Name="Portrait8InchTab">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowHeight="1024" MinWindowWidth="640"/>
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                        <Setter Target="PercentButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="SquareRootButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="XPower2Button.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="XPower3Button.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="InvertButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="NegateButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="ClearEntryButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="ClearButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="BackSpaceButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="DivideButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="MultiplyButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="MinusButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="PlusButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="EqualButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>

                        <Setter Target="NumberPad.ButtonStyle" Value="{StaticResource NumericButtonStyle28}"/>
                    </VisualState.Setters>
                </VisualState>
                <VisualState x:Name="Portrait6InchPhone">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowHeight="854" MinWindowWidth="480"/>
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                        <Setter Target="PercentButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
                        <Setter Target="SquareRootButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
                        <Setter Target="XPower2Button.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
                        <Setter Target="InvertButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
                        <Setter Target="NegateButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
                        <Setter Target="ClearEntryButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
                        <Setter Target="ClearButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
                        <Setter Target="BackSpaceButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
                        <Setter Target="DivideButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
                        <Setter Target="MultiplyButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
                        <Setter Target="MinusButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
                        <Setter Target="PlusButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>
                        <Setter Target="EqualButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSizeLarge}"/>

                        <Setter Target="NumberPad.ButtonStyle" Value="{StaticResource NumericButtonStyle34}"/>
                    </VisualState.Setters>
                </VisualState>
                <VisualState x:Name="Portrait5InchPhone">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowHeight="640" MinWindowWidth="360"/>
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                        <Setter Target="PercentButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="SquareRootButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="XPower2Button.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="InvertButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="NegateButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="ClearEntryButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="ClearButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="BackSpaceButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="DivideButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="MultiplyButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="MinusButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="PlusButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>
                        <Setter Target="EqualButton.FontSize" Value="{StaticResource CalcStandardOperatorCaptionSize}"/>

                        <Setter Target="NumberPad.ButtonStyle" Value="{StaticResource NumericButtonStyle28}"/>
                    </VisualState.Setters>
                </VisualState>
                <VisualState x:Name="MinSizeLayout">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowHeight="{StaticResource AppMinWindowHeight}" MinWindowWidth="{StaticResource AppMinWindowWidth}"/>
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                        <Setter Target="PercentButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
                        <Setter Target="SquareRootButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
                        <Setter Target="XPower2Button.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
                        <Setter Target="InvertButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
                        <Setter Target="NegateButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
                        <Setter Target="ClearEntryButton.Style" Value="{StaticResource OperatorButtonStyle}"/>
                        <Setter Target="ClearButton.Style" Value="{StaticResource OperatorButtonStyle}"/>
                        <Setter Target="BackSpaceButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
                        <Setter Target="DivideButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
                        <Setter Target="MultiplyButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
                        <Setter Target="MinusButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
                        <Setter Target="PlusButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>
                        <Setter Target="EqualButton.Style" Value="{StaticResource SymbolOperatorButtonStyle}"/>

                        <Setter Target="NumberPad.ButtonStyle" Value="{StaticResource NumericButtonStyle24}"/>
                    </VisualState.Setters>
                </VisualState>
                <VisualState x:Name="ShowStandardFunctions">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowHeight="394" MinWindowWidth="0"/>
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                        <Setter Target="R0.Height" Value="1*"/>
                        <Setter Target="StandardFunctions.Visibility" Value="Visible"/>
                    </VisualState.Setters>
                </VisualState>
                <VisualState x:Name="DefaultLayout">
                    <VisualState.StateTriggers>
                        <AdaptiveTrigger MinWindowHeight="0" MinWindowWidth="0"/>
                    </VisualState.StateTriggers>
                    <VisualState.Setters>
                        <Setter Target="R0.Height" Value="0*"/>
                        <Setter Target="StandardFunctions.Visibility" Value="Collapsed"/>
                    </VisualState.Setters>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>

        <Grid x:Name="StandardFunctions"
              x:Uid="StandardFunctions"
              Grid.Row="0"
              Grid.Column="2"
              Grid.ColumnSpan="4"
              AutomationProperties.HeadingLevel="Level1">
            <Grid.RowDefinitions>
                <RowDefinition Height="1*"/>
                <RowDefinition x:Name="FnR1" Height="0"/>
                <RowDefinition x:Name="FnR2" Height="0"/>
                <RowDefinition x:Name="FnR3" Height="0"/>
                <RowDefinition x:Name="FnR4" Height="0"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1*"/>
                <ColumnDefinition x:Name="FnC1" Width="1*"/>
                <ColumnDefinition x:Name="FnC2" Width="1*"/>
                <ColumnDefinition x:Name="FnC3" Width="1*"/>
            </Grid.ColumnDefinitions>
            <controls:CalculatorButton x:Name="PercentButton"
                                       x:Uid="percentButton"
                                       Grid.Column="0"
                                       Style="{StaticResource SymbolOperatorButtonStyle}"
                                       AutomationProperties.AutomationId="percentButton"
                                       ButtonId="Percent"
                                       Content="&#xE94C;"/>
            <controls:CalculatorButton x:Name="SquareRootButton"
                                       x:Uid="squareRootButton"
                                       Grid.Column="1"
                                       Style="{StaticResource SymbolOperatorButtonStyle}"
                                       AutomationProperties.AutomationId="squareRootButton"
                                       ButtonId="Sqrt"
                                       Content="&#xF899;"/>
            <controls:CalculatorButton x:Name="XPower2Button"
                                       x:Uid="xpower2Button"
                                       Grid.Column="2"
                                       Style="{StaticResource SymbolOperatorButtonStyle}"
                                       FontSize="18"
                                       AutomationProperties.AutomationId="xpower2Button"
                                       ButtonId="XPower2"
                                       Content="&#xf7c8;"/>
            <controls:CalculatorButton x:Name="XPower3Button"
                                       x:Uid="xpower3Button"
                                       Grid.Row="3"
                                       Style="{StaticResource SymbolOperatorButtonStyle}"
                                       FontSize="18"
                                       AutomationProperties.AutomationId="xpower3Button"
                                       ButtonId="Cube"
                                       Content="&#xf7cb;"
                                       Visibility="Collapsed"/>
            <controls:CalculatorButton x:Name="InvertButton"
                                       x:Uid="invertButton"
                                       Grid.Column="3"
                                       Style="{StaticResource SymbolOperatorButtonStyle}"
                                       FontSize="18"
                                       AutomationProperties.AutomationId="invertButton"
                                       ButtonId="Invert"
                                       Content="&#xf7c9;"/>
        </Grid>

        <Grid x:Name="StandardOperators"
              x:Uid="StandardOperators"
              Grid.Row="1"
              Grid.RowSpan="5"
              Grid.Column="5"
              AutomationProperties.HeadingLevel="Level1">
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <controls:CalculatorButton x:Name="DivideButton"
                                       x:Uid="divideButton"
                                       Grid.Row="0"
                                       Style="{StaticResource AccentCalcButtonStyle}"
                                       AutomationProperties.AutomationId="divideButton"
                                       ButtonId="Divide"
                                       Content="&#xE94A;"/>
            <controls:CalculatorButton x:Name="MultiplyButton"
                                       x:Uid="multiplyButton"
                                       Grid.Row="1"
                                       Style="{StaticResource AccentCalcButtonStyle}"
                                       AutomationProperties.AutomationId="multiplyButton"
                                       ButtonId="Multiply"
                                       Content="&#xE947;"/>
            <controls:CalculatorButton x:Name="MinusButton"
                                       x:Uid="minusButton"
                                       Grid.Row="2"
                                       Style="{StaticResource AccentCalcButtonStyle}"
                                       AutomationProperties.AutomationId="minusButton"
                                       ButtonId="Subtract"
                                       Content="&#xE949;"/>
            <controls:CalculatorButton x:Name="PlusButton"
                                       x:Uid="plusButton"
                                       Grid.Row="3"
                                       Style="{StaticResource AccentCalcButtonStyle}"
                                       AutomationProperties.AutomationId="plusButton"
                                       ButtonId="Add"
                                       Content="&#xE948;"/>
            <controls:CalculatorButton x:Name="EqualButton"
                                       x:Uid="equalButton"
                                       Grid.Row="4"
                                       Style="{StaticResource AccentCalcButtonStyle}"
                                       AutomationProperties.AutomationId="equalButton"
                                       ButtonId="Equals"
                                       Content="&#xE94E;"/>
        </Grid>

        <Grid x:Name="DisplayControls"
              x:Uid="DisplayControls"
              Grid.Row="1"
              Grid.Column="2"
              Grid.ColumnSpan="3"
              AutomationProperties.HeadingLevel="Level1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <controls:CalculatorButton x:Name="ClearEntryButton"
                                       x:Uid="clearEntryButton"
                                       Grid.Column="0"
                                       Style="{StaticResource OperatorButtonStyle}"
                                       FontSize="16"
                                       AutomationProperties.AutomationId="clearEntryButton"
                                       ButtonId="ClearEntry"
                                       Content="CE"/>
            <controls:CalculatorButton x:Name="ClearButton"
                                       x:Uid="clearButton"
                                       Grid.Column="1"
                                       Style="{StaticResource OperatorButtonStyle}"
                                       FontSize="16"
                                       AutomationProperties.AutomationId="clearButton"
                                       ButtonId="Clear"
                                       Content="C"/>
            <controls:CalculatorButton x:Name="BackSpaceButton"
                                       x:Uid="backSpaceButton"
                                       Grid.Column="2"
                                       Style="{StaticResource SymbolOperatorButtonStyle}"
                                       FontSize="16"
                                       AutomationProperties.AutomationId="backSpaceButton"
                                       ButtonId="Backspace"
                                       Content="&#xE94F;"/>
        </Grid>

        <local:NumberPad x:Name="NumberPad"
                         x:Uid="NumberPad"
                         Grid.Row="2"
                         Grid.RowSpan="4"
                         Grid.Column="2"
                         Grid.ColumnSpan="3"
                         AutomationProperties.HeadingLevel="Level1"
                         ButtonStyle="{StaticResource NumericButtonStyle24}"/>

        <controls:CalculatorButton x:Name="NegateButton"
                                   x:Uid="negateButton"
                                   Grid.Row="5"
                                   Grid.Column="2"
                                   Style="{StaticResource SymbolOperatorButtonStyle}"
                                   AutomationProperties.AutomationId="negateButton"
                                   ButtonId="Negate"
                                   Content="&#xF898;"/>
    </Grid>
</UserControl>
