|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402 |
- <UserControl
- x:Class="BPASmartClient.CustomResource.UserControls.UserKeyBoard"
- 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:local="clr-namespace:BPASmartClient.CustomResource.UserControls"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- x:Name="Keyboard"
- d:DesignHeight="180"
- d:DesignWidth="500"
- Background="Transparent"
- mc:Ignorable="d">
- <UserControl.Resources>
- <Style x:Key="btnNum" TargetType="{x:Type Button}">
- <Setter Property="Cursor" Value="Hand" />
- <Setter Property="HorizontalContentAlignment" Value="Center" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Button}">
- <Border
- x:Name="border"
- BorderBrush="#FF474747"
- BorderThickness="1"
- CornerRadius="6">
- <Border.Background>
- <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
- <GradientStop Color="#002A5F" />
- <GradientStop Offset="1" Color="#6495ED" />
- </LinearGradientBrush>
- </Border.Background>
- <ContentPresenter
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- TextElement.FontSize="16"
- TextElement.Foreground="#4fade8" />
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsPressed" Value="True">
- <Setter TargetName="border" Property="Background">
- <Setter.Value>
- <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
- <GradientStop Color="#FFFF7500" />
- <GradientStop Offset="1" Color="#FFFFC547" />
- </LinearGradientBrush>
- </Setter.Value>
- </Setter>
- </Trigger>
- <Trigger Property="IsPressed" Value="False">
- <Setter TargetName="border" Property="Background">
- <Setter.Value>
- <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
- <GradientStop Color="#002A5F" />
- <GradientStop Offset="1" Color="#6495ED" />
- </LinearGradientBrush>
- </Setter.Value>
- </Setter>
- </Trigger>
-
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="btnFunc" TargetType="{x:Type Button}">
- <Setter Property="Cursor" Value="Hand" />
- <Setter Property="HorizontalContentAlignment" Value="Center" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <!--<Setter Property="Padding" Value="1"/>-->
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Button}">
- <Border
- x:Name="border"
- BorderBrush="#FF565656"
- BorderThickness="1"
- CornerRadius="6">
- <Border.Background>
- <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
- <GradientStop Color="#002A5F" />
- <GradientStop Offset="1" Color="#6495ED" />
- </LinearGradientBrush>
- </Border.Background>
- <ContentPresenter
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- TextElement.FontSize="18"
- TextElement.Foreground="White" />
-
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsPressed" Value="True">
- <Setter TargetName="border" Property="Background">
- <Setter.Value>
- <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
- <GradientStop Offset="1" Color="Gray" />
- <GradientStop Offset="0" Color="#FF2D2D2D" />
- </LinearGradientBrush>
- </Setter.Value>
- </Setter>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </UserControl.Resources>
- <UserControl.Triggers>
- <EventTrigger RoutedEvent="UserControl.Loaded" SourceName="Keyboard">
- <BeginStoryboard>
- <Storyboard>
- <DoubleAnimation
- Storyboard.TargetName="Keyboard"
- Storyboard.TargetProperty="Opacity"
- From="0"
- To="1"
- Duration="0:0:0.2" />
- </Storyboard>
- </BeginStoryboard>
- </EventTrigger>
- </UserControl.Triggers>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="10" />
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="10" />
- </Grid.ColumnDefinitions>
- <Grid
- x:Name="ButtonGrid"
- Grid.Row="1"
- Grid.Column="1"
- ButtonBase.Click="ButtonGrid_Click">
- <Grid.RowDefinitions>
- <RowDefinition Height="80*" />
- <RowDefinition Height="80*" />
- <RowDefinition Height="80*" />
- <RowDefinition Height="80*" />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="120*" />
- <ColumnDefinition Width="120*" />
- <ColumnDefinition Width="120*" />
- <ColumnDefinition Width="120*" />
- <ColumnDefinition Width="120*" />
- <ColumnDefinition Width="120*" />
- <ColumnDefinition Width="120*" />
- <ColumnDefinition Width="120*" />
- <ColumnDefinition Width="120*" />
- <ColumnDefinition Width="120*" />
- </Grid.ColumnDefinitions>
- <Button
- Grid.Row="0"
- Grid.Column="0"
- Margin="2"
- Content="1"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="0"
- Grid.Column="1"
- Margin="2"
- Content="2"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="0"
- Grid.Column="2"
- Margin="2"
- Content="3"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="0"
- Grid.Column="3"
- Margin="2"
- Content="4"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="0"
- Grid.Column="4"
- Margin="2"
- Content="5"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="0"
- Grid.Column="5"
- Margin="2"
- Content="6"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="0"
- Grid.Column="6"
- Margin="2"
- Content="7"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="0"
- Grid.Column="7"
- Margin="2"
- Content="8"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="0"
- Grid.Column="8"
- Margin="2"
- Content="9"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="0"
- Grid.Column="9"
- Margin="2"
- Content="0"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="1"
- Grid.Column="0"
- Margin="2"
- Content="Q"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="1"
- Grid.Column="1"
- Margin="2"
- Content="W"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="1"
- Grid.Column="2"
- Margin="2"
- Content="E"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="1"
- Grid.Column="3"
- Margin="2"
- Content="R"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="1"
- Grid.Column="4"
- Margin="2"
- Content="T"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="1"
- Grid.Column="5"
- Margin="2"
- Content="Y"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="1"
- Grid.Column="6"
- Margin="2"
- Content="U"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="1"
- Grid.Column="7"
- Margin="2"
- Content="I"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="1"
- Grid.Column="8"
- Margin="2"
- Content="O"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="1"
- Grid.Column="9"
- Margin="2"
- Content="P"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="2"
- Grid.Column="0"
- Margin="2"
- Content="A"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="2"
- Grid.Column="1"
- Margin="2"
- Content="S"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="2"
- Grid.Column="2"
- Margin="2"
- Content="D"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="2"
- Grid.Column="3"
- Margin="2"
- Content="F"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="2"
- Grid.Column="4"
- Margin="2"
- Content="G"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="2"
- Grid.Column="5"
- Margin="2"
- Content="H"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="2"
- Grid.Column="6"
- Margin="2"
- Content="J"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="2"
- Grid.Column="7"
- Margin="2"
- Content="K"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="2"
- Grid.Column="8"
- Margin="2"
- Content="L"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="3"
- Grid.Column="0"
- Margin="2"
- Content="Z"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="3"
- Grid.Column="1"
- Margin="2"
- Content="X"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="3"
- Grid.Column="2"
- Margin="2"
- Content="C"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="3"
- Grid.Column="3"
- Margin="2"
- Content="V"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="3"
- Grid.Column="4"
- Margin="2"
- Content="B"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="3"
- Grid.Column="5"
- Margin="2"
- Content="N"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="3"
- Grid.Column="6"
- Margin="2"
- Content="M"
- Style="{StaticResource btnNum}" />
- <Button
- Grid.Row="2"
- Grid.Column="9"
- Margin="2"
- Content="A/a"
- Style="{StaticResource btnFunc}" />
- <Button
- Grid.Row="3"
- Grid.Column="7"
- Margin="2"
- Content="DEL"
- Style="{StaticResource btnFunc}" />
- <Button
- Grid.Row="3"
- Grid.Column="8"
- Margin="2"
- Content="AC"
- Style="{StaticResource btnFunc}" />
- <Button
- Grid.Row="3"
- Grid.Column="9"
- Margin="2"
- Content="确认"
- Style="{StaticResource btnFunc}" />
-
- </Grid>
- </Grid>
- </Grid>
- </UserControl>
|