mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 22:23:29 -07:00
Add decimal button on NumPad for all platform
This commit is contained in:
parent
e9e86a559b
commit
ba179a4004
7 changed files with 969 additions and 943 deletions
|
@ -480,6 +480,15 @@
|
|||
Value="{StaticResource CalcOperatorCaptionSize}" />
|
||||
</Style>
|
||||
|
||||
<Style x:Key="DecimalButtonStyle"
|
||||
BasedOn="{StaticResource OperatorButtonStyle}"
|
||||
TargetType="Controls:CalculatorButton">
|
||||
<Setter Property="FontWeight"
|
||||
Value="Bold" />
|
||||
<Setter Property="FontSize"
|
||||
Value="24" />
|
||||
</Style>
|
||||
|
||||
<Style x:Key="SymbolOperatorButtonStyle"
|
||||
BasedOn="{StaticResource OperatorButtonStyle}"
|
||||
TargetType="Controls:CalculatorButton">
|
||||
|
|
|
@ -424,7 +424,8 @@
|
|||
Grid.RowSpan="4"
|
||||
Grid.Column="2"
|
||||
Grid.ColumnSpan="3"
|
||||
ButtonStyle="{StaticResource NumericButtonStyle18}" />
|
||||
ButtonStyle="{StaticResource NumericButtonStyle18}"
|
||||
DecimalButtonStyle="{StaticResource DecimalButtonStyle}" />
|
||||
|
||||
<controls:CalculatorButton x:Name="aButton"
|
||||
x:Uid="aButton"
|
||||
|
|
|
@ -1034,6 +1034,7 @@
|
|||
Grid.Column="6"
|
||||
Grid.ColumnSpan="3"
|
||||
AutomationProperties.HeadingLevel="Level1"
|
||||
ButtonStyle="{StaticResource NumericButtonStyle24}" />
|
||||
ButtonStyle="{StaticResource NumericButtonStyle24}"
|
||||
DecimalButtonStyle="{StaticResource DecimalButtonStyle}" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
|
|
@ -605,7 +605,8 @@
|
|||
Grid.Column="2"
|
||||
Grid.ColumnSpan="3"
|
||||
AutomationProperties.HeadingLevel="Level1"
|
||||
ButtonStyle="{StaticResource NumericButtonStyle24}" />
|
||||
ButtonStyle="{StaticResource NumericButtonStyle24}"
|
||||
DecimalButtonStyle="{StaticResource DecimalButtonStyle}" />
|
||||
|
||||
<controls:CalculatorButton x:Name="negateButton"
|
||||
x:Uid="negateButton"
|
||||
|
|
|
@ -118,10 +118,9 @@
|
|||
-->
|
||||
<controls:CalculatorButton x:Name="decimalSeparatorButton"
|
||||
x:Uid="decimalSeparatorButton"
|
||||
Grid.Row="4"
|
||||
Grid.Row="3"
|
||||
Grid.Column="2"
|
||||
Style="{Binding ElementName=ControlRoot, Path=ButtonStyle}"
|
||||
Background="{ThemeResource AppBackgroundAltMediumLowBrush}"
|
||||
Style="{x:Bind Path=DecimalButtonStyle, Mode=OneWay}"
|
||||
AutomationProperties.AutomationId="decimalSeparatorButton"
|
||||
ButtonId="Decimal"
|
||||
IsEnabled="{Binding IsDecimalEnabled}" />
|
||||
|
|
|
@ -22,6 +22,7 @@ namespace CalculatorApp
|
|||
{
|
||||
public sealed partial class NumberPad : UserControl
|
||||
{
|
||||
#region ButtonStyle
|
||||
public Style ButtonStyle
|
||||
{
|
||||
get { return (Style)GetValue(ButtonStyleProperty); }
|
||||
|
@ -30,7 +31,20 @@ namespace CalculatorApp
|
|||
|
||||
// Using a DependencyProperty as the backing store for ButtonStyle. This enables animation, styling, binding, etc...
|
||||
public static readonly DependencyProperty ButtonStyleProperty =
|
||||
DependencyProperty.Register("ButtonStyle", typeof(Style), typeof(NumberPad), new PropertyMetadata(null));
|
||||
DependencyProperty.Register(nameof(ButtonStyle), typeof(Style), typeof(NumberPad), new PropertyMetadata(null));
|
||||
#endregion
|
||||
|
||||
#region DecimalButtonStyle
|
||||
public Style DecimalButtonStyle
|
||||
{
|
||||
get { return (Style)GetValue(DecimalButtonStyleProperty); }
|
||||
set { SetValue(DecimalButtonStyleProperty, value); }
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty DecimalButtonStyleProperty =
|
||||
DependencyProperty.Register(nameof(DecimalButtonStyle), typeof(Style), typeof(NumberPad), new PropertyMetadata(null));
|
||||
#endregion
|
||||
|
||||
private bool m_isErrorVisualState;
|
||||
|
||||
public NumberPad()
|
||||
|
|
|
@ -857,6 +857,7 @@
|
|||
VerticalAlignment="Stretch"
|
||||
AutomationProperties.HeadingLevel="Level1"
|
||||
ButtonStyle="{StaticResource NumericButtonStyle24}"
|
||||
DecimalButtonStyle="{StaticResource DecimalButtonStyle}"
|
||||
TabIndex="10"
|
||||
TabNavigation="Local"/>
|
||||
<controls:CalculatorButton x:Name="ConverterNegateButton"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue