mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 22:23:29 -07:00
Merge pull request #73 from nventive/dev/yogu/currency.fix.missing.issues
Add decimal button on NumPad for all platform + Add workaround for WASM Currency API calls
This commit is contained in:
commit
8b449d6a15
8 changed files with 976 additions and 960 deletions
|
@ -17,8 +17,8 @@ namespace CalculatorApp.DataLoaders
|
||||||
string m_responseLanguage;
|
string m_responseLanguage;
|
||||||
string m_sourceCurrencyCode;
|
string m_sourceCurrencyCode;
|
||||||
|
|
||||||
static string sc_MetadataUriLocalizeFor = "https://go.microsoft.com/fwlink/?linkid=2041093&localizeFor=";
|
static string sc_MetadataUriLocalizeFor = "https://cors-anywhere.herokuapp.com/https://go.microsoft.com/fwlink/?linkid=2041093&localizeFor=";
|
||||||
static string sc_RatiosUriRelativeTo = "https://go.microsoft.com/fwlink/?linkid=2041339&localCurrency=";
|
static string sc_RatiosUriRelativeTo = "https://cors-anywhere.herokuapp.com/https://go.microsoft.com/fwlink/?linkid=2041339&localCurrency=";
|
||||||
|
|
||||||
public CurrencyHttpClient()
|
public CurrencyHttpClient()
|
||||||
{
|
{
|
||||||
|
@ -26,30 +26,20 @@ namespace CalculatorApp.DataLoaders
|
||||||
m_responseLanguage = "en-US";
|
m_responseLanguage = "en-US";
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetSourceCurrencyCode(String sourceCurrencyCode)
|
public void SetSourceCurrencyCode(string sourceCurrencyCode)
|
||||||
{
|
{
|
||||||
m_sourceCurrencyCode = sourceCurrencyCode;
|
m_sourceCurrencyCode = sourceCurrencyCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetResponseLanguage(String responseLanguage)
|
public void SetResponseLanguage(string responseLanguage)
|
||||||
{
|
{
|
||||||
m_responseLanguage = responseLanguage;
|
m_responseLanguage = responseLanguage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task<String> GetCurrencyMetadata()
|
public async Task<string> GetCurrencyMetadata() => await ExecuteRequestAsync(sc_MetadataUriLocalizeFor + m_responseLanguage);
|
||||||
{
|
|
||||||
string uri = sc_MetadataUriLocalizeFor + m_responseLanguage;
|
|
||||||
var metadataUri = new Uri(uri);
|
|
||||||
|
|
||||||
return m_client.GetStringAsync(metadataUri);
|
public async Task<string> GetCurrencyRatios() => await ExecuteRequestAsync(sc_RatiosUriRelativeTo + m_sourceCurrencyCode);
|
||||||
}
|
|
||||||
|
|
||||||
public Task<String> GetCurrencyRatios()
|
private async Task<string> ExecuteRequestAsync(string url) => await m_client.GetStringAsync(new Uri(url));
|
||||||
{
|
|
||||||
string uri = sc_RatiosUriRelativeTo + m_sourceCurrencyCode;
|
|
||||||
var ratiosUri = new Uri(uri);
|
|
||||||
|
|
||||||
return m_client.GetStringAsync(ratiosUri);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -480,6 +480,15 @@
|
||||||
Value="{StaticResource CalcOperatorCaptionSize}" />
|
Value="{StaticResource CalcOperatorCaptionSize}" />
|
||||||
</Style>
|
</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"
|
<Style x:Key="SymbolOperatorButtonStyle"
|
||||||
BasedOn="{StaticResource OperatorButtonStyle}"
|
BasedOn="{StaticResource OperatorButtonStyle}"
|
||||||
TargetType="Controls:CalculatorButton">
|
TargetType="Controls:CalculatorButton">
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
<UserControl x:Class="CalculatorApp.CalculatorProgrammerRadixOperators"
|
<UserControl x:Class="CalculatorApp.CalculatorProgrammerRadixOperators"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:common="using:CalculatorApp.Common"
|
xmlns:common="using:CalculatorApp.Common"
|
||||||
xmlns:controls="using:CalculatorApp.Controls"
|
xmlns:controls="using:CalculatorApp.Controls"
|
||||||
xmlns:local="using:CalculatorApp"
|
xmlns:local="using:CalculatorApp"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
x:Name="ControlRoot"
|
x:Name="ControlRoot"
|
||||||
Loaded="OnLoaded"
|
Loaded="OnLoaded"
|
||||||
mc:Ignorable="">
|
mc:Ignorable="">
|
||||||
|
|
||||||
<Grid x:Name="ProgRadixOps">
|
<Grid x:Name="ProgRadixOps">
|
||||||
|
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="1*" />
|
<RowDefinition Height="1*" />
|
||||||
<RowDefinition Height="1*" />
|
<RowDefinition Height="1*" />
|
||||||
|
@ -19,24 +19,24 @@
|
||||||
<RowDefinition Height="1*" />
|
<RowDefinition Height="1*" />
|
||||||
<RowDefinition Height="1*" />
|
<RowDefinition Height="1*" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition x:Name="GutterLeft"
|
<ColumnDefinition x:Name="GutterLeft"
|
||||||
Width="0" />
|
Width="0" />
|
||||||
<ColumnDefinition x:Name="C0"
|
<ColumnDefinition x:Name="C0"
|
||||||
Width="1*" />
|
Width="1*" />
|
||||||
<ColumnDefinition x:Name="C1"
|
<ColumnDefinition x:Name="C1"
|
||||||
Width="1*" />
|
Width="1*" />
|
||||||
<ColumnDefinition x:Name="C2"
|
<ColumnDefinition x:Name="C2"
|
||||||
Width="1*" />
|
Width="1*" />
|
||||||
<ColumnDefinition x:Name="C3"
|
<ColumnDefinition x:Name="C3"
|
||||||
Width="1*" />
|
Width="1*" />
|
||||||
<ColumnDefinition x:Name="C4"
|
<ColumnDefinition x:Name="C4"
|
||||||
Width="1*" />
|
Width="1*" />
|
||||||
<ColumnDefinition x:Name="C5"
|
<ColumnDefinition x:Name="C5"
|
||||||
Width="1*" />
|
Width="1*" />
|
||||||
<ColumnDefinition x:Name="GutterRight"
|
<ColumnDefinition x:Name="GutterRight"
|
||||||
Width="0" />
|
Width="0" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<VisualStateManager.VisualStateGroups>
|
<VisualStateManager.VisualStateGroups>
|
||||||
|
@ -45,148 +45,148 @@
|
||||||
<VisualState x:Name="ErrorLayout">
|
<VisualState x:Name="ErrorLayout">
|
||||||
<VisualState.Setters>
|
<VisualState.Setters>
|
||||||
<Setter Target="rolButton.IsEnabled"
|
<Setter Target="rolButton.IsEnabled"
|
||||||
Value="False" />
|
Value="False" />
|
||||||
<Setter Target="rorButton.IsEnabled"
|
<Setter Target="rorButton.IsEnabled"
|
||||||
Value="False" />
|
Value="False" />
|
||||||
<Setter Target="lshButton.IsEnabled"
|
<Setter Target="lshButton.IsEnabled"
|
||||||
Value="False" />
|
Value="False" />
|
||||||
<Setter Target="rshButton.IsEnabled"
|
<Setter Target="rshButton.IsEnabled"
|
||||||
Value="False" />
|
Value="False" />
|
||||||
<Setter Target="orButton.IsEnabled"
|
<Setter Target="orButton.IsEnabled"
|
||||||
Value="False" />
|
Value="False" />
|
||||||
<Setter Target="xorButton.IsEnabled"
|
<Setter Target="xorButton.IsEnabled"
|
||||||
Value="False" />
|
Value="False" />
|
||||||
<Setter Target="notButton.IsEnabled"
|
<Setter Target="notButton.IsEnabled"
|
||||||
Value="False" />
|
Value="False" />
|
||||||
<Setter Target="andButton.IsEnabled"
|
<Setter Target="andButton.IsEnabled"
|
||||||
Value="False" />
|
Value="False" />
|
||||||
|
|
||||||
<Setter Target="shiftButton.IsEnabled"
|
<Setter Target="shiftButton.IsEnabled"
|
||||||
Value="False" />
|
Value="False" />
|
||||||
<Setter Target="modButton.IsEnabled"
|
<Setter Target="modButton.IsEnabled"
|
||||||
Value="False" />
|
Value="False" />
|
||||||
|
|
||||||
<Setter Target="divideButton.IsEnabled"
|
<Setter Target="divideButton.IsEnabled"
|
||||||
Value="False" />
|
Value="False" />
|
||||||
<Setter Target="multiplyButton.IsEnabled"
|
<Setter Target="multiplyButton.IsEnabled"
|
||||||
Value="False" />
|
Value="False" />
|
||||||
<Setter Target="minusButton.IsEnabled"
|
<Setter Target="minusButton.IsEnabled"
|
||||||
Value="False" />
|
Value="False" />
|
||||||
<Setter Target="plusButton.IsEnabled"
|
<Setter Target="plusButton.IsEnabled"
|
||||||
Value="False" />
|
Value="False" />
|
||||||
|
|
||||||
<Setter Target="openParenthesisButton.IsEnabled"
|
<Setter Target="openParenthesisButton.IsEnabled"
|
||||||
Value="False" />
|
Value="False" />
|
||||||
<Setter Target="closeParenthesisButton.IsEnabled"
|
<Setter Target="closeParenthesisButton.IsEnabled"
|
||||||
Value="False" />
|
Value="False" />
|
||||||
<Setter Target="negateButton.IsEnabled"
|
<Setter Target="negateButton.IsEnabled"
|
||||||
Value="False" />
|
Value="False" />
|
||||||
</VisualState.Setters>
|
</VisualState.Setters>
|
||||||
</VisualState>
|
</VisualState>
|
||||||
</VisualStateGroup>
|
</VisualStateGroup>
|
||||||
|
|
||||||
<VisualStateGroup>
|
<VisualStateGroup>
|
||||||
<VisualState x:Name="Portrait768x1366">
|
<VisualState x:Name="Portrait768x1366">
|
||||||
<VisualState.StateTriggers>
|
<VisualState.StateTriggers>
|
||||||
<AdaptiveTrigger MinWindowHeight="1366"
|
<AdaptiveTrigger MinWindowHeight="1366"
|
||||||
MinWindowWidth="768" />
|
MinWindowWidth="768" />
|
||||||
</VisualState.StateTriggers>
|
</VisualState.StateTriggers>
|
||||||
|
|
||||||
<VisualState.Setters>
|
<VisualState.Setters>
|
||||||
<Setter Target="clearEntryButton.FontSize"
|
<Setter Target="clearEntryButton.FontSize"
|
||||||
Value="{StaticResource CalcOperatorCaptionSize}" />
|
Value="{StaticResource CalcOperatorCaptionSize}" />
|
||||||
<Setter Target="clearButton.FontSize"
|
<Setter Target="clearButton.FontSize"
|
||||||
Value="{StaticResource CalcOperatorCaptionSize}" />
|
Value="{StaticResource CalcOperatorCaptionSize}" />
|
||||||
<Setter Target="backSpaceButton.FontSize"
|
<Setter Target="backSpaceButton.FontSize"
|
||||||
Value="{StaticResource CalcOperatorCaptionSize}" />
|
Value="{StaticResource CalcOperatorCaptionSize}" />
|
||||||
<Setter Target="divideButton.FontSize"
|
<Setter Target="divideButton.FontSize"
|
||||||
Value="{StaticResource CalcOperatorCaptionSize}" />
|
Value="{StaticResource CalcOperatorCaptionSize}" />
|
||||||
<Setter Target="multiplyButton.FontSize"
|
<Setter Target="multiplyButton.FontSize"
|
||||||
Value="{StaticResource CalcOperatorCaptionSize}" />
|
Value="{StaticResource CalcOperatorCaptionSize}" />
|
||||||
<Setter Target="minusButton.FontSize"
|
<Setter Target="minusButton.FontSize"
|
||||||
Value="{StaticResource CalcOperatorCaptionSize}" />
|
Value="{StaticResource CalcOperatorCaptionSize}" />
|
||||||
<Setter Target="plusButton.FontSize"
|
<Setter Target="plusButton.FontSize"
|
||||||
Value="{StaticResource CalcOperatorCaptionSize}" />
|
Value="{StaticResource CalcOperatorCaptionSize}" />
|
||||||
<Setter Target="equalButton.FontSize"
|
<Setter Target="equalButton.FontSize"
|
||||||
Value="{StaticResource CalcOperatorCaptionSize}" />
|
Value="{StaticResource CalcOperatorCaptionSize}" />
|
||||||
|
|
||||||
<Setter Target="aButton.FontSize"
|
<Setter Target="aButton.FontSize"
|
||||||
Value="{StaticResource TitleFontSize}" />
|
Value="{StaticResource TitleFontSize}" />
|
||||||
<Setter Target="bButton.FontSize"
|
<Setter Target="bButton.FontSize"
|
||||||
Value="{StaticResource TitleFontSize}" />
|
Value="{StaticResource TitleFontSize}" />
|
||||||
<Setter Target="cButton.FontSize"
|
<Setter Target="cButton.FontSize"
|
||||||
Value="{StaticResource TitleFontSize}" />
|
Value="{StaticResource TitleFontSize}" />
|
||||||
<Setter Target="dButton.FontSize"
|
<Setter Target="dButton.FontSize"
|
||||||
Value="{StaticResource TitleFontSize}" />
|
Value="{StaticResource TitleFontSize}" />
|
||||||
<Setter Target="eButton.FontSize"
|
<Setter Target="eButton.FontSize"
|
||||||
Value="{StaticResource TitleFontSize}" />
|
Value="{StaticResource TitleFontSize}" />
|
||||||
<Setter Target="fButton.FontSize"
|
<Setter Target="fButton.FontSize"
|
||||||
Value="{StaticResource TitleFontSize}" />
|
Value="{StaticResource TitleFontSize}" />
|
||||||
|
|
||||||
<Setter Target="NumberPad.ButtonStyle"
|
<Setter Target="NumberPad.ButtonStyle"
|
||||||
Value="{StaticResource NumericButtonStyle24}" />
|
Value="{StaticResource NumericButtonStyle24}" />
|
||||||
</VisualState.Setters>
|
</VisualState.Setters>
|
||||||
</VisualState>
|
</VisualState>
|
||||||
|
|
||||||
<VisualState x:Name="FullLayout">
|
<VisualState x:Name="FullLayout">
|
||||||
<VisualState.StateTriggers>
|
<VisualState.StateTriggers>
|
||||||
<AdaptiveTrigger MinWindowHeight="768"
|
<AdaptiveTrigger MinWindowHeight="768"
|
||||||
MinWindowWidth="1024" />
|
MinWindowWidth="1024" />
|
||||||
</VisualState.StateTriggers>
|
</VisualState.StateTriggers>
|
||||||
<VisualState.Setters>
|
<VisualState.Setters>
|
||||||
<Setter Target="NumberPad.ButtonStyle"
|
<Setter Target="NumberPad.ButtonStyle"
|
||||||
Value="{StaticResource NumericButtonStyle24}" />
|
Value="{StaticResource NumericButtonStyle24}" />
|
||||||
</VisualState.Setters>
|
</VisualState.Setters>
|
||||||
</VisualState>
|
</VisualState>
|
||||||
<VisualState x:Name="MinSizeLayout">
|
<VisualState x:Name="MinSizeLayout">
|
||||||
<VisualState.StateTriggers>
|
<VisualState.StateTriggers>
|
||||||
<AdaptiveTrigger MinWindowHeight="{StaticResource AppMinWindowHeight}"
|
<AdaptiveTrigger MinWindowHeight="{StaticResource AppMinWindowHeight}"
|
||||||
MinWindowWidth="{StaticResource AppMinWindowWidth}" />
|
MinWindowWidth="{StaticResource AppMinWindowWidth}" />
|
||||||
</VisualState.StateTriggers>
|
</VisualState.StateTriggers>
|
||||||
</VisualState>
|
</VisualState>
|
||||||
<VisualState x:Name="DefaultLayout">
|
<VisualState x:Name="DefaultLayout">
|
||||||
<VisualState.StateTriggers>
|
<VisualState.StateTriggers>
|
||||||
<AdaptiveTrigger MinWindowHeight="0"
|
<AdaptiveTrigger MinWindowHeight="0"
|
||||||
MinWindowWidth="0" />
|
MinWindowWidth="0" />
|
||||||
</VisualState.StateTriggers>
|
</VisualState.StateTriggers>
|
||||||
|
|
||||||
<VisualState.Setters>
|
<VisualState.Setters>
|
||||||
<Setter Target="openParenthesisButton.FontSize"
|
<Setter Target="openParenthesisButton.FontSize"
|
||||||
Value="12" />
|
Value="12" />
|
||||||
<Setter Target="openParenthesisButton.Padding"
|
<Setter Target="openParenthesisButton.Padding"
|
||||||
Value="0" />
|
Value="0" />
|
||||||
<Setter Target="closeParenthesisButton.FontSize"
|
<Setter Target="closeParenthesisButton.FontSize"
|
||||||
Value="12" />
|
Value="12" />
|
||||||
<Setter Target="closeParenthesisButton.Padding"
|
<Setter Target="closeParenthesisButton.Padding"
|
||||||
Value="0" />
|
Value="0" />
|
||||||
|
|
||||||
<Setter Target="NumberPad.ButtonStyle"
|
<Setter Target="NumberPad.ButtonStyle"
|
||||||
Value="{StaticResource NumericButtonStyle12}" />
|
Value="{StaticResource NumericButtonStyle12}" />
|
||||||
<Setter Target="aButton.Style"
|
<Setter Target="aButton.Style"
|
||||||
Value="{StaticResource NumericButtonStyle12}" />
|
Value="{StaticResource NumericButtonStyle12}" />
|
||||||
<Setter Target="bButton.Style"
|
<Setter Target="bButton.Style"
|
||||||
Value="{StaticResource NumericButtonStyle12}" />
|
Value="{StaticResource NumericButtonStyle12}" />
|
||||||
<Setter Target="cButton.Style"
|
<Setter Target="cButton.Style"
|
||||||
Value="{StaticResource NumericButtonStyle12}" />
|
Value="{StaticResource NumericButtonStyle12}" />
|
||||||
<Setter Target="dButton.Style"
|
<Setter Target="dButton.Style"
|
||||||
Value="{StaticResource NumericButtonStyle12}" />
|
Value="{StaticResource NumericButtonStyle12}" />
|
||||||
<Setter Target="eButton.Style"
|
<Setter Target="eButton.Style"
|
||||||
Value="{StaticResource NumericButtonStyle12}" />
|
Value="{StaticResource NumericButtonStyle12}" />
|
||||||
<Setter Target="fButton.Style"
|
<Setter Target="fButton.Style"
|
||||||
Value="{StaticResource NumericButtonStyle12}" />
|
Value="{StaticResource NumericButtonStyle12}" />
|
||||||
|
|
||||||
<Setter Target="shiftButton.Style"
|
<Setter Target="shiftButton.Style"
|
||||||
Value="{StaticResource CaptionToggleButtonSmallStyle}" />
|
Value="{StaticResource CaptionToggleButtonSmallStyle}" />
|
||||||
</VisualState.Setters>
|
</VisualState.Setters>
|
||||||
</VisualState>
|
</VisualState>
|
||||||
</VisualStateGroup>
|
</VisualStateGroup>
|
||||||
</VisualStateManager.VisualStateGroups>
|
</VisualStateManager.VisualStateGroups>
|
||||||
|
|
||||||
<Grid x:Uid="ProgrammerOperators"
|
<Grid x:Uid="ProgrammerOperators"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Grid.ColumnSpan="6"
|
Grid.ColumnSpan="6"
|
||||||
AutomationProperties.HeadingLevel="Level1">
|
AutomationProperties.HeadingLevel="Level1">
|
||||||
|
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
|
@ -195,112 +195,112 @@
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<controls:CalculatorButton x:Name="rolButton"
|
<controls:CalculatorButton x:Name="rolButton"
|
||||||
x:Uid="rolButton"
|
x:Uid="rolButton"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Style="{StaticResource OperatorButtonStyle}"
|
Style="{StaticResource OperatorButtonStyle}"
|
||||||
FontSize="12"
|
FontSize="12"
|
||||||
AutomationProperties.AutomationId="rolButton"
|
AutomationProperties.AutomationId="rolButton"
|
||||||
ButtonId="Rol"
|
ButtonId="Rol"
|
||||||
Content="RoL"
|
Content="RoL"
|
||||||
Visibility="Collapsed" />
|
Visibility="Collapsed" />
|
||||||
|
|
||||||
<controls:CalculatorButton x:Name="rorButton"
|
<controls:CalculatorButton x:Name="rorButton"
|
||||||
x:Uid="rorButton"
|
x:Uid="rorButton"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Style="{StaticResource OperatorButtonStyle}"
|
Style="{StaticResource OperatorButtonStyle}"
|
||||||
FontSize="12"
|
FontSize="12"
|
||||||
AutomationProperties.AutomationId="rorButton"
|
AutomationProperties.AutomationId="rorButton"
|
||||||
ButtonId="Ror"
|
ButtonId="Ror"
|
||||||
Content="RoR"
|
Content="RoR"
|
||||||
Visibility="Collapsed" />
|
Visibility="Collapsed" />
|
||||||
|
|
||||||
<controls:CalculatorButton x:Name="lshButton"
|
<controls:CalculatorButton x:Name="lshButton"
|
||||||
x:Uid="lshButton"
|
x:Uid="lshButton"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Style="{StaticResource OperatorButtonStyle}"
|
Style="{StaticResource OperatorButtonStyle}"
|
||||||
FontSize="12"
|
FontSize="12"
|
||||||
AutomationProperties.AutomationId="lshButton"
|
AutomationProperties.AutomationId="lshButton"
|
||||||
ButtonId="Lsh"
|
ButtonId="Lsh"
|
||||||
Content="Lsh" />
|
Content="Lsh" />
|
||||||
|
|
||||||
<controls:CalculatorButton x:Name="rshButton"
|
<controls:CalculatorButton x:Name="rshButton"
|
||||||
x:Uid="rshButton"
|
x:Uid="rshButton"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Style="{StaticResource OperatorButtonStyle}"
|
Style="{StaticResource OperatorButtonStyle}"
|
||||||
FontSize="12"
|
FontSize="12"
|
||||||
AutomationProperties.AutomationId="rshButton"
|
AutomationProperties.AutomationId="rshButton"
|
||||||
ButtonId="Rsh"
|
ButtonId="Rsh"
|
||||||
Content="Rsh" />
|
Content="Rsh" />
|
||||||
|
|
||||||
<controls:CalculatorButton x:Name="orButton"
|
<controls:CalculatorButton x:Name="orButton"
|
||||||
x:Uid="orButton"
|
x:Uid="orButton"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
Style="{StaticResource OperatorButtonStyle}"
|
Style="{StaticResource OperatorButtonStyle}"
|
||||||
FontSize="12"
|
FontSize="12"
|
||||||
AutomationProperties.AutomationId="orButton"
|
AutomationProperties.AutomationId="orButton"
|
||||||
ButtonId="Or"
|
ButtonId="Or"
|
||||||
Content="Or" />
|
Content="Or" />
|
||||||
|
|
||||||
<controls:CalculatorButton x:Name="xorButton"
|
<controls:CalculatorButton x:Name="xorButton"
|
||||||
x:Uid="xorButton"
|
x:Uid="xorButton"
|
||||||
Grid.Column="3"
|
Grid.Column="3"
|
||||||
Style="{StaticResource OperatorButtonStyle}"
|
Style="{StaticResource OperatorButtonStyle}"
|
||||||
FontSize="12"
|
FontSize="12"
|
||||||
AutomationProperties.AutomationId="xorButton"
|
AutomationProperties.AutomationId="xorButton"
|
||||||
ButtonId="Xor"
|
ButtonId="Xor"
|
||||||
Content="Xor" />
|
Content="Xor" />
|
||||||
|
|
||||||
<controls:CalculatorButton x:Name="notButton"
|
<controls:CalculatorButton x:Name="notButton"
|
||||||
x:Uid="notButton"
|
x:Uid="notButton"
|
||||||
Grid.Column="4"
|
Grid.Column="4"
|
||||||
Style="{StaticResource OperatorButtonStyle}"
|
Style="{StaticResource OperatorButtonStyle}"
|
||||||
FontSize="12"
|
FontSize="12"
|
||||||
AutomationProperties.AutomationId="notButton"
|
AutomationProperties.AutomationId="notButton"
|
||||||
ButtonId="Not"
|
ButtonId="Not"
|
||||||
Content="Not" />
|
Content="Not" />
|
||||||
|
|
||||||
<controls:CalculatorButton x:Name="andButton"
|
<controls:CalculatorButton x:Name="andButton"
|
||||||
x:Uid="andButton"
|
x:Uid="andButton"
|
||||||
Grid.Column="5"
|
Grid.Column="5"
|
||||||
Style="{StaticResource OperatorButtonStyle}"
|
Style="{StaticResource OperatorButtonStyle}"
|
||||||
FontSize="12"
|
FontSize="12"
|
||||||
AutomationProperties.AutomationId="andButton"
|
AutomationProperties.AutomationId="andButton"
|
||||||
ButtonId="And"
|
ButtonId="And"
|
||||||
Content="And" />
|
Content="And" />
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<ToggleButton x:Name="shiftButton"
|
<ToggleButton x:Name="shiftButton"
|
||||||
x:Uid="shiftButton"
|
x:Uid="shiftButton"
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
Style="{StaticResource CaptionToggleButtonStyle}"
|
Style="{StaticResource CaptionToggleButtonStyle}"
|
||||||
FontFamily="{StaticResource CalculatorFontFamily}"
|
FontFamily="{StaticResource CalculatorFontFamily}"
|
||||||
FontSize="16"
|
FontSize="16"
|
||||||
AutomationProperties.AutomationId="shiftButton"
|
AutomationProperties.AutomationId="shiftButton"
|
||||||
Checked="Shift_Clicked"
|
Checked="Shift_Clicked"
|
||||||
Content=""
|
Content=""
|
||||||
Unchecked="Shift_Clicked" />
|
Unchecked="Shift_Clicked" />
|
||||||
|
|
||||||
<controls:CalculatorButton x:Name="modButton"
|
<controls:CalculatorButton x:Name="modButton"
|
||||||
x:Uid="modButton"
|
x:Uid="modButton"
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
Style="{StaticResource OperatorButtonStyle}"
|
Style="{StaticResource OperatorButtonStyle}"
|
||||||
FontSize="12"
|
FontSize="12"
|
||||||
AutomationProperties.AutomationId="modButton"
|
AutomationProperties.AutomationId="modButton"
|
||||||
ButtonId="Mod"
|
ButtonId="Mod"
|
||||||
Content="Mod" />
|
Content="Mod" />
|
||||||
|
|
||||||
<Grid x:Uid="StandardOperators"
|
<Grid x:Uid="StandardOperators"
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Grid.RowSpan="5"
|
Grid.RowSpan="5"
|
||||||
Grid.Column="6"
|
Grid.Column="6"
|
||||||
AutomationProperties.HeadingLevel="Level1">
|
AutomationProperties.HeadingLevel="Level1">
|
||||||
|
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition />
|
<RowDefinition />
|
||||||
<RowDefinition />
|
<RowDefinition />
|
||||||
|
@ -308,110 +308,110 @@
|
||||||
<RowDefinition />
|
<RowDefinition />
|
||||||
<RowDefinition />
|
<RowDefinition />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<controls:CalculatorButton x:Name="divideButton"
|
<controls:CalculatorButton x:Name="divideButton"
|
||||||
x:Uid="divideButton"
|
x:Uid="divideButton"
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
Style="{StaticResource AccentCalcButtonStyle}"
|
Style="{StaticResource AccentCalcButtonStyle}"
|
||||||
FontSize="12"
|
FontSize="12"
|
||||||
AutomationProperties.AutomationId="divideButton"
|
AutomationProperties.AutomationId="divideButton"
|
||||||
ButtonId="Divide"
|
ButtonId="Divide"
|
||||||
Content="" />
|
Content="" />
|
||||||
|
|
||||||
<controls:CalculatorButton x:Name="multiplyButton"
|
<controls:CalculatorButton x:Name="multiplyButton"
|
||||||
x:Uid="multiplyButton"
|
x:Uid="multiplyButton"
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Style="{StaticResource AccentCalcButtonStyle}"
|
Style="{StaticResource AccentCalcButtonStyle}"
|
||||||
FontSize="12"
|
FontSize="12"
|
||||||
AutomationProperties.AutomationId="multiplyButton"
|
AutomationProperties.AutomationId="multiplyButton"
|
||||||
ButtonId="Multiply"
|
ButtonId="Multiply"
|
||||||
Content="" />
|
Content="" />
|
||||||
|
|
||||||
<controls:CalculatorButton x:Name="minusButton"
|
<controls:CalculatorButton x:Name="minusButton"
|
||||||
x:Uid="minusButton"
|
x:Uid="minusButton"
|
||||||
Grid.Row="2"
|
Grid.Row="2"
|
||||||
Style="{StaticResource AccentCalcButtonStyle}"
|
Style="{StaticResource AccentCalcButtonStyle}"
|
||||||
FontSize="12"
|
FontSize="12"
|
||||||
AutomationProperties.AutomationId="minusButton"
|
AutomationProperties.AutomationId="minusButton"
|
||||||
ButtonId="Subtract"
|
ButtonId="Subtract"
|
||||||
Content="" />
|
Content="" />
|
||||||
|
|
||||||
<controls:CalculatorButton x:Name="plusButton"
|
<controls:CalculatorButton x:Name="plusButton"
|
||||||
x:Uid="plusButton"
|
x:Uid="plusButton"
|
||||||
Grid.Row="3"
|
Grid.Row="3"
|
||||||
Style="{StaticResource AccentCalcButtonStyle}"
|
Style="{StaticResource AccentCalcButtonStyle}"
|
||||||
FontSize="12"
|
FontSize="12"
|
||||||
AutomationProperties.AutomationId="plusButton"
|
AutomationProperties.AutomationId="plusButton"
|
||||||
ButtonId="Add"
|
ButtonId="Add"
|
||||||
Content="" />
|
Content="" />
|
||||||
|
|
||||||
<controls:CalculatorButton x:Name="equalButton"
|
<controls:CalculatorButton x:Name="equalButton"
|
||||||
x:Uid="equalButton"
|
x:Uid="equalButton"
|
||||||
Grid.Row="4"
|
Grid.Row="4"
|
||||||
Style="{StaticResource AccentCalcButtonStyle}"
|
Style="{StaticResource AccentCalcButtonStyle}"
|
||||||
FontSize="12"
|
FontSize="12"
|
||||||
AutomationProperties.AutomationId="equalButton"
|
AutomationProperties.AutomationId="equalButton"
|
||||||
ButtonId="Equals"
|
ButtonId="Equals"
|
||||||
Content="" />
|
Content="" />
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Grid x:Uid="DisplayControls"
|
<Grid x:Uid="DisplayControls"
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Grid.Column="3"
|
Grid.Column="3"
|
||||||
Grid.ColumnSpan="3"
|
Grid.ColumnSpan="3"
|
||||||
AutomationProperties.HeadingLevel="Level1">
|
AutomationProperties.HeadingLevel="Level1">
|
||||||
|
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<controls:CalculatorButton x:Name="clearEntryButton"
|
<controls:CalculatorButton x:Name="clearEntryButton"
|
||||||
x:Uid="clearEntryButton"
|
x:Uid="clearEntryButton"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Style="{StaticResource OperatorButtonStyle}"
|
Style="{StaticResource OperatorButtonStyle}"
|
||||||
FontSize="12"
|
FontSize="12"
|
||||||
FontWeight="SemiBold"
|
FontWeight="SemiBold"
|
||||||
AutomationProperties.AutomationId="clearEntryButton"
|
AutomationProperties.AutomationId="clearEntryButton"
|
||||||
ButtonId="ClearEntry"
|
ButtonId="ClearEntry"
|
||||||
Content="CE" />
|
Content="CE" />
|
||||||
|
|
||||||
<controls:CalculatorButton x:Name="clearButton"
|
<controls:CalculatorButton x:Name="clearButton"
|
||||||
x:Uid="clearButton"
|
x:Uid="clearButton"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Style="{StaticResource OperatorButtonStyle}"
|
Style="{StaticResource OperatorButtonStyle}"
|
||||||
FontSize="12"
|
FontSize="12"
|
||||||
FontWeight="SemiBold"
|
FontWeight="SemiBold"
|
||||||
AutomationProperties.AutomationId="clearButton"
|
AutomationProperties.AutomationId="clearButton"
|
||||||
ButtonId="Clear"
|
ButtonId="Clear"
|
||||||
Content="C" />
|
Content="C" />
|
||||||
|
|
||||||
<controls:CalculatorButton x:Name="backSpaceButton"
|
<controls:CalculatorButton x:Name="backSpaceButton"
|
||||||
x:Uid="backSpaceButton"
|
x:Uid="backSpaceButton"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
Style="{StaticResource SymbolOperatorButtonStyle}"
|
Style="{StaticResource SymbolOperatorButtonStyle}"
|
||||||
FontSize="12"
|
FontSize="12"
|
||||||
AutomationProperties.AutomationId="backSpaceButton"
|
AutomationProperties.AutomationId="backSpaceButton"
|
||||||
ButtonId="Backspace"
|
ButtonId="Backspace"
|
||||||
Content="" />
|
Content="" />
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Grid x:Uid="NumberPad"
|
<Grid x:Uid="NumberPad"
|
||||||
Grid.Row="2"
|
Grid.Row="2"
|
||||||
Grid.RowSpan="4"
|
Grid.RowSpan="4"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Grid.ColumnSpan="5"
|
Grid.ColumnSpan="5"
|
||||||
AutomationProperties.AutomationId="NumberPad"
|
AutomationProperties.AutomationId="NumberPad"
|
||||||
AutomationProperties.HeadingLevel="Level1">
|
AutomationProperties.HeadingLevel="Level1">
|
||||||
|
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition />
|
<RowDefinition />
|
||||||
<RowDefinition />
|
<RowDefinition />
|
||||||
<RowDefinition />
|
<RowDefinition />
|
||||||
<RowDefinition />
|
<RowDefinition />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
|
@ -419,104 +419,105 @@
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<local:NumberPad x:Name="NumberPad"
|
<local:NumberPad x:Name="NumberPad"
|
||||||
Grid.RowSpan="4"
|
Grid.RowSpan="4"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
Grid.ColumnSpan="3"
|
Grid.ColumnSpan="3"
|
||||||
ButtonStyle="{StaticResource NumericButtonStyle18}" />
|
ButtonStyle="{StaticResource NumericButtonStyle18}"
|
||||||
|
DecimalButtonStyle="{StaticResource DecimalButtonStyle}" />
|
||||||
|
|
||||||
<controls:CalculatorButton x:Name="aButton"
|
<controls:CalculatorButton x:Name="aButton"
|
||||||
x:Uid="aButton"
|
x:Uid="aButton"
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Style="{StaticResource NumericButtonStyle12}"
|
Style="{StaticResource NumericButtonStyle12}"
|
||||||
AutomationProperties.AutomationId="aButton"
|
AutomationProperties.AutomationId="aButton"
|
||||||
ButtonId="A"
|
ButtonId="A"
|
||||||
Content="A"
|
Content="A"
|
||||||
IsEnabled="{x:Bind Model.AreHEXButtonsEnabled, Mode=OneWay}" />
|
IsEnabled="{x:Bind Model.AreHEXButtonsEnabled, Mode=OneWay}" />
|
||||||
|
|
||||||
<controls:CalculatorButton x:Name="bButton"
|
<controls:CalculatorButton x:Name="bButton"
|
||||||
x:Uid="bButton"
|
x:Uid="bButton"
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Style="{StaticResource NumericButtonStyle12}"
|
Style="{StaticResource NumericButtonStyle12}"
|
||||||
AutomationProperties.AutomationId="bButton"
|
AutomationProperties.AutomationId="bButton"
|
||||||
ButtonId="B"
|
ButtonId="B"
|
||||||
Content="B"
|
Content="B"
|
||||||
IsEnabled="{x:Bind Model.AreHEXButtonsEnabled, Mode=OneWay}" />
|
IsEnabled="{x:Bind Model.AreHEXButtonsEnabled, Mode=OneWay}" />
|
||||||
|
|
||||||
<controls:CalculatorButton x:Name="cButton"
|
<controls:CalculatorButton x:Name="cButton"
|
||||||
x:Uid="cButton"
|
x:Uid="cButton"
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Style="{StaticResource NumericButtonStyle12}"
|
Style="{StaticResource NumericButtonStyle12}"
|
||||||
AutomationProperties.AutomationId="cButton"
|
AutomationProperties.AutomationId="cButton"
|
||||||
ButtonId="C"
|
ButtonId="C"
|
||||||
Content="C"
|
Content="C"
|
||||||
IsEnabled="{x:Bind Model.AreHEXButtonsEnabled, Mode=OneWay}" />
|
IsEnabled="{x:Bind Model.AreHEXButtonsEnabled, Mode=OneWay}" />
|
||||||
|
|
||||||
<controls:CalculatorButton x:Name="dButton"
|
<controls:CalculatorButton x:Name="dButton"
|
||||||
x:Uid="dButton"
|
x:Uid="dButton"
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Style="{StaticResource NumericButtonStyle12}"
|
Style="{StaticResource NumericButtonStyle12}"
|
||||||
AutomationProperties.AutomationId="dButton"
|
AutomationProperties.AutomationId="dButton"
|
||||||
ButtonId="D"
|
ButtonId="D"
|
||||||
Content="D"
|
Content="D"
|
||||||
IsEnabled="{x:Bind Model.AreHEXButtonsEnabled, Mode=OneWay}" />
|
IsEnabled="{x:Bind Model.AreHEXButtonsEnabled, Mode=OneWay}" />
|
||||||
|
|
||||||
<controls:CalculatorButton x:Name="eButton"
|
<controls:CalculatorButton x:Name="eButton"
|
||||||
x:Uid="eButton"
|
x:Uid="eButton"
|
||||||
Grid.Row="2"
|
Grid.Row="2"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Style="{StaticResource NumericButtonStyle12}"
|
Style="{StaticResource NumericButtonStyle12}"
|
||||||
AutomationProperties.AutomationId="eButton"
|
AutomationProperties.AutomationId="eButton"
|
||||||
ButtonId="E"
|
ButtonId="E"
|
||||||
Content="E"
|
Content="E"
|
||||||
IsEnabled="{x:Bind Model.AreHEXButtonsEnabled, Mode=OneWay}" />
|
IsEnabled="{x:Bind Model.AreHEXButtonsEnabled, Mode=OneWay}" />
|
||||||
|
|
||||||
<controls:CalculatorButton x:Name="fButton"
|
<controls:CalculatorButton x:Name="fButton"
|
||||||
x:Uid="fButton"
|
x:Uid="fButton"
|
||||||
Grid.Row="2"
|
Grid.Row="2"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Style="{StaticResource NumericButtonStyle12}"
|
Style="{StaticResource NumericButtonStyle12}"
|
||||||
AutomationProperties.AutomationId="fButton"
|
AutomationProperties.AutomationId="fButton"
|
||||||
ButtonId="F"
|
ButtonId="F"
|
||||||
Content="F"
|
Content="F"
|
||||||
IsEnabled="{x:Bind Model.AreHEXButtonsEnabled, Mode=OneWay}" />
|
IsEnabled="{x:Bind Model.AreHEXButtonsEnabled, Mode=OneWay}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<controls:CalculatorButton x:Name="openParenthesisButton"
|
<controls:CalculatorButton x:Name="openParenthesisButton"
|
||||||
x:Uid="openParenthesisButton"
|
x:Uid="openParenthesisButton"
|
||||||
Grid.Row="5"
|
Grid.Row="5"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Style="{StaticResource ParenthesisCalcButtonStyle}"
|
Style="{StaticResource ParenthesisCalcButtonStyle}"
|
||||||
FontSize="18"
|
FontSize="18"
|
||||||
AutomationProperties.AutomationId="openParenthesisButton"
|
AutomationProperties.AutomationId="openParenthesisButton"
|
||||||
AutomationProperties.Name="{Binding LeftParenthesisAutomationName}"
|
AutomationProperties.Name="{Binding LeftParenthesisAutomationName}"
|
||||||
ButtonId="OpenParenthesis"
|
ButtonId="OpenParenthesis"
|
||||||
Content="("
|
Content="("
|
||||||
Tag="{x:Bind Model.OpenParenthesisCount, Mode=OneWay}" />
|
Tag="{x:Bind Model.OpenParenthesisCount, Mode=OneWay}" />
|
||||||
|
|
||||||
<controls:CalculatorButton x:Name="closeParenthesisButton"
|
<controls:CalculatorButton x:Name="closeParenthesisButton"
|
||||||
x:Uid="closeParenthesisButton"
|
x:Uid="closeParenthesisButton"
|
||||||
Grid.Row="5"
|
Grid.Row="5"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
Style="{StaticResource OperatorButtonStyle}"
|
Style="{StaticResource OperatorButtonStyle}"
|
||||||
FontSize="18"
|
FontSize="18"
|
||||||
AutomationProperties.AutomationId="closeParenthesisButton"
|
AutomationProperties.AutomationId="closeParenthesisButton"
|
||||||
ButtonId="CloseParenthesis"
|
ButtonId="CloseParenthesis"
|
||||||
Content=")" />
|
Content=")" />
|
||||||
|
|
||||||
<controls:CalculatorButton x:Name="negateButton"
|
<controls:CalculatorButton x:Name="negateButton"
|
||||||
x:Uid="negateButton"
|
x:Uid="negateButton"
|
||||||
Grid.Row="5"
|
Grid.Row="5"
|
||||||
Grid.Column="3"
|
Grid.Column="3"
|
||||||
Style="{StaticResource SymbolOperatorButtonStyle}"
|
Style="{StaticResource SymbolOperatorButtonStyle}"
|
||||||
FontSize="12"
|
FontSize="12"
|
||||||
AutomationProperties.AutomationId="negateButton"
|
AutomationProperties.AutomationId="negateButton"
|
||||||
ButtonId="Negate"
|
ButtonId="Negate"
|
||||||
Content="" />
|
Content="" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -605,7 +605,8 @@
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
Grid.ColumnSpan="3"
|
Grid.ColumnSpan="3"
|
||||||
AutomationProperties.HeadingLevel="Level1"
|
AutomationProperties.HeadingLevel="Level1"
|
||||||
ButtonStyle="{StaticResource NumericButtonStyle24}" />
|
ButtonStyle="{StaticResource NumericButtonStyle24}"
|
||||||
|
DecimalButtonStyle="{StaticResource DecimalButtonStyle}" />
|
||||||
|
|
||||||
<controls:CalculatorButton x:Name="negateButton"
|
<controls:CalculatorButton x:Name="negateButton"
|
||||||
x:Uid="negateButton"
|
x:Uid="negateButton"
|
||||||
|
|
|
@ -118,10 +118,9 @@
|
||||||
-->
|
-->
|
||||||
<controls:CalculatorButton x:Name="decimalSeparatorButton"
|
<controls:CalculatorButton x:Name="decimalSeparatorButton"
|
||||||
x:Uid="decimalSeparatorButton"
|
x:Uid="decimalSeparatorButton"
|
||||||
Grid.Row="4"
|
Grid.Row="3"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
Style="{Binding ElementName=ControlRoot, Path=ButtonStyle}"
|
Style="{x:Bind Path=DecimalButtonStyle, Mode=OneWay}"
|
||||||
Background="{ThemeResource AppBackgroundAltMediumLowBrush}"
|
|
||||||
AutomationProperties.AutomationId="decimalSeparatorButton"
|
AutomationProperties.AutomationId="decimalSeparatorButton"
|
||||||
ButtonId="Decimal"
|
ButtonId="Decimal"
|
||||||
IsEnabled="{Binding IsDecimalEnabled}" />
|
IsEnabled="{Binding IsDecimalEnabled}" />
|
||||||
|
|
|
@ -22,7 +22,8 @@ namespace CalculatorApp
|
||||||
{
|
{
|
||||||
public sealed partial class NumberPad : UserControl
|
public sealed partial class NumberPad : UserControl
|
||||||
{
|
{
|
||||||
public Style ButtonStyle
|
#region ButtonStyle
|
||||||
|
public Style ButtonStyle
|
||||||
{
|
{
|
||||||
get { return (Style)GetValue(ButtonStyleProperty); }
|
get { return (Style)GetValue(ButtonStyleProperty); }
|
||||||
set { SetValue(ButtonStyleProperty, value); }
|
set { SetValue(ButtonStyleProperty, value); }
|
||||||
|
@ -30,8 +31,21 @@ namespace CalculatorApp
|
||||||
|
|
||||||
// Using a DependencyProperty as the backing store for ButtonStyle. This enables animation, styling, binding, etc...
|
// Using a DependencyProperty as the backing store for ButtonStyle. This enables animation, styling, binding, etc...
|
||||||
public static readonly DependencyProperty ButtonStyleProperty =
|
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));
|
||||||
private bool m_isErrorVisualState;
|
#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()
|
public NumberPad()
|
||||||
{
|
{
|
||||||
|
|
|
@ -849,16 +849,17 @@
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<local:NumberPad x:Name="NumberPad"
|
<local:NumberPad x:Name="NumberPad"
|
||||||
x:Uid="NumberPad"
|
x:Uid="NumberPad"
|
||||||
Grid.Row="2"
|
Grid.Row="2"
|
||||||
Grid.RowSpan="4"
|
Grid.RowSpan="4"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Grid.ColumnSpan="3"
|
Grid.ColumnSpan="3"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
AutomationProperties.HeadingLevel="Level1"
|
AutomationProperties.HeadingLevel="Level1"
|
||||||
ButtonStyle="{StaticResource NumericButtonStyle24}"
|
ButtonStyle="{StaticResource NumericButtonStyle24}"
|
||||||
TabIndex="10"
|
DecimalButtonStyle="{StaticResource DecimalButtonStyle}"
|
||||||
TabNavigation="Local" />
|
TabIndex="10"
|
||||||
|
TabNavigation="Local"/>
|
||||||
<controls:CalculatorButton x:Name="ConverterNegateButton"
|
<controls:CalculatorButton x:Name="ConverterNegateButton"
|
||||||
x:Uid="converterNegateButton"
|
x:Uid="converterNegateButton"
|
||||||
Grid.Row="5"
|
Grid.Row="5"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue