Subversion Repositories Projects

Rev

Rev 2374 | Blame | Last modification | View Log | RSS feed

<Window x:Class="KeyPad.Keypad"
                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:KeyPad"
                Title="MainWindow" Height="313" Width="299" ShowInTaskbar="False" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" >
        <Window.Resources>
                <DropShadowEffect x:Key="DropShadowEffect" 
                                                  ShadowDepth="1" 
                                                  Direction="-90" 
                                                  BlurRadius="5"                           
                                                  />
                <Style TargetType="Label">
                        <Setter Property="FontSize" Value="22"/>           
                </Style>
                <LinearGradientBrush x:Key="IPhoneSteelBackground" EndPoint="0.5,1.272" StartPoint="0.5,0">
                        <GradientStop Color="#FF9097A3" Offset="0"/>
                        <GradientStop Color="#FF444D5B" Offset="1"/>
                </LinearGradientBrush>
                <!--<Storyboard x:Key="sbdShowNum">-->
                        <!--<ObjectAnimationUsingKeyFrames Storyboard.TargetName="NumKeyboard" Storyboard.TargetProperty="(UIElement.Visibility)">
                                <ObjectAnimationUsingKeyFrames.KeyFrames>
                                        <DiscreteObjectKeyFrame KeyTime="00:00:0.001">
                                                <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                        </DiscreteObjectKeyFrame>
                                </ObjectAnimationUsingKeyFrames.KeyFrames>
                        </ObjectAnimationUsingKeyFrames>-->
                        <!--<DoubleAnimation 
                                Storyboard.TargetName="NumKeyboard"  
                                Storyboard.TargetProperty="Opacity" 
                                 From="0"  
                                 To="1"  
                                 Duration="0:0:0.5"  
                                 />  
                                <DoubleAnimation
                                Storyboard.TargetName="AlfaKeyboard"  
                                Storyboard.TargetProperty="Opacity" 
                                 From="1"  
                                 To="0"  
                                 Duration="0:0:0.5"  
                         />-->
                <!--</Storyboard>
                <Storyboard x:Key="sbdShowAlfa">-->
                        <!--<ObjectAnimationUsingKeyFrames Storyboard.TargetName="NumKeyboard" Storyboard.TargetProperty="(UIElement.Visibility)">
                                <ObjectAnimationUsingKeyFrames.KeyFrames>
                                        <DiscreteObjectKeyFrame KeyTime="00:00:0.001">
                                                <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                        </DiscreteObjectKeyFrame>
                                </ObjectAnimationUsingKeyFrames.KeyFrames>
                        </ObjectAnimationUsingKeyFrames>-->
                        <!--<DoubleAnimation 
                                Storyboard.TargetName="AlfaKeyboard"  
                                Storyboard.TargetProperty="Opacity" 
                                 From="0"  
                                 To="1"  
                                 Duration="0:0:0.5"  
                                 />
                                                <DoubleAnimation
                                Storyboard.TargetName="NumKeyboard"  
                                Storyboard.TargetProperty="Opacity" 
                                 From="1"  
                                 To="0"  
                                 Duration="0:0:0.5"  
                   />-->
                <!--</Storyboard>

                <Storyboard x:Key="sbFlashBigKey">-->
                        <!--briefly display and hide (flash) a large label with the name of the just pressed key-->

                        <!--<DoubleAnimation 
                                Storyboard.TargetName="AlfaKeyboard"  
                                Storyboard.TargetProperty="Opacity" 
                                 From="1"  
                                 To="0"  
                                 Duration="0:0:0.2"  
                                 />  
                                <DoubleAnimation
                                Storyboard.TargetName="AlfaKeyboard"  
                                Storyboard.TargetProperty="Opacity" 
                                 From="0"  
                                 To="1"  
                                 Duration="0:0:0.2"  
                         />-->
                <!--</Storyboard>-->
                <Style x:Key="buttonBorder" TargetType="Border" >
                        <Setter Property="Button.Effect" Value="{StaticResource DropShadowEffect}"/>
                        <Setter Property="Margin" Value="4"/>
                </Style>
                
                <Style TargetType="Button">
                        <!--<Setter Property="ClickMode" Value="Press"/>-->
                        <Setter Property="Margin" Value="4"/>
                        <!--<Setter Property="Button.Effect" Value="{StaticResource DropShadowEffect}"/>-->
                        <Setter Property="FontSize" Value="24"/>
                </Style>
        </Window.Resources>

   

        <Grid Background="{DynamicResource IPhoneSteelBackground}">
                <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                        <RowDefinition />
                        <RowDefinition />
                        <RowDefinition />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition />
                        <ColumnDefinition />
                        <ColumnDefinition />
                </Grid.ColumnDefinitions>
                   
                <Grid  Grid.Row="1">
                <Border  Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" />
                <Button Name="button5" Background="WhiteSmoke" BorderThickness="1"
                                 CommandParameter="NUMPAD7" Click="button_Click">7</Button>
                </Grid>
                <Grid Grid.Column="1" Grid.Row="1">
                        <Border  Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" />
                        <Button x:Name="button6" Background="WhiteSmoke"
                                 CommandParameter="NUMPAD8" Click="button_Click" BorderThickness="1" Content="8" />
                </Grid>
                <Grid Grid.Column="2" Grid.Row="1">
                        <Border  Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" />
                        <Button x:Name="button7" Background="WhiteSmoke"
                                CommandParameter="NUMPAD9" Click="button_Click" Content="9" />
                </Grid>
                <Grid Grid.Column="3" Grid.Row="1">
                        <Border  Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" />
                        <Button x:Name="button8" CommandParameter="BACK" Click="button_Click">
                                <Path Stretch="Fill" Width="36" Height="24" Data="F1M555.0371,274.4893L552.7871,276.7383L549.9861,273.9373L547.1991,276.7243L545.1131,274.6393L547.9001,271.8523L545.0101,268.9603L547.2601,266.7113L550.1501,269.6023L552.8921,266.8613L554.9761,268.9463L552.2361,271.6883z M555.3751,264.0003L544.8751,264.0003C543.1251,264.1253,535.0001,270.7503,535.0001,272.2503C535.0001,273.7503,543.1251,279.3753,544.8751,279.5003L555.3751,279.5003C558.8751,279.5003,559.3751,277.7093,559.3751,275.5003L559.3751,268.0003C559.3751,265.7913,558.7501,264.0003,555.3751,264.0003" Fill="#FF333333"/>
                        </Button>
                </Grid>
                <Grid Grid.Row="2">
                        <Border  Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" />
                        <Button x:Name="button9" Background="WhiteSmoke"
                                CommandParameter="NUMPAD4" Click="button_Click" Content="4"/>
                </Grid>
                <Grid Grid.Column="1" Grid.Row="2">
                        <Border  Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" />
                        <Button x:Name="button10" Background="WhiteSmoke"
                                CommandParameter="NUMPAD5" Click="button_Click" Content="5" />
                </Grid>
                <Grid Grid.Column="2" Grid.Row="2">
                        <Border  Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" />
                        <Button x:Name="button11" Background="WhiteSmoke"
                                CommandParameter="NUMPAD6" Click="button_Click" Content="6" />
                </Grid>
                <Grid Grid.Row="3">
                        <Border  Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" />
                        <Button x:Name="button13" Background="WhiteSmoke"
                                CommandParameter="NUMPAD1" Click="button_Click" Content="1"/>
                </Grid>
                <Grid Grid.Column="1" Grid.Row="3">
                        <Border  Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" />
                        <Button x:Name="button14" Background="WhiteSmoke"
                                CommandParameter="NUMPAD2" Click="button_Click" Content="2"/>
                </Grid>
                <Grid Grid.Column="2" Grid.Row="3">
                        <Border  Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" />
                        <Button x:Name="button15" Background="WhiteSmoke"
                                CommandParameter="NUMPAD3" Click="button_Click" Content="3" />
                </Grid>
                <Grid Grid.Column="3" Grid.Row="2" Grid.RowSpan="3">
                        <Border  Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" />
                        <Button  x:Name="button16"
                                CommandParameter="RETURN" Click="button_Click" Content="Enter"/>
                </Grid>
                <Grid Grid.ColumnSpan="2" Grid.Row="4">
                        <Border  Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" />
                        <Button x:Name="button17" Background="WhiteSmoke"
                                CommandParameter="NUMPAD0" Click="button_Click" Content="0" />
                </Grid>
                <Grid x:Name="gDecimal" Grid.Column="2" Grid.Row="4">
                        <Border  Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" />
                        <Button x:Name="button19" Background="WhiteSmoke"
                                CommandParameter="DECIMAL"      Click="button_Click" Content="," />
                </Grid>
                <Grid Grid.ColumnSpan="3">
                        <Border  Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="0" >
                <!--<TextBox x:Name="textBox" HorizontalAlignment="Left" Height="49" Text="{Binding Result}" VerticalAlignment="Top" Width="212" AllowDrop="False" IsUndoEnabled="False" IsReadOnly="True"/>-->
            </Border>
            <Label  Content="{Binding Result}" HorizontalContentAlignment="Right" Background="WhiteSmoke" Margin="4" Visibility="Hidden"/>
            <TextBox x:Name="textBox" HorizontalAlignment="Left" Height="49" Margin="4,4,0,0" Text="{Binding Result}" VerticalAlignment="Top" Width="212" FontSize="24" MaxLines="1" KeyDown="OnKeyDown" TextChanged="OnTextChanged"/>

        </Grid>
                <Grid Grid.Column="3" >
                        <Border  Style="{StaticResource buttonBorder}" Background="Black" CornerRadius="4" />
                        <Button x:Name="buttonClear" Grid.Row="0" 
                                CommandParameter="Clear" Click="button_Click" Content="C"/>
                        <!--<Button x:Name="buttonEsc" Grid.Row="0" 
                                Command="{Binding PressAndRelease}" CommandParameter="ESC" Click="button_Click" Content="Esc"/>-->
                </Grid>

        </Grid>
</Window>