mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-19 12:59:30 -07:00
Replace wstring used in public methods by Platform::String in CalcViewModel (#758)
This commit is contained in:
parent
44e1984f6b
commit
93f1f784bb
35 changed files with 514 additions and 538 deletions
|
|
@ -10,6 +10,7 @@
|
|||
#include "CalcViewModel/Common/AppResourceProvider.h"
|
||||
#include "Views/Memory.xaml.h"
|
||||
#include "Converters/BooleanToVisibilityConverter.h"
|
||||
#include "CalcViewModel/Common/LocalizationStringUtil.h"
|
||||
#include "Common/AppLifecycleLogger.h"
|
||||
using namespace CalculatorApp;
|
||||
using namespace CalculatorApp::Common;
|
||||
|
|
@ -510,25 +511,20 @@ void MainPage::SetHeaderAutomationName()
|
|||
String ^ name;
|
||||
if (NavCategory::IsDateCalculatorViewMode(mode))
|
||||
{
|
||||
name = resProvider.GetResourceString(L"HeaderAutomationName_Date");
|
||||
name = resProvider->GetResourceString(L"HeaderAutomationName_Date");
|
||||
}
|
||||
else
|
||||
{
|
||||
wstring full;
|
||||
String ^ full;
|
||||
if (NavCategory::IsCalculatorViewMode(mode))
|
||||
{
|
||||
full = resProvider.GetResourceString(L"HeaderAutomationName_Calculator")->Data();
|
||||
full = resProvider->GetResourceString(L"HeaderAutomationName_Calculator");
|
||||
}
|
||||
else if (NavCategory::IsConverterViewMode(mode))
|
||||
{
|
||||
full = resProvider.GetResourceString(L"HeaderAutomationName_Converter")->Data();
|
||||
full = resProvider->GetResourceString(L"HeaderAutomationName_Converter");
|
||||
}
|
||||
|
||||
string::size_type found = full.find(L"%1");
|
||||
wstring strMode = m_model->CategoryName->Data();
|
||||
full = full.replace(found, 2, strMode);
|
||||
|
||||
name = ref new String(full.c_str());
|
||||
name = LocalizationStringUtil::GetLocalizedString(full, m_model->CategoryName);
|
||||
}
|
||||
|
||||
AutomationProperties::SetName(Header, name);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue