Merge master into feature/GraphingCalculator branch (#585)
* Merge master into feature/GraphingCalculator branch
This commit is contained in:
@@ -8,7 +8,6 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="using:CalculatorApp"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:model="using:CalculatorApp.ViewModel"
|
||||
Loaded="OnLoaded"
|
||||
mc:Ignorable="d">
|
||||
|
||||
@@ -19,241 +18,82 @@
|
||||
<TextBlock Margin="2,0,0,0"
|
||||
Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}"
|
||||
IsTextScaleFactorEnabled="False"
|
||||
Text="{Binding Token, Mode=OneWay}"/>
|
||||
Text="{x:Bind Token, Mode=OneWay}"/>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="Operator" x:DataType="common:DisplayExpressionToken">
|
||||
<TextBlock Margin="2,0,0,0"
|
||||
Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}"
|
||||
IsTextScaleFactorEnabled="False"
|
||||
Text="{Binding Token, Mode=OneWay}"/>
|
||||
Text="{x:Bind Token, Mode=OneWay}"/>
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="Separator" x:DataType="common:DisplayExpressionToken">
|
||||
<TextBlock x:Name="MainText"
|
||||
IsTextScaleFactorEnabled="False"
|
||||
Text="{Binding Token, Mode=OneWay}"/>
|
||||
Text="{x:Bind Token, Mode=OneWay}"/>
|
||||
</DataTemplate>
|
||||
|
||||
<!-- TextBox Styles -->
|
||||
|
||||
<Style x:Key="OperandTextBoxStyle" TargetType="controls:OperandTextBox">
|
||||
<Setter Property="MinWidth" Value="32"/>
|
||||
<Setter Property="MinHeight" Value="20"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="SelectionHighlightColor" Value="{ThemeResource SystemControlBackgroundAccentBrush}"/>
|
||||
<Setter Property="FontSize" Value="{ThemeResource BodyFontSize}"/>
|
||||
<Setter Property="IsTextScaleFactorEnabled" Value="False"/>
|
||||
<Setter Property="TextAlignment" Value="Center"/>
|
||||
<Setter Property="Padding" Value="2,0,3,0"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:OperandTextBox">
|
||||
<Grid x:Name="BackgroundElement" Background="{ThemeResource SystemControlBackgroundAltHighBrush}">
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Disabled"/>
|
||||
<VisualState x:Name="Normal">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="ContentElement.Foreground" Value="{ThemeResource SystemControlForegroundAccentBrush}"/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="PointerOver">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="BackgroundElement.Background" Value="{ThemeResource SystemControlHighlightListAccentLowBrush}"/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Focused">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="BackgroundElement.Background" Value="{ThemeResource SystemControlForegroundChromeWhiteBrush}"/>
|
||||
<Setter Target="ContentElement.Foreground" Value="{ThemeResource SystemControlBackgroundChromeBlackHighBrush}"/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<ScrollViewer x:Name="ContentElement"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
VerticalAlignment="Center"
|
||||
AutomationProperties.AccessibilityView="Raw"
|
||||
HorizontalScrollBarVisibility="Hidden"
|
||||
HorizontalScrollMode="Disabled"
|
||||
IsDeferredScrollingEnabled="False"
|
||||
IsHorizontalRailEnabled="True"
|
||||
IsTabStop="False"
|
||||
IsVerticalRailEnabled="False"
|
||||
VerticalScrollBarVisibility="Disabled"
|
||||
VerticalScrollMode="Disabled"
|
||||
ZoomMode="Disabled"/>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="OperatorTextBoxStyle" TargetType="controls:OperatorTextBox">
|
||||
<Setter Property="MinWidth" Value="4"/>
|
||||
<Setter Property="MinHeight" Value="20"/>
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:OperatorTextBox">
|
||||
<Grid x:Name="BackgroundElement" Background="{ThemeResource SystemControlBackgroundAltHighBrush}">
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Disabled"/>
|
||||
<VisualState x:Name="Normal">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="textElement.Foreground" Value="{ThemeResource SystemControlPageTextBaseMediumBrush}"/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="PointerOver">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="BackgroundElement.Background" Value="{ThemeResource SystemControlHighlightListAccentLowBrush}"/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Focused">
|
||||
<VisualState.Setters>
|
||||
<Setter Target="BackgroundElement.Background" Value="{ThemeResource SystemControlBackgroundAccentBrush}"/>
|
||||
<Setter Target="textElement.Foreground" Value="{ThemeResource SystemControlForegroundChromeWhiteBrush}"/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<TextBlock x:Name="textElement"
|
||||
Margin="0,-2,0,2"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
FontSize="16"
|
||||
IsHitTestVisible="True"
|
||||
IsTextScaleFactorEnabled="False"
|
||||
Text="{Binding Token}"
|
||||
TextAlignment="Center"/>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
|
||||
<Style TargetType="controls:OverflowTextBlock">
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:OverflowTextBlock">
|
||||
<Border x:Name="expressionborder" Background="Transparent">
|
||||
<Grid x:Name="tokenContainer" Background="{TemplateBinding Background}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="12"/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="12"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ScrollViewer x:Name="expressionContainer"
|
||||
Grid.Column="1"
|
||||
Padding="0,0,0,0"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Style="{StaticResource ResultsScrollerSnapped}"
|
||||
AutomationProperties.AccessibilityView="Raw"
|
||||
LayoutUpdated="expressionContainer_LayoutUpdated">
|
||||
<ListView x:Name="TokenList"
|
||||
<Grid x:Name="TokenContainer" Background="{TemplateBinding Background}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="12"/>
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="12"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ScrollViewer x:Name="ExpressionContainer"
|
||||
Grid.Column="1"
|
||||
Padding="0,0,0,0"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Style="{StaticResource ResultsScrollerSnapped}"
|
||||
AutomationProperties.AccessibilityView="Raw">
|
||||
<ItemsControl x:Name="TokenList"
|
||||
Padding="0"
|
||||
VerticalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Right"
|
||||
VerticalContentAlignment="Stretch"
|
||||
IsTabStop="False"
|
||||
ItemContainerStyleSelector="{StaticResource ExpressionItemContainerStyle}"
|
||||
ItemTemplateSelector="{StaticResource ExpressionItemTemplateSelector}"
|
||||
ItemsSource="{Binding ExpressionTokens}"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
|
||||
ScrollViewer.HorizontalScrollMode="Enabled"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Disabled"
|
||||
ScrollViewer.VerticalScrollMode="Disabled"
|
||||
SelectionMode="None">
|
||||
<ListView.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel HorizontalAlignment="Right"
|
||||
VerticalAlignment="Stretch"
|
||||
Orientation="Horizontal"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ListView.ItemsPanel>
|
||||
<ListView.ItemContainerTransitions>
|
||||
<TransitionCollection/>
|
||||
</ListView.ItemContainerTransitions>
|
||||
</ListView>
|
||||
</ScrollViewer>
|
||||
<Button x:Name="scrollLeft"
|
||||
x:Uid="scrollLeft"
|
||||
Grid.Column="0"
|
||||
Margin="-4,3,-4,0"
|
||||
Style="{StaticResource ScrollButtonStyle}">
|
||||
<FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
||||
FontSize="12"
|
||||
Glyph=""/>
|
||||
</Button>
|
||||
<Button x:Name="scrollRight"
|
||||
x:Uid="scrollRight"
|
||||
Grid.Column="2"
|
||||
Margin="0,3,-9,0"
|
||||
Style="{StaticResource ScrollButtonStyle}">
|
||||
<FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
||||
FontSize="12"
|
||||
Glyph=""/>
|
||||
</Button>
|
||||
</Grid>
|
||||
</Border>
|
||||
ItemsSource="{Binding ExpressionTokens}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<ItemsStackPanel HorizontalAlignment="Right"
|
||||
VerticalAlignment="Stretch"
|
||||
Orientation="Horizontal"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
<Button x:Name="ScrollLeft"
|
||||
x:Uid="scrollLeft"
|
||||
Grid.Column="0"
|
||||
Margin="-4,3,-4,0"
|
||||
Style="{StaticResource ScrollButtonStyle}">
|
||||
<FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
||||
FontSize="12"
|
||||
Glyph=""/>
|
||||
</Button>
|
||||
<Button x:Name="ScrollRight"
|
||||
x:Uid="scrollRight"
|
||||
Grid.Column="2"
|
||||
Margin="0,3,-9,0"
|
||||
Style="{StaticResource ScrollButtonStyle}">
|
||||
<FontIcon FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
||||
FontSize="12"
|
||||
Glyph=""/>
|
||||
</Button>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- ListViewItem Styles -->
|
||||
|
||||
<Style x:Key="ExpressionBaseContainerStyle" TargetType="ListViewItem">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Margin" Value="0"/>
|
||||
<Setter Property="MinWidth" Value="0"/>
|
||||
<Setter Property="MinHeight" Value="0"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Stretch"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListViewItem">
|
||||
<ListViewItemPresenter Padding="0"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
ContentMargin="0"
|
||||
DisabledOpacity="{ThemeResource ListViewItemDisabledThemeOpacity}"
|
||||
DragOpacity="{ThemeResource ListViewItemDragThemeOpacity}"
|
||||
PointerOverBackground="{ThemeResource SystemControlHighlightListAccentLowBrush}"
|
||||
PointerOverBackgroundMargin="0"
|
||||
SelectedBackground="{ThemeResource SystemControlBackgroundAccentBrush}"
|
||||
SelectedBorderThickness="0"
|
||||
SelectedForeground="{ThemeResource SystemControlForegroundChromeWhiteBrush}"
|
||||
SelectedPointerOverBackground="{ThemeResource SystemControlHighlightListAccentLowBrush}"
|
||||
SelectedPointerOverBorderBrush="Transparent"
|
||||
SelectionCheckMarkVisualEnabled="False"/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="NonEditableOperatorContainerStyle"
|
||||
BasedOn="{StaticResource ExpressionBaseContainerStyle}"
|
||||
TargetType="ListViewItem">
|
||||
<Setter Property="IsHitTestVisible" Value="False"/>
|
||||
<Setter Property="IsTabStop" Value="False"/>
|
||||
<Setter Property="MinWidth" Value="4"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="EditableOperatorContainerStyle"
|
||||
BasedOn="{StaticResource ExpressionBaseContainerStyle}"
|
||||
TargetType="ListViewItem">
|
||||
<Setter Property="IsHitTestVisible" Value="True"/>
|
||||
<Setter Property="MinWidth" Value="32"/>
|
||||
</Style>
|
||||
|
||||
<!-- Calculation Result Styles -->
|
||||
<Style x:Key="ResultsStyle"
|
||||
BasedOn="{StaticResource CalculationResultStyle}"
|
||||
@@ -332,11 +172,6 @@
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
ContentTransitions="{TemplateBinding ContentTransitions}"/>
|
||||
|
||||
<Border x:Name="CustomTitleBar"
|
||||
Height="32"
|
||||
HorizontalAlignment="Stretch"
|
||||
Background="{ThemeResource TitleBarBackgroundTransparentBrush}"/>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
@@ -412,12 +247,6 @@
|
||||
OperatorTemplate="{StaticResource Operator}"
|
||||
SeparatorTemplate="{StaticResource Separator}"/>
|
||||
|
||||
<converters:ExpressionItemContainerStyle x:Key="ExpressionItemContainerStyle"
|
||||
EditableOperatorStyle="{StaticResource NonEditableOperatorContainerStyle}"
|
||||
NonEditableOperatorStyle="{StaticResource NonEditableOperatorContainerStyle}"
|
||||
OperandStyle="{StaticResource NonEditableOperatorContainerStyle}"
|
||||
SeparatorStyle="{StaticResource NonEditableOperatorContainerStyle}"/>
|
||||
|
||||
<!-- Miscellaneous Resources -->
|
||||
|
||||
<automation:NarratorNotifier x:Name="NarratorNotifier" Announcement="{x:Bind Model.Announcement, Mode=OneWay}"/>
|
||||
@@ -455,7 +284,7 @@
|
||||
<Setter Target="MemRecall.IsEnabled" Value="False"/>
|
||||
<Setter Target="MemPlus.IsEnabled" Value="False"/>
|
||||
<Setter Target="MemMinus.IsEnabled" Value="False"/>
|
||||
<Setter Target="memButton.IsEnabled" Value="False"/>
|
||||
<Setter Target="MemButton.IsEnabled" Value="False"/>
|
||||
</VisualState.Setters>
|
||||
<Storyboard Completed="OnErrorLayoutCompleted"/>
|
||||
</VisualState>
|
||||
@@ -482,7 +311,7 @@
|
||||
<Setter Target="M4.MaxWidth" Value="99999"/>
|
||||
<Setter Target="M5.Width" Value="1*"/>
|
||||
<Setter Target="M5.MaxWidth" Value="80"/>
|
||||
<Setter Target="memButton.(Grid.Column)" Value="5"/>
|
||||
<Setter Target="MemButton.(Grid.Column)" Value="5"/>
|
||||
<Setter Target="MemoryButton.(Grid.Column)" Value="6"/>
|
||||
<Setter Target="HistoryButton.Visibility" Value="Collapsed"/>
|
||||
</VisualState.Setters>
|
||||
@@ -542,7 +371,7 @@
|
||||
<Setter Target="MemRecall.Style" Value="{StaticResource CaptionButtonStyle}"/>
|
||||
<Setter Target="MemPlus.Style" Value="{StaticResource CaptionButtonStyle}"/>
|
||||
<Setter Target="MemMinus.Style" Value="{StaticResource CaptionButtonStyle}"/>
|
||||
<Setter Target="memButton.Style" Value="{StaticResource CaptionButtonStyle}"/>
|
||||
<Setter Target="MemButton.Style" Value="{StaticResource CaptionButtonStyle}"/>
|
||||
<Setter Target="MemoryButton.MinHeight" Value="0"/>
|
||||
</VisualState.Setters>
|
||||
<Storyboard Completed="OnLayoutStateChanged"/>
|
||||
@@ -620,14 +449,14 @@
|
||||
IsInError="{x:Bind Model.IsInError, Mode=OneWay}"
|
||||
IsOperatorCommand="{x:Bind Model.IsOperatorCommand, Mode=OneWay}"
|
||||
TabIndex="1"/>
|
||||
<controls:OverflowTextBlock x:Name="expressionText"
|
||||
<controls:OverflowTextBlock x:Name="ExpressionText"
|
||||
Grid.Row="1"
|
||||
Margin="6,0,6,0"
|
||||
VerticalAlignment="Bottom"
|
||||
AutomationProperties.AutomationId="CalculatorExpression"
|
||||
AutomationProperties.Name="{x:Bind Model.CalculationExpressionAutomationName, Mode=OneWay}"
|
||||
IsTabStop="False"
|
||||
TokensUpdated="{Binding AreTokensUpdated, Mode=OneWay}"/>
|
||||
TokensUpdated="{x:Bind Model.AreTokensUpdated, Mode=OneWay}"/>
|
||||
|
||||
<!-- Programmer display panel controls -->
|
||||
<local:CalculatorProgrammerOperators x:Name="ProgrammerOperators"
|
||||
@@ -729,7 +558,7 @@
|
||||
Content="M-"
|
||||
TabIndex="13"
|
||||
Visibility="{Binding IsProgrammer, Converter={StaticResource BooleanToVisibilityNegationConverter}}"/>
|
||||
<controls:CalculatorButton x:Name="memButton"
|
||||
<controls:CalculatorButton x:Name="MemButton"
|
||||
x:Uid="memButton"
|
||||
Grid.Column="4"
|
||||
Style="{StaticResource CaptionButtonStyle}"
|
||||
|
||||
Reference in New Issue
Block a user