Newer
Older
Correlator / Correlator / Dialog / NumericKeypadDialog.xaml
<UserControl
    x:Class="Correlator.Dialog.NumericKeypadDialog"
    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:hc="https://handyorg.github.io/handycontrol"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:prism="http://prismlibrary.com/"
    xmlns:vm="clr-namespace:Correlator.ViewModels"
    Width="360"
    Height="435"
    d:DataContext="{d:DesignInstance Type=vm:NumericKeypadDialogViewModel}"
    mc:Ignorable="d">

    <prism:Dialog.WindowStyle>
        <Style TargetType="Window">
            <Setter Property="prism:Dialog.WindowStartupLocation" Value="CenterOwner" />
            <Setter Property="ShowInTaskbar" Value="False" />
            <Setter Property="SizeToContent" Value="WidthAndHeight" />
            <Setter Property="ResizeMode" Value="NoResize" />
        </Style>
    </prism:Dialog.WindowStyle>

    <UserControl.Resources>
        <Style
            x:Key="RadioButtonStyle"
            BasedOn="{StaticResource RadioButtonBaseStyle}"
            TargetType="RadioButton">
            <Setter Property="Foreground" Value="Black" />
            <Setter Property="FontSize" Value="18" />
        </Style>

        <Style
            x:Key="NumberButtonStyle"
            BasedOn="{StaticResource ButtonDefault}"
            TargetType="Button">
            <Setter Property="Foreground" Value="Black" />
            <Setter Property="FontSize" Value="22" />
            <Setter Property="Height" Value="55" />
            <Setter Property="Width" Value="85" />
        </Style>
    </UserControl.Resources>

    <StackPanel Orientation="Vertical">
        <UniformGrid
            Height="55"
            Margin="10,0"
            Columns="4">
            <RadioButton
                x:Name="PipeDiameterRadioButton"
                Content="管径"
                GroupName="PipeParam"
                Style="{StaticResource RadioButtonStyle}" />
            <RadioButton
                x:Name="PipeLengthRadioButton"
                Content="管长"
                GroupName="PipeParam"
                Style="{StaticResource RadioButtonStyle}" />
            <RadioButton
                x:Name="MinFrequencyRadioButton"
                Content="低频"
                GroupName="PipeParam"
                Style="{StaticResource RadioButtonStyle}" />
            <RadioButton
                x:Name="MaxFrequencyRadioButton"
                Content="高频"
                GroupName="PipeParam"
                Style="{StaticResource RadioButtonStyle}" />
        </UniformGrid>

        <hc:TextBox
            Height="55"
            Margin="22,0,22,10"
            HorizontalContentAlignment="Right"
            FontSize="22"
            Foreground="Black"
            IsEnabled="False"
            Text="{Binding InputNumber}" />

        <UniformGrid
            Height="300"
            Margin="10,0,10,10"
            Columns="3"
            Rows="4">
            <Button
                Command="{Binding NumberSevenCommand}"
                CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Content}"
                Content="7"
                Style="{StaticResource NumberButtonStyle}" />
            <Button
                Command="{Binding NumberEightCommand}"
                CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Content}"
                Content="8"
                Style="{StaticResource NumberButtonStyle}" />
            <Button
                Command="{Binding NumberNineCommand}"
                CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Content}"
                Content="9"
                Style="{StaticResource NumberButtonStyle}" />
            <Button
                Command="{Binding NumberFourCommand}"
                CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Content}"
                Content="4"
                Style="{StaticResource NumberButtonStyle}" />
            <Button
                Command="{Binding NumberFiveCommand}"
                CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Content}"
                Content="5"
                Style="{StaticResource NumberButtonStyle}" />
            <Button
                Command="{Binding NumberSixCommand}"
                CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Content}"
                Content="6"
                Style="{StaticResource NumberButtonStyle}" />
            <Button
                Command="{Binding NumberOneCommand}"
                CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Content}"
                Content="1"
                Style="{StaticResource NumberButtonStyle}" />
            <Button
                Command="{Binding NumberTwoCommand}"
                CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Content}"
                Content="2"
                Style="{StaticResource NumberButtonStyle}" />
            <Button
                Command="{Binding NumberThreeCommand}"
                CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Content}"
                Content="3"
                Style="{StaticResource NumberButtonStyle}" />
            <Button
                Width="85"
                Height="55"
                Command="{Binding DeleteNumberCommand}"
                Content="删除"
                FontSize="18"
                Style="{StaticResource ButtonDanger}" />
            <Button
                Command="{Binding NumberZeroCommand}"
                CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Content}"
                Content="0"
                Style="{StaticResource NumberButtonStyle}" />
            <Button
                Width="85"
                Height="55"
                Command="{Binding DetermineCommand}"
                Content="确定"
                FontSize="18"
                Style="{StaticResource FunctionButtonStyle}" />
        </UniformGrid>
    </StackPanel>
</UserControl>