Skip to content

Commit

Permalink
Add Checked Event Handler to Add/Subtract Radio Buttons to enable Nar…
Browse files Browse the repository at this point in the history
…rator (microsoft#91)

* added bug report and feature request issue tempaltes

* copied pull_request_template.md to .github folder

* Updated the DateCalculation narrator logic to use PropertyChangedCallbacks for the DateResultLabel and DateDiffAllUnitsResultLabel TextBlocks.

* Reverted textblock callback changes and added an event handler for when the radio buttons are checked.

* Revert NarratorAnnouncement.h changes and removed unused code from DataCalculator.xaml.h. Updated comments in RaiseNotification method in DateCalculator.xaml.cpp

* Reverted changes in NarratorAnnouncement.h and NarratorAnnouncement.cpp

* Added SAL annotation to AddSubtractOption_Checked

* Remove namespaces from input types on AddSubtractOption_Checked
  • Loading branch information
sanderl authored Mar 6, 2019
1 parent b0e24c6 commit b865b1b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/Calculator/Views/DateCalculator.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@
MinWidth="80"
MaxWidth="160"
VerticalAlignment="Top"
Checked="AddSubtractOption_Checked"
IsChecked="{Binding IsAddMode, Mode=TwoWay}"/>
<RadioButton x:Name="SubtractOption"
x:Uid="SubtractOption"
Expand All @@ -524,6 +525,7 @@
MaxWidth="160"
Margin="20,0,0,0"
VerticalAlignment="Top"
Checked="AddSubtractOption_Checked"
IsChecked="{Binding IsAddMode, Converter={StaticResource BooleanNegationConverter}, Mode=TwoWay}"/>

</Grid>
Expand Down
7 changes: 6 additions & 1 deletion src/Calculator/Views/DateCalculator.xaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ void DateCalculator::ReselectCalendarDate(_In_ Windows::UI::Xaml::Controls::Cale

void DateCalculator::OffsetDropDownClosed(_In_ Object^ sender, _In_ Object^ e)
{
RaiseLiveRegionChangedAutomationEvent(false);
RaiseLiveRegionChangedAutomationEvent(/* DateDiff mode */ false);
}

void DateCalculator::CalendarFlyoutClosed(_In_ Object^ sender, _In_ Object^ e)
Expand All @@ -224,3 +224,8 @@ void DateCalculator::RaiseLiveRegionChangedAutomationEvent(_In_ bool isDateDiffM
String^ automationName = AutomationProperties::GetName(resultTextBlock);
TextBlockAutomationPeer::FromElement(resultTextBlock)->RaiseAutomationEvent(AutomationEvents::LiveRegionChanged);
}

void DateCalculator::AddSubtractOption_Checked(_In_ Object^ sender, _In_ RoutedEventArgs^ e)
{
RaiseLiveRegionChangedAutomationEvent(/* DateDiff mode */ false);
}
3 changes: 2 additions & 1 deletion src/Calculator/Views/DateCalculator.xaml.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

//
Expand Down Expand Up @@ -38,6 +38,7 @@ namespace CalculatorApp
void OnLoaded(_In_ Platform::Object^ sender, _In_ Windows::UI::Xaml::RoutedEventArgs^ e);
void DateCalcOption_Changed(_In_ Platform::Object^ sender, _In_ Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e);
void AddSubtractDateGrid_Loaded(_In_ Platform::Object^ sender, _In_ Windows::UI::Xaml::RoutedEventArgs^ e);
void AddSubtractOption_Checked(_In_ Platform::Object^ sender, _In_ Windows::UI::Xaml::RoutedEventArgs^ e);
void ReselectCalendarDate(_In_ Windows::UI::Xaml::Controls::CalendarDatePicker^ calendarDatePicker, Windows::Foundation::DateTime dateTime);
void OffsetDropDownClosed(_In_ Platform::Object^ sender, _In_ Platform::Object^ e);
void CalendarFlyoutClosed(_In_ Platform::Object^ sender, _In_ Platform::Object^ e);
Expand Down

0 comments on commit b865b1b

Please sign in to comment.