Bound the calendar picker to the control above (#507)

* Bound the calendar picker to the control above

* collapsed textbox and added headertext to the calendar picker element

* collpased textbox from both To and From calendar picker used headertext instead

* localized strings for the new headers added for the calendar date pickers

* modified the resoruces file so as to localize the strings

* remapped the grid components after the removal of the text Block

* restored original spacing between components
This commit is contained in:
David Kheri 2019-06-15 03:41:02 +02:00 committed by Dave Grochocki
parent 7276b5c7ce
commit 1ee438ddaf
2 changed files with 22 additions and 40 deletions

View File

@ -2904,9 +2904,9 @@
<value>Difference</value>
<comment>Difference result label</comment>
</data>
<data name="Date_FromLabel.Text" xml:space="preserve">
<data name="DateDiff_FromHeader.Header" xml:space="preserve">
<value>From</value>
<comment>From Date label for Date Picker</comment>
<comment>From Date Header for Difference Date Picker</comment>
</data>
<data name="MonthsLabel.Text" xml:space="preserve">
<value>Months</value>
@ -2916,9 +2916,9 @@
<value>Subtract</value>
<comment>Subtract toggle button text</comment>
</data>
<data name="Date_ToLabel.Text" xml:space="preserve">
<data name="DateDiff_ToHeader.Header" xml:space="preserve">
<value>To</value>
<comment>To Date label for Date Picker</comment>
<comment>To Date Header for Difference Date Picker</comment>
</data>
<data name="YearsLabel.Text" xml:space="preserve">
<value>Years</value>
@ -3387,6 +3387,10 @@
<value>Pyeong</value>
<comment>A measurement unit for area.</comment>
</data>
<data name="AddSubtract_Date_FromHeader.Header" xml:space="preserve">
<value>From</value>
<comment>From Date Header for AddSubtract Date Picker</comment>
</data>
<data name="CalculationResultScrollLeft.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Scroll Calculation Result Left</value>
<comment>Automation label for the "Scroll Left" button that appears when a calculation result is too large to fit in calculation result text box.</comment>

View File

@ -403,11 +403,9 @@
Grid.Row="2"
Visibility="{Binding IsDateDiffMode, Converter={StaticResource BooleanToVisibilityConverter}}">
<Grid.RowDefinitions>
<RowDefinition Height="1*" MaxHeight="17"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*" MaxHeight="17"/>
<RowDefinition Height="Auto" MinHeight="32"/>
<RowDefinition Height="1*" MaxHeight="24"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto" MinHeight="32"/>
<RowDefinition Height="1*" MaxHeight="24"/>
<RowDefinition Height="Auto"/>
@ -417,43 +415,31 @@
</Grid.RowDefinitions>
<!-- From Date -->
<TextBlock x:Name="Date_FromLabel"
x:Uid="Date_FromLabel"
Grid.Row="1"
Margin="0,0,0,2"
Foreground="{ThemeResource SystemControlPageTextBaseHighBrush}"
TextWrapping="Wrap"/>
<CalendarDatePicker x:Name="DateDiff_FromDate"
Grid.Row="2"
x:Uid="DateDiff_FromHeader"
Grid.Row="1"
Style="{StaticResource DateCalculation_CalendarPickerStyle}"
AutomationProperties.LabeledBy="{x:Bind Date_FromLabel}"
CalendarViewStyle="{StaticResource DateCalculation_CalendarViewStyle}"
Closed="CalendarFlyoutClosed"
DateChanged="FromDate_DateChanged"/>
<!-- To Date -->
<TextBlock x:Name="Date_ToLabel"
x:Uid="Date_ToLabel"
Grid.Row="4"
Margin="0,0,0,2"
Foreground="{ThemeResource SystemControlPageTextBaseHighBrush}"
TextWrapping="Wrap"/>
<CalendarDatePicker x:Name="DateDiff_ToDate"
Grid.Row="5"
x:Uid="DateDiff_ToHeader"
Grid.Row="3"
Margin="0,0,0,0"
Style="{StaticResource DateCalculation_CalendarPickerStyle}"
AutomationProperties.LabeledBy="{x:Bind Date_ToLabel}"
CalendarViewStyle="{StaticResource DateCalculation_CalendarViewStyle}"
Closed="CalendarFlyoutClosed"
DateChanged="ToDate_DateChanged"/>
<!-- Difference Result -->
<TextBlock x:Uid="Date_DifferenceLabel"
Grid.Row="7"
Grid.Row="5"
Margin="0,0,0,0"
Foreground="{ThemeResource SystemControlPageTextBaseHighBrush}"/>
<TextBlock x:Name="DateDiffAllUnitsResultLabel"
Grid.Row="8"
Grid.Row="6"
Style="{ThemeResource SubtitleTextBlockStyle}"
FontWeight="SemiBold"
AutomationProperties.LiveSetting="Polite"
@ -461,7 +447,7 @@
ContextFlyout="{StaticResource ResultsContextMenu}"
IsTextSelectionEnabled="True"
Text="{Binding StrDateDiffResult}"/>
<TextBlock Grid.Row="10"
<TextBlock Grid.Row="8"
Style="{ThemeResource BaseTextBlockStyle}"
Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}"
ContextFlyout="{StaticResource ResultsContextMenu}"
@ -479,7 +465,6 @@
<Grid.RowDefinitions>
<RowDefinition Height="1*" MaxHeight="17"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto" MinHeight="32"/>
<RowDefinition Height="1*" MaxHeight="23"/>
<RowDefinition Height="Auto"/>
@ -491,23 +476,16 @@
</Grid.RowDefinitions>
<!-- From Date -->
<TextBlock x:Name="AddSubtract_Date_FromLabel"
x:Uid="Date_FromLabel"
Grid.Row="1"
Margin="0,0,0,2"
Style="{ThemeResource BodyTextBlockStyle}"
Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}"
TextWrapping="Wrap"/>
<CalendarDatePicker x:Name="AddSubtract_FromDate"
Grid.Row="2"
x:Uid="AddSubtract_Date_FromHeader"
Grid.Row="1"
Margin="0,0,0,0"
Style="{StaticResource DateCalculation_CalendarPickerStyle}"
AutomationProperties.LabeledBy="{x:Bind AddSubtract_Date_FromLabel}"
CalendarViewStyle="{StaticResource DateCalculation_CalendarViewStyle}"
Closed="CalendarFlyoutClosed"
DateChanged="AddSubtract_DateChanged"/>
<Grid Grid.Row="4">
<Grid Grid.Row="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
@ -533,7 +511,7 @@
</Grid>
<!-- Date Offset to be Added/Subtracted -->
<Grid x:Name="DateOffsetGrid" Grid.Row="6">
<Grid x:Name="DateOffsetGrid" Grid.Row="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
@ -594,11 +572,11 @@
<!-- Resulting Date -->
<TextBlock x:Uid="DateLabel"
Grid.Row="8"
Grid.Row="7"
Foreground="{ThemeResource SystemControlPageTextBaseMediumBrush}"/>
<TextBlock x:Name="DateResultLabel"
Grid.Row="9"
Grid.Row="8"
Style="{ThemeResource SubtitleTextBlockStyle}"
FontWeight="SemiBold"
AutomationProperties.LiveSetting="Polite"