mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 06:13:14 -07:00
Merge 022c4ed9c3
into d974d16b9f
This commit is contained in:
commit
0e3e5b67aa
3 changed files with 24 additions and 14 deletions
|
@ -2,6 +2,7 @@
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
using CalculatorApp.ViewModel.Common;
|
using CalculatorApp.ViewModel.Common;
|
||||||
|
using Windows.UI.Xaml;
|
||||||
|
|
||||||
namespace CalculatorApp
|
namespace CalculatorApp
|
||||||
{
|
{
|
||||||
|
@ -17,6 +18,15 @@ namespace CalculatorApp
|
||||||
string radixContent = Content?.ToString();
|
string radixContent = Content?.ToString();
|
||||||
return LocalizationSettings.GetInstance().RemoveGroupSeparators(radixContent);
|
return LocalizationSettings.GetInstance().RemoveGroupSeparators(radixContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string Label
|
||||||
|
{
|
||||||
|
get => (string)GetValue(LabelProperty);
|
||||||
|
set => SetValue(LabelProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static readonly DependencyProperty LabelProperty =
|
||||||
|
DependencyProperty.Register(nameof(Label), typeof(string), typeof(RadixButton), new PropertyMetadata(default(string)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -145,19 +145,19 @@
|
||||||
<value>AppUpdate2</value>
|
<value>AppUpdate2</value>
|
||||||
<comment>{Locked}This will Update Resources.pri File, Resource is not used in the app</comment>
|
<comment>{Locked}This will Update Resources.pri File, Resource is not used in the app</comment>
|
||||||
</data>
|
</data>
|
||||||
<data name="decimalButton.Tag" xml:space="preserve">
|
<data name="decimalButton.Label" xml:space="preserve">
|
||||||
<value>DEC</value>
|
<value>DEC</value>
|
||||||
<comment>{Locked}The Decimal button</comment>
|
<comment>{Locked}The Decimal button</comment>
|
||||||
</data>
|
</data>
|
||||||
<data name="binaryButton.Tag" xml:space="preserve">
|
<data name="binaryButton.Label" xml:space="preserve">
|
||||||
<value>BIN</value>
|
<value>BIN</value>
|
||||||
<comment>{Locked}The Binary button</comment>
|
<comment>{Locked}The Binary button</comment>
|
||||||
</data>
|
</data>
|
||||||
<data name="hexButton.Tag" xml:space="preserve">
|
<data name="hexButton.Label" xml:space="preserve">
|
||||||
<value>HEX</value>
|
<value>HEX</value>
|
||||||
<comment>{Locked}The Hex button</comment>
|
<comment>{Locked}The Hex button</comment>
|
||||||
</data>
|
</data>
|
||||||
<data name="octButton.Tag" xml:space="preserve">
|
<data name="octButton.Label" xml:space="preserve">
|
||||||
<value>OCT</value>
|
<value>OCT</value>
|
||||||
<comment>{Locked}The Oct button</comment>
|
<comment>{Locked}The Oct button</comment>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<!-- Programmer mode display radio button -->
|
<!-- Programmer mode display radio button -->
|
||||||
<Style x:Key="ProgModeRadioButtonStyle" TargetType="RadioButton">
|
<Style x:Key="ProgModeRadioButtonStyle" TargetType="controls:RadixButton">
|
||||||
<Setter Property="Foreground" Value="{ThemeResource TextFillColorPrimaryBrush}"/>
|
<Setter Property="Foreground" Value="{ThemeResource TextFillColorPrimaryBrush}"/>
|
||||||
<Setter Property="MinHeight" Value="12"/>
|
<Setter Property="MinHeight" Value="12"/>
|
||||||
<Setter Property="MinWidth" Value="280"/>
|
<Setter Property="MinWidth" Value="280"/>
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
<Setter Property="FocusVisualMargin" Value="-3"/>
|
<Setter Property="FocusVisualMargin" Value="-3"/>
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
<ControlTemplate TargetType="RadioButton">
|
<ControlTemplate TargetType="controls:RadixButton">
|
||||||
<Grid x:Name="ControlRoot"
|
<Grid x:Name="ControlRoot"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
Background="{ThemeResource SubtleFillColorTransparentBrush}"
|
Background="{ThemeResource SubtleFillColorTransparentBrush}"
|
||||||
|
@ -106,7 +106,7 @@
|
||||||
FontWeight="{TemplateBinding FontWeight}"
|
FontWeight="{TemplateBinding FontWeight}"
|
||||||
AutomationProperties.AccessibilityView="Raw"
|
AutomationProperties.AccessibilityView="Raw"
|
||||||
IsTextScaleFactorEnabled="{TemplateBinding IsTextScaleFactorEnabled}"
|
IsTextScaleFactorEnabled="{TemplateBinding IsTextScaleFactorEnabled}"
|
||||||
Text="{TemplateBinding Tag}"/>
|
Text="{TemplateBinding Label}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid x:Name="CheckedStatesGrid"
|
<Grid x:Name="CheckedStatesGrid"
|
||||||
Background="{ThemeResource SystemControlHighlightTransparentBrush}"
|
Background="{ThemeResource SystemControlHighlightTransparentBrush}"
|
||||||
|
@ -149,7 +149,7 @@
|
||||||
FontWeight="{TemplateBinding FontWeight}"
|
FontWeight="{TemplateBinding FontWeight}"
|
||||||
AutomationProperties.AccessibilityView="Raw"
|
AutomationProperties.AccessibilityView="Raw"
|
||||||
IsTextScaleFactorEnabled="{TemplateBinding IsTextScaleFactorEnabled}"
|
IsTextScaleFactorEnabled="{TemplateBinding IsTextScaleFactorEnabled}"
|
||||||
Text="{TemplateBinding Tag}"/>
|
Text="{TemplateBinding Label}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
|
@ -158,10 +158,10 @@
|
||||||
</Style>
|
</Style>
|
||||||
<contract7NotPresent:Style x:Key="ConditionalProgModeRadioButtonStyle"
|
<contract7NotPresent:Style x:Key="ConditionalProgModeRadioButtonStyle"
|
||||||
BasedOn="{StaticResource ProgModeRadioButtonStyle}"
|
BasedOn="{StaticResource ProgModeRadioButtonStyle}"
|
||||||
TargetType="RadioButton"/>
|
TargetType="controls:RadixButton"/>
|
||||||
<contract7Present:Style x:Key="ConditionalProgModeRadioButtonStyle"
|
<contract7Present:Style x:Key="ConditionalProgModeRadioButtonStyle"
|
||||||
BasedOn="{StaticResource ProgModeRadioButtonStyle}"
|
BasedOn="{StaticResource ProgModeRadioButtonStyle}"
|
||||||
TargetType="RadioButton">
|
TargetType="controls:RadixButton">
|
||||||
<Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}"/>
|
<Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}"/>
|
||||||
</contract7Present:Style>
|
</contract7Present:Style>
|
||||||
|
|
||||||
|
@ -214,7 +214,7 @@
|
||||||
Content="{x:Bind Model.HexDisplayValue, Mode=OneWay}"
|
Content="{x:Bind Model.HexDisplayValue, Mode=OneWay}"
|
||||||
ContextFlyout="{StaticResource ProgrammerOperatorsContextMenu}"
|
ContextFlyout="{StaticResource ProgrammerOperatorsContextMenu}"
|
||||||
GroupName="BaseConversion"
|
GroupName="BaseConversion"
|
||||||
Tag="{utils:ResourceString Name=hexButton/Tag}"/>
|
Label="{utils:ResourceString Name=hexButton/Label}"/>
|
||||||
<controls:RadixButton x:Name="DecimalButton"
|
<controls:RadixButton x:Name="DecimalButton"
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
|
@ -227,7 +227,7 @@
|
||||||
ContextFlyout="{StaticResource ProgrammerOperatorsContextMenu}"
|
ContextFlyout="{StaticResource ProgrammerOperatorsContextMenu}"
|
||||||
GroupName="BaseConversion"
|
GroupName="BaseConversion"
|
||||||
IsChecked="true"
|
IsChecked="true"
|
||||||
Tag="{utils:ResourceString Name=decimalButton/Tag}"/>
|
Label="{utils:ResourceString Name=decimalButton/Label}"/>
|
||||||
<controls:RadixButton x:Name="OctButton"
|
<controls:RadixButton x:Name="OctButton"
|
||||||
Grid.Row="2"
|
Grid.Row="2"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
|
@ -239,7 +239,7 @@
|
||||||
Content="{x:Bind Model.OctalDisplayValue, Mode=OneWay}"
|
Content="{x:Bind Model.OctalDisplayValue, Mode=OneWay}"
|
||||||
ContextFlyout="{StaticResource ProgrammerOperatorsContextMenu}"
|
ContextFlyout="{StaticResource ProgrammerOperatorsContextMenu}"
|
||||||
GroupName="BaseConversion"
|
GroupName="BaseConversion"
|
||||||
Tag="{utils:ResourceString Name=octButton/Tag}"/>
|
Label="{utils:ResourceString Name=octButton/Label}"/>
|
||||||
<controls:RadixButton x:Name="BinaryButton"
|
<controls:RadixButton x:Name="BinaryButton"
|
||||||
Grid.Row="3"
|
Grid.Row="3"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
|
@ -251,6 +251,6 @@
|
||||||
Content="{x:Bind Model.BinaryDisplayValue, Mode=OneWay}"
|
Content="{x:Bind Model.BinaryDisplayValue, Mode=OneWay}"
|
||||||
ContextFlyout="{StaticResource ProgrammerOperatorsContextMenu}"
|
ContextFlyout="{StaticResource ProgrammerOperatorsContextMenu}"
|
||||||
GroupName="BaseConversion"
|
GroupName="BaseConversion"
|
||||||
Tag="{utils:ResourceString Name=binaryButton/Tag}"/>
|
Label="{utils:ResourceString Name=binaryButton/Label}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue