Added narrator announcement when a function is removed (#1136)

This commit is contained in:
Stephanie Anderl
2020-04-07 11:20:14 -07:00
committed by GitHub
parent 6887c66be0
commit 0ed876db43
4 changed files with 28 additions and 2 deletions

View File

@@ -4562,4 +4562,8 @@
<value>Match app theme</value>
<comment>This is the automation name text for the Graph settings option to set graph to match the app theme</comment>
</data>
<data name="FunctionRemovedAnnouncement" xml:space="preserve">
<value>Function removed</value>
<comment>Announcement used in Graphing Calculator when a function is removed from the function list</comment>
</data>
</root>

View File

@@ -4,9 +4,13 @@
#include "pch.h"
#include "EquationInputArea.xaml.h"
#include "Utils/VisualTree.h"
#include "CalcViewModel/Common/AppResourceProvider.h"
#include "CalcViewModel/Common/Automation/NarratorAnnouncement.h"
#include "CalcViewModel/Common/Automation/NarratorNotifier.h"
using namespace CalculatorApp;
using namespace CalculatorApp::Common;
using namespace CalculatorApp::Common::Automation;
using namespace GraphControl;
using namespace CalculatorApp::ViewModel;
using namespace CalculatorApp::Controls;
@@ -199,6 +203,12 @@ void EquationInputArea::EquationTextBox_RemoveButtonClicked(Object ^ sender, Rou
}
Equations->RemoveAt(index);
auto narratorNotifier = ref new NarratorNotifier();
auto announcement = CalculatorAnnouncement::GetFunctionRemovedAnnouncement(
AppResourceProvider::GetInstance()->GetResourceString(L"FunctionRemovedAnnouncement"));
narratorNotifier->Announce(announcement);
int lastIndex = Equations->Size - 1;
if (Equations->Size <= 1)