mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-14 02:26:50 -07:00
Add projects to migrate ViewModel code to C# (#1895)
* Rename the existing CalculatorApp.ViewModel.* namespaces to CalculatorApp.ViewModelNative.* * Add a new C# class library project for CalculatorApp.ViewModel * Add a new C# test project, CalculatorApp.ViewModel.Tests and run the tests in the pipeline * To prove it all works: port the Utilities.GetWindowId function from C++ to C# and call the new version from the Calculator project and from a unit test
This commit is contained in:
parent
edf08514a6
commit
62ca1ddf1c
157 changed files with 1118 additions and 473 deletions
|
@ -21,13 +21,15 @@ jobs:
|
|||
- checkout: none
|
||||
|
||||
- task: DownloadBuildArtifacts@0
|
||||
displayName: Download CalculatorUnitTests
|
||||
displayName: Download test files
|
||||
inputs:
|
||||
artifactName: drop
|
||||
itemPattern: drop/Release/${{ parameters.platform }}/CalculatorUnitTests/AppPackages/CalculatorUnitTests_Test/**
|
||||
itemPattern: |
|
||||
drop/Release/${{ parameters.platform }}/CalculatorUnitTests/AppPackages/CalculatorUnitTests_Test/**
|
||||
drop/Release/${{ parameters.platform }}/CalculatorApp.ViewModel.Tests/AppPackages/CalculatorApp.ViewModel.Tests_Test/**
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: Install Certificate
|
||||
displayName: Install certificate
|
||||
inputs:
|
||||
filePath: $(Build.ArtifactStagingDirectory)\drop\Release\${{ parameters.platform }}\CalculatorUnitTests\AppPackages\CalculatorUnitTests_Test\Add-AppDevPackage.ps1
|
||||
arguments: -CertificatePath $(Build.ArtifactStagingDirectory)\drop\Release\${{ parameters.platform }}\CalculatorUnitTests\AppPackages\CalculatorUnitTests_Test\CalculatorUnitTests.cer -Force
|
||||
|
@ -37,3 +39,9 @@ jobs:
|
|||
inputs:
|
||||
testAssemblyVer2: $(Build.ArtifactStagingDirectory)\drop\Release\${{ parameters.platform }}\CalculatorUnitTests\AppPackages\CalculatorUnitTests_Test\CalculatorUnitTests.msix
|
||||
otherConsoleOptions: /Platform:${{ parameters.platform }}
|
||||
|
||||
- task: VSTest@2
|
||||
displayName: Run CalculatorApp.ViewModel.Tests
|
||||
inputs:
|
||||
testAssemblyVer2: $(Build.ArtifactStagingDirectory)\drop\Release\${{ parameters.platform }}\CalculatorApp.ViewModel.Tests\AppPackages\CalculatorApp.ViewModel.Tests_Test\CalculatorApp.ViewModel.Tests.msix
|
||||
otherConsoleOptions: /Platform:${{ parameters.platform }}
|
|
@ -12,9 +12,9 @@
|
|||
#include "DataLoaders/UnitConverterDataLoader.h"
|
||||
|
||||
using namespace CalculatorApp;
|
||||
using namespace CalculatorApp::ViewModel::Common;
|
||||
using namespace CalculatorApp::ViewModel::DataLoaders;
|
||||
using namespace CalculatorApp::ViewModel;
|
||||
using namespace CalculatorApp::ViewModelNative::Common;
|
||||
using namespace CalculatorApp::ViewModelNative::DataLoaders;
|
||||
using namespace CalculatorApp::ViewModelNative;
|
||||
using namespace CalculationManager;
|
||||
using namespace Platform;
|
||||
using namespace Platform::Collections;
|
||||
|
|
|
@ -10,21 +10,21 @@
|
|||
|
||||
namespace CalculatorApp
|
||||
{
|
||||
namespace ViewModel
|
||||
namespace ViewModelNative
|
||||
{
|
||||
[Windows::UI::Xaml::Data::Bindable] public ref class ApplicationViewModel sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
|
||||
{
|
||||
public:
|
||||
ApplicationViewModel();
|
||||
|
||||
void Initialize(CalculatorApp::ViewModel::Common::ViewMode mode); // Use for first init, use deserialize for rehydration
|
||||
void Initialize(CalculatorApp::ViewModelNative::Common::ViewMode mode); // Use for first init, use deserialize for rehydration
|
||||
|
||||
OBSERVABLE_OBJECT();
|
||||
OBSERVABLE_PROPERTY_RW(StandardCalculatorViewModel ^, CalculatorViewModel);
|
||||
OBSERVABLE_PROPERTY_RW(DateCalculatorViewModel ^, DateCalcViewModel);
|
||||
OBSERVABLE_PROPERTY_RW(GraphingCalculatorViewModel ^, GraphingCalcViewModel);
|
||||
OBSERVABLE_PROPERTY_RW(UnitConverterViewModel ^, ConverterViewModel);
|
||||
OBSERVABLE_PROPERTY_RW(CalculatorApp::ViewModel::Common::ViewMode, PreviousMode);
|
||||
OBSERVABLE_PROPERTY_RW(CalculatorApp::ViewModelNative::Common::ViewMode, PreviousMode);
|
||||
OBSERVABLE_PROPERTY_R(bool, IsAlwaysOnTop);
|
||||
OBSERVABLE_NAMED_PROPERTY_RW(Platform::String ^, CategoryName);
|
||||
|
||||
|
@ -34,14 +34,14 @@ namespace CalculatorApp
|
|||
COMMAND_FOR_METHOD(CopyCommand, ApplicationViewModel::OnCopyCommand);
|
||||
COMMAND_FOR_METHOD(PasteCommand, ApplicationViewModel::OnPasteCommand);
|
||||
|
||||
property CalculatorApp::ViewModel::Common::ViewMode Mode
|
||||
property CalculatorApp::ViewModelNative::Common::ViewMode Mode
|
||||
{
|
||||
CalculatorApp::ViewModel::Common::ViewMode get()
|
||||
CalculatorApp::ViewModelNative::Common::ViewMode get()
|
||||
{
|
||||
return m_mode;
|
||||
}
|
||||
|
||||
void set(CalculatorApp::ViewModel::Common::ViewMode value);
|
||||
void set(CalculatorApp::ViewModelNative::Common::ViewMode value);
|
||||
}
|
||||
static property Platform::String^ ModePropertyName
|
||||
{
|
||||
|
@ -51,21 +51,21 @@ namespace CalculatorApp
|
|||
}
|
||||
}
|
||||
|
||||
property Windows::Foundation::Collections::IObservableVector<CalculatorApp::ViewModel::Common::NavCategoryGroup^>^ Categories
|
||||
property Windows::Foundation::Collections::IObservableVector<CalculatorApp::ViewModelNative::Common::NavCategoryGroup^>^ Categories
|
||||
{
|
||||
Windows::Foundation::Collections::IObservableVector<CalculatorApp::ViewModel::Common::NavCategoryGroup^>^ get()
|
||||
Windows::Foundation::Collections::IObservableVector<CalculatorApp::ViewModelNative::Common::NavCategoryGroup^>^ get()
|
||||
{
|
||||
return m_categories;
|
||||
}
|
||||
|
||||
void set(Windows::Foundation::Collections::IObservableVector<CalculatorApp::ViewModel::Common::NavCategoryGroup^>^ value);
|
||||
void set(Windows::Foundation::Collections::IObservableVector<CalculatorApp::ViewModelNative::Common::NavCategoryGroup^>^ value);
|
||||
}
|
||||
|
||||
property Windows::UI::Xaml::Visibility ClearMemoryVisibility
|
||||
{
|
||||
Windows::UI::Xaml::Visibility get()
|
||||
{
|
||||
return CalculatorApp::ViewModel::Common::NavCategory::IsCalculatorViewMode(Mode) ? Windows::UI::Xaml::Visibility::Visible
|
||||
return CalculatorApp::ViewModelNative::Common::NavCategory::IsCalculatorViewMode(Mode) ? Windows::UI::Xaml::Visibility::Visible
|
||||
: Windows::UI::Xaml::Visibility::Collapsed;
|
||||
}
|
||||
}
|
||||
|
@ -106,8 +106,8 @@ namespace CalculatorApp
|
|||
|
||||
void SetMenuCategories();
|
||||
|
||||
CalculatorApp::ViewModel::Common::ViewMode m_mode;
|
||||
Windows::Foundation::Collections::IObservableVector<CalculatorApp::ViewModel::Common::NavCategoryGroup ^> ^ m_categories;
|
||||
CalculatorApp::ViewModelNative::Common::ViewMode m_mode;
|
||||
Windows::Foundation::Collections::IObservableVector<CalculatorApp::ViewModelNative::Common::NavCategoryGroup ^> ^ m_categories;
|
||||
Concurrency::task<void> HandleToggleAlwaysOnTop(float width, float height);
|
||||
void SetDisplayNormalAlwaysOnTopOption();
|
||||
};
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{812d1a7b-b8ac-49e4-8e6d-af5d59500d56}</ProjectGuid>
|
||||
<Keyword>WindowsRuntimeComponent</Keyword>
|
||||
<RootNamespace>CalculatorApp.ViewModel</RootNamespace>
|
||||
<RootNamespace>CalculatorApp.ViewModelNative</RootNamespace>
|
||||
<DefaultLanguage>en-US</DefaultLanguage>
|
||||
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
|
||||
<AppContainerApplication>true</AppContainerApplication>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
using namespace Platform;
|
||||
using namespace Windows::ApplicationModel::Resources;
|
||||
using namespace CalculatorApp;
|
||||
using namespace CalculatorApp::ViewModel::Common;
|
||||
using namespace CalculatorApp::ViewModelNative::Common;
|
||||
|
||||
AppResourceProvider::AppResourceProvider()
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
namespace CalculatorApp::ViewModel::Common
|
||||
namespace CalculatorApp::ViewModelNative::Common
|
||||
{
|
||||
public ref class AppResourceProvider sealed
|
||||
{
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
#include "pch.h"
|
||||
#include "NarratorAnnouncement.h"
|
||||
|
||||
using namespace CalculatorApp::ViewModel::Common::Automation;
|
||||
using namespace CalculatorApp::ViewModelNative::Common::Automation;
|
||||
using namespace Platform;
|
||||
using namespace Windows::UI::Xaml::Automation::Peers;
|
||||
|
||||
namespace CalculatorApp::ViewModel::Common::Automation
|
||||
namespace CalculatorApp::ViewModelNative::Common::Automation
|
||||
{
|
||||
namespace CalculatorActivityIds
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
namespace CalculatorApp::ViewModel::Common::Automation
|
||||
namespace CalculatorApp::ViewModelNative::Common::Automation
|
||||
{
|
||||
public
|
||||
ref class NarratorAnnouncement sealed
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "pch.h"
|
||||
#include "NarratorNotifier.h"
|
||||
|
||||
using namespace CalculatorApp::ViewModel::Common::Automation;
|
||||
using namespace CalculatorApp::ViewModelNative::Common::Automation;
|
||||
using namespace Platform;
|
||||
using namespace Windows::UI::Xaml;
|
||||
using namespace Windows::UI::Xaml::Automation;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#pragma once
|
||||
#include "NarratorAnnouncement.h"
|
||||
|
||||
namespace CalculatorApp::ViewModel::Common::Automation
|
||||
namespace CalculatorApp::ViewModelNative::Common::Automation
|
||||
{
|
||||
public
|
||||
ref class NarratorNotifier sealed : public Windows::UI::Xaml::DependencyObject
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
namespace CalculatorApp::ViewModel
|
||||
namespace CalculatorApp::ViewModelNative
|
||||
{
|
||||
namespace Common
|
||||
{
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#include "pch.h"
|
||||
#include "CalculatorButtonPressedEventArgs.h"
|
||||
|
||||
using namespace CalculatorApp;
|
||||
using namespace CalculatorApp::ViewModel;
|
||||
using namespace CalculatorApp::ViewModel::Common;
|
||||
using namespace CalculatorApp::ViewModelNative;
|
||||
using namespace CalculatorApp::ViewModelNative::Common;
|
||||
using namespace Platform;
|
||||
|
||||
NumbersAndOperatorsEnum CalculatorButtonPressedEventArgs::GetOperationFromCommandParameter(_In_ Object ^ commandParameter)
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "CalculatorButtonUser.h"
|
||||
#include "Utils.h"
|
||||
|
||||
namespace CalculatorApp::ViewModel
|
||||
namespace CalculatorApp::ViewModelNative
|
||||
{
|
||||
namespace Common
|
||||
{
|
||||
|
@ -15,15 +15,15 @@ namespace CalculatorApp::ViewModel
|
|||
{
|
||||
public:
|
||||
PROPERTY_R(Platform::String ^, AuditoryFeedback);
|
||||
PROPERTY_R(CalculatorApp::ViewModel::Common::NumbersAndOperatorsEnum, Operation);
|
||||
PROPERTY_R(CalculatorApp::ViewModelNative::Common::NumbersAndOperatorsEnum, Operation);
|
||||
|
||||
CalculatorButtonPressedEventArgs(Platform::String ^ feedback, CalculatorApp::ViewModel::Common::NumbersAndOperatorsEnum operation)
|
||||
CalculatorButtonPressedEventArgs(Platform::String ^ feedback, CalculatorApp::ViewModelNative::Common::NumbersAndOperatorsEnum operation)
|
||||
: m_AuditoryFeedback(feedback)
|
||||
, m_Operation(operation)
|
||||
{
|
||||
}
|
||||
|
||||
static CalculatorApp::ViewModel::Common::NumbersAndOperatorsEnum GetOperationFromCommandParameter(_In_ Platform::Object ^ commandParameter);
|
||||
static CalculatorApp::ViewModelNative::Common::NumbersAndOperatorsEnum GetOperationFromCommandParameter(_In_ Platform::Object ^ commandParameter);
|
||||
static Platform::String ^ GetAuditoryFeedbackFromCommandParameter(_In_ Platform::Object ^ commandParameter);
|
||||
};
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include "CalcManager/Command.h"
|
||||
|
||||
namespace CalculatorApp::ViewModel::Common
|
||||
namespace CalculatorApp::ViewModelNative::Common
|
||||
{
|
||||
namespace CM = CalculationManager;
|
||||
|
||||
|
|
|
@ -8,13 +8,13 @@
|
|||
#include "StandardCalculatorViewModel.h"
|
||||
|
||||
using namespace CalculatorApp;
|
||||
using namespace CalculatorApp::ViewModel;
|
||||
using namespace CalculatorApp::ViewModel::Common;
|
||||
using namespace CalculatorApp::ViewModelNative;
|
||||
using namespace CalculatorApp::ViewModelNative::Common;
|
||||
using namespace CalculationManager;
|
||||
using namespace Platform;
|
||||
using namespace std;
|
||||
|
||||
namespace CalculatorApp::ViewModel::Common
|
||||
namespace CalculatorApp::ViewModelNative::Common
|
||||
{
|
||||
CalculatorDisplay::CalculatorDisplay()
|
||||
{
|
||||
|
@ -34,7 +34,7 @@ namespace CalculatorApp::ViewModel::Common
|
|||
{
|
||||
if (m_callbackReference)
|
||||
{
|
||||
if (auto calcVM = m_callbackReference.Resolve<ViewModel::StandardCalculatorViewModel>())
|
||||
if (auto calcVM = m_callbackReference.Resolve<ViewModelNative::StandardCalculatorViewModel>())
|
||||
{
|
||||
calcVM->SetPrimaryDisplay(StringReference(displayStringValue.c_str()), isError);
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ namespace CalculatorApp::ViewModel::Common
|
|||
{
|
||||
if (m_callbackReference != nullptr)
|
||||
{
|
||||
if (auto calcVM = m_callbackReference.Resolve<ViewModel::StandardCalculatorViewModel>())
|
||||
if (auto calcVM = m_callbackReference.Resolve<ViewModelNative::StandardCalculatorViewModel>())
|
||||
{
|
||||
calcVM->SetParenthesisCount(parenthesisCount);
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ namespace CalculatorApp::ViewModel::Common
|
|||
{
|
||||
if (m_callbackReference != nullptr)
|
||||
{
|
||||
if (auto calcVM = m_callbackReference.Resolve<ViewModel::StandardCalculatorViewModel>())
|
||||
if (auto calcVM = m_callbackReference.Resolve<ViewModelNative::StandardCalculatorViewModel>())
|
||||
{
|
||||
calcVM->OnNoRightParenAdded();
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ namespace CalculatorApp::ViewModel::Common
|
|||
{
|
||||
if (m_callbackReference != nullptr)
|
||||
{
|
||||
if (auto calcVM = m_callbackReference.Resolve<ViewModel::StandardCalculatorViewModel>())
|
||||
if (auto calcVM = m_callbackReference.Resolve<ViewModelNative::StandardCalculatorViewModel>())
|
||||
{
|
||||
calcVM->IsInError = isError;
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ namespace CalculatorApp::ViewModel::Common
|
|||
{
|
||||
if (m_callbackReference != nullptr)
|
||||
{
|
||||
if (auto calcVM = m_callbackReference.Resolve<ViewModel::StandardCalculatorViewModel>())
|
||||
if (auto calcVM = m_callbackReference.Resolve<ViewModelNative::StandardCalculatorViewModel>())
|
||||
{
|
||||
calcVM->SetExpressionDisplay(tokens, commands);
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ namespace CalculatorApp::ViewModel::Common
|
|||
{
|
||||
if (m_callbackReference != nullptr)
|
||||
{
|
||||
if (auto calcVM = m_callbackReference.Resolve<ViewModel::StandardCalculatorViewModel>())
|
||||
if (auto calcVM = m_callbackReference.Resolve<ViewModelNative::StandardCalculatorViewModel>())
|
||||
{
|
||||
calcVM->SetMemorizedNumbers(newMemorizedNumbers);
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ namespace CalculatorApp::ViewModel::Common
|
|||
{
|
||||
if (m_historyCallbackReference != nullptr)
|
||||
{
|
||||
if (auto historyVM = m_historyCallbackReference.Resolve<ViewModel::HistoryViewModel>())
|
||||
if (auto historyVM = m_historyCallbackReference.Resolve<ViewModelNative::HistoryViewModel>())
|
||||
{
|
||||
historyVM->OnHistoryItemAdded(addedItemIndex);
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ namespace CalculatorApp::ViewModel::Common
|
|||
{
|
||||
if (m_callbackReference != nullptr)
|
||||
{
|
||||
if (auto calcVM = m_callbackReference.Resolve<ViewModel::StandardCalculatorViewModel>())
|
||||
if (auto calcVM = m_callbackReference.Resolve<ViewModelNative::StandardCalculatorViewModel>())
|
||||
{
|
||||
calcVM->OnMaxDigitsReached();
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ namespace CalculatorApp::ViewModel::Common
|
|||
{
|
||||
if (m_callbackReference != nullptr)
|
||||
{
|
||||
if (auto calcVM = m_callbackReference.Resolve<ViewModel::StandardCalculatorViewModel>())
|
||||
if (auto calcVM = m_callbackReference.Resolve<ViewModelNative::StandardCalculatorViewModel>())
|
||||
{
|
||||
calcVM->OnBinaryOperatorReceived();
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ namespace CalculatorApp::ViewModel::Common
|
|||
{
|
||||
if (m_callbackReference != nullptr)
|
||||
{
|
||||
if (auto calcVM = m_callbackReference.Resolve<ViewModel::StandardCalculatorViewModel>())
|
||||
if (auto calcVM = m_callbackReference.Resolve<ViewModelNative::StandardCalculatorViewModel>())
|
||||
{
|
||||
calcVM->OnMemoryItemChanged(indexOfMemory);
|
||||
}
|
||||
|
@ -146,7 +146,7 @@ namespace CalculatorApp::ViewModel::Common
|
|||
{
|
||||
if (m_callbackReference != nullptr)
|
||||
{
|
||||
if (auto calcVM = m_callbackReference.Resolve<ViewModel::StandardCalculatorViewModel>())
|
||||
if (auto calcVM = m_callbackReference.Resolve<ViewModelNative::StandardCalculatorViewModel>())
|
||||
{
|
||||
calcVM->OnInputChanged();
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include "CalcManager/Header Files/ICalcDisplay.h"
|
||||
|
||||
namespace CalculatorApp::ViewModel::Common
|
||||
namespace CalculatorApp::ViewModelNative::Common
|
||||
{
|
||||
// Callback interface to be implemented by the CalculatorManager
|
||||
class CalculatorDisplay : public ICalcDisplay
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
using namespace std;
|
||||
using namespace concurrency;
|
||||
using namespace CalculatorApp;
|
||||
using namespace CalculatorApp::ViewModel::Common;
|
||||
using namespace CalculatorApp::ViewModel;
|
||||
using namespace CalculatorApp::ViewModelNative::Common;
|
||||
using namespace CalculatorApp::ViewModelNative;
|
||||
using namespace Platform;
|
||||
using namespace Platform::Collections;
|
||||
using namespace Windows::Foundation;
|
||||
|
@ -615,7 +615,7 @@ ULONG32 CopyPasteManager::ProgrammerOperandLength(Platform::String ^ operand, Nu
|
|||
Platform::String ^ CopyPasteManager::RemoveUnwantedCharsFromString(Platform::String ^ input)
|
||||
{
|
||||
constexpr wchar_t unWantedChars[] = { L' ', L',', L'"', 165, 164, 8373, 36, 8353, 8361, 8362, 8358, 8377, 163, 8364, 8234, 8235, 8236, 8237, 160 };
|
||||
input = CalculatorApp::ViewModel::Common::LocalizationSettings::GetInstance()->RemoveGroupSeparators(input);
|
||||
input = CalculatorApp::ViewModelNative::Common::LocalizationSettings::GetInstance()->RemoveGroupSeparators(input);
|
||||
return ref new String(Utils::RemoveUnwantedCharsFromString(input->Data(), unWantedChars).c_str());
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace CalculatorUnitTests
|
|||
class CopyPasteManagerTest;
|
||||
}
|
||||
|
||||
namespace CalculatorApp::ViewModel::Common
|
||||
namespace CalculatorApp::ViewModelNative::Common
|
||||
{
|
||||
public value struct CopyPasteMaxOperandLengthAndValue
|
||||
{
|
||||
|
@ -26,10 +26,10 @@ namespace CalculatorApp::ViewModel::Common
|
|||
public:
|
||||
static void CopyToClipboard(Platform::String ^ stringToCopy);
|
||||
static Windows::Foundation::IAsyncOperation<Platform::String ^> ^ GetStringToPaste(
|
||||
CalculatorApp::ViewModel::Common::ViewMode mode,
|
||||
CalculatorApp::ViewModel::Common::CategoryGroupType modeType,
|
||||
CalculatorApp::ViewModel::Common::NumberBase programmerNumberBase,
|
||||
CalculatorApp::ViewModel::Common::BitLength bitLengthType);
|
||||
CalculatorApp::ViewModelNative::Common::ViewMode mode,
|
||||
CalculatorApp::ViewModelNative::Common::CategoryGroupType modeType,
|
||||
CalculatorApp::ViewModelNative::Common::NumberBase programmerNumberBase,
|
||||
CalculatorApp::ViewModelNative::Common::BitLength bitLengthType);
|
||||
static bool HasStringToPaste();
|
||||
static bool IsErrorMessage(Platform::String ^ message);
|
||||
static property unsigned int MaxPasteableLength
|
||||
|
@ -88,39 +88,39 @@ namespace CalculatorApp::ViewModel::Common
|
|||
static Platform::String
|
||||
^ ValidatePasteExpression(
|
||||
Platform::String ^ pastedText,
|
||||
CalculatorApp::ViewModel::Common::ViewMode mode,
|
||||
CalculatorApp::ViewModel::Common::NumberBase programmerNumberBase,
|
||||
CalculatorApp::ViewModel::Common::BitLength bitLengthType);
|
||||
CalculatorApp::ViewModelNative::Common::ViewMode mode,
|
||||
CalculatorApp::ViewModelNative::Common::NumberBase programmerNumberBase,
|
||||
CalculatorApp::ViewModelNative::Common::BitLength bitLengthType);
|
||||
static Platform::String
|
||||
^ ValidatePasteExpression(
|
||||
Platform::String ^ pastedText,
|
||||
CalculatorApp::ViewModel::Common::ViewMode mode,
|
||||
CalculatorApp::ViewModel::Common::CategoryGroupType modeType,
|
||||
CalculatorApp::ViewModel::Common::NumberBase programmerNumberBase,
|
||||
CalculatorApp::ViewModel::Common::BitLength bitLengthType);
|
||||
CalculatorApp::ViewModelNative::Common::ViewMode mode,
|
||||
CalculatorApp::ViewModelNative::Common::CategoryGroupType modeType,
|
||||
CalculatorApp::ViewModelNative::Common::NumberBase programmerNumberBase,
|
||||
CalculatorApp::ViewModelNative::Common::BitLength bitLengthType);
|
||||
static CopyPasteMaxOperandLengthAndValue GetMaxOperandLengthAndValue(
|
||||
CalculatorApp::ViewModel::Common::ViewMode mode,
|
||||
CalculatorApp::ViewModel::Common::CategoryGroupType modeType,
|
||||
CalculatorApp::ViewModel::Common::NumberBase programmerNumberBase,
|
||||
CalculatorApp::ViewModel::Common::BitLength bitLengthType);
|
||||
CalculatorApp::ViewModelNative::Common::ViewMode mode,
|
||||
CalculatorApp::ViewModelNative::Common::CategoryGroupType modeType,
|
||||
CalculatorApp::ViewModelNative::Common::NumberBase programmerNumberBase,
|
||||
CalculatorApp::ViewModelNative::Common::BitLength bitLengthType);
|
||||
static Windows::Foundation::Collections::IVector<
|
||||
Platform::String ^> ^ ExtractOperands(Platform::String ^ pasteExpression, CalculatorApp::ViewModel::Common::ViewMode mode);
|
||||
Platform::String ^> ^ ExtractOperands(Platform::String ^ pasteExpression, CalculatorApp::ViewModelNative::Common::ViewMode mode);
|
||||
static bool ExpressionRegExMatch(
|
||||
Windows::Foundation::Collections::IVector<Platform::String ^> ^ operands,
|
||||
CalculatorApp::ViewModel::Common::ViewMode mode,
|
||||
CalculatorApp::ViewModel::Common::CategoryGroupType modeType,
|
||||
CalculatorApp::ViewModel::Common::NumberBase programmerNumberBase,
|
||||
CalculatorApp::ViewModel::Common::BitLength bitLengthType);
|
||||
CalculatorApp::ViewModelNative::Common::ViewMode mode,
|
||||
CalculatorApp::ViewModelNative::Common::CategoryGroupType modeType,
|
||||
CalculatorApp::ViewModelNative::Common::NumberBase programmerNumberBase,
|
||||
CalculatorApp::ViewModelNative::Common::BitLength bitLengthType);
|
||||
static Platform::String ^ SanitizeOperand(Platform::String ^ operand);
|
||||
static Platform::String ^ RemoveUnwantedCharsFromString(Platform::String ^ input);
|
||||
static Platform::IBox<unsigned long long int> ^ TryOperandToULL(Platform::String ^ operand, CalculatorApp::ViewModel::Common::NumberBase numberBase);
|
||||
static Platform::IBox<unsigned long long int> ^ TryOperandToULL(Platform::String ^ operand, CalculatorApp::ViewModelNative::Common::NumberBase numberBase);
|
||||
static ULONG32 StandardScientificOperandLength(Platform::String ^ operand);
|
||||
static ULONG32 OperandLength(
|
||||
Platform::String ^ operand,
|
||||
CalculatorApp::ViewModel::Common::ViewMode mode,
|
||||
CalculatorApp::ViewModel::Common::CategoryGroupType modeType,
|
||||
CalculatorApp::ViewModel::Common::NumberBase programmerNumberBase);
|
||||
static ULONG32 ProgrammerOperandLength(Platform::String ^ operand, CalculatorApp::ViewModel::Common::NumberBase numberBase);
|
||||
CalculatorApp::ViewModelNative::Common::ViewMode mode,
|
||||
CalculatorApp::ViewModelNative::Common::CategoryGroupType modeType,
|
||||
CalculatorApp::ViewModelNative::Common::NumberBase programmerNumberBase);
|
||||
static ULONG32 ProgrammerOperandLength(Platform::String ^ operand, CalculatorApp::ViewModelNative::Common::NumberBase numberBase);
|
||||
|
||||
private:
|
||||
static constexpr size_t MaxStandardOperandLengthValue = 16;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
using namespace Platform;
|
||||
using namespace Windows::Foundation;
|
||||
using namespace Windows::Globalization;
|
||||
using namespace CalculatorApp::ViewModel::Common::DateCalculation;
|
||||
using namespace CalculatorApp::ViewModelNative::Common::DateCalculation;
|
||||
|
||||
bool operator==(const DateDifference& l, const DateDifference& r)
|
||||
{
|
||||
|
|
|
@ -13,7 +13,7 @@ const int c_unitsOfDate = 4; // Units Year,Month,Week,Day
|
|||
const int c_unitsGreaterThanDays = 3; // Units Greater than Days (Year/Month/Week) 3
|
||||
const int c_daysInWeek = 7;
|
||||
|
||||
namespace CalculatorApp::ViewModel
|
||||
namespace CalculatorApp::ViewModelNative
|
||||
{
|
||||
namespace Common
|
||||
{
|
||||
|
@ -68,4 +68,4 @@ namespace CalculatorApp::ViewModel
|
|||
}
|
||||
}
|
||||
|
||||
bool operator==(const CalculatorApp::ViewModel::Common::DateCalculation::DateDifference& l, const CalculatorApp::ViewModel::Common::DateCalculation::DateDifference& r);
|
||||
bool operator==(const CalculatorApp::ViewModelNative::Common::DateCalculation::DateDifference& l, const CalculatorApp::ViewModelNative::Common::DateCalculation::DateDifference& r);
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace CalculatorApp::ViewModel
|
||||
namespace CalculatorApp::ViewModelNative
|
||||
{
|
||||
namespace Common
|
||||
{
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include "Utils.h"
|
||||
|
||||
namespace CalculatorApp::ViewModel::Common
|
||||
namespace CalculatorApp::ViewModelNative::Common
|
||||
{
|
||||
public
|
||||
enum class TokenType
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include "EngineResourceProvider.h"
|
||||
#include "Common/LocalizationSettings.h"
|
||||
|
||||
using namespace CalculatorApp::ViewModel::Common;
|
||||
using namespace CalculatorApp::ViewModelNative::Common;
|
||||
using namespace Platform;
|
||||
using namespace Windows::ApplicationModel::Resources;
|
||||
using namespace std;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include "CalcManager/CalculatorResource.h"
|
||||
|
||||
namespace CalculatorApp::ViewModel::Common
|
||||
namespace CalculatorApp::ViewModelNative::Common
|
||||
{
|
||||
class EngineResourceProvider : public CalculationManager::IResourceProvider
|
||||
{
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "pch.h"
|
||||
#include "ExpressionCommandDeserializer.h"
|
||||
|
||||
using namespace CalculatorApp::ViewModel::Common;
|
||||
using namespace CalculatorApp::ViewModelNative::Common;
|
||||
using namespace Windows::Storage::Streams;
|
||||
|
||||
CommandDeserializer::CommandDeserializer(_In_ DataReader ^ dataReader)
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include "CalcManager/ExpressionCommand.h"
|
||||
|
||||
namespace CalculatorApp::ViewModel
|
||||
namespace CalculatorApp::ViewModelNative
|
||||
{
|
||||
namespace Common
|
||||
{
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "pch.h"
|
||||
#include "Common/ExpressionCommandSerializer.h"
|
||||
|
||||
using namespace CalculatorApp::ViewModel::Common;
|
||||
using namespace CalculatorApp::ViewModelNative::Common;
|
||||
using namespace Windows::Storage::Streams;
|
||||
|
||||
SerializeCommandVisitor::SerializeCommandVisitor(_In_ DataWriter ^ dataWriter)
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include "CalcManager/ExpressionCommand.h"
|
||||
|
||||
namespace CalculatorApp::ViewModel
|
||||
namespace CalculatorApp::ViewModelNative
|
||||
{
|
||||
namespace Common
|
||||
{
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
#include "LocalizationSettings.h"
|
||||
#include "AppResourceProvider.h"
|
||||
|
||||
using namespace CalculatorApp::ViewModel::Common;
|
||||
using namespace CalculatorApp::ViewModel::Common::LocalizationServiceProperties;
|
||||
using namespace CalculatorApp::ViewModel;
|
||||
using namespace CalculatorApp::ViewModelNative::Common;
|
||||
using namespace CalculatorApp::ViewModelNative::Common::LocalizationServiceProperties;
|
||||
using namespace CalculatorApp::ViewModelNative;
|
||||
using namespace Concurrency;
|
||||
using namespace Platform;
|
||||
using namespace Platform::Collections;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include "Utils.h"
|
||||
|
||||
namespace CalculatorApp::ViewModel
|
||||
namespace CalculatorApp::ViewModelNative
|
||||
{
|
||||
namespace Common
|
||||
{
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include <iterator>
|
||||
|
||||
namespace CalculatorApp::ViewModel
|
||||
namespace CalculatorApp::ViewModelNative
|
||||
{
|
||||
namespace Common
|
||||
{
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
#include "AppResourceProvider.h"
|
||||
|
||||
namespace CalculatorApp::ViewModel
|
||||
namespace CalculatorApp::ViewModelNative
|
||||
{
|
||||
namespace Common
|
||||
{
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace CalculatorApp::ViewModel
|
||||
namespace CalculatorApp::ViewModelNative
|
||||
{
|
||||
namespace Common
|
||||
{
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
#include <initializer_list>
|
||||
|
||||
using namespace CalculatorApp;
|
||||
using namespace CalculatorApp::ViewModel::Common;
|
||||
using namespace CalculatorApp::ViewModel;
|
||||
using namespace CalculatorApp::ViewModelNative::Common;
|
||||
using namespace CalculatorApp::ViewModelNative;
|
||||
using namespace Concurrency;
|
||||
using namespace Platform;
|
||||
using namespace Platform::Collections;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#include "Utils.h"
|
||||
#include "MyVirtualKey.h"
|
||||
|
||||
namespace CalculatorApp::ViewModel
|
||||
namespace CalculatorApp::ViewModelNative
|
||||
{
|
||||
namespace Common
|
||||
{
|
||||
|
@ -91,7 +91,7 @@ namespace CalculatorApp::ViewModel
|
|||
public ref class NavCategory sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
|
||||
{
|
||||
private:
|
||||
using ViewModeType = ::CalculatorApp::ViewModel::Common::ViewMode;
|
||||
using ViewModeType = ::CalculatorApp::ViewModelNative::Common::ViewMode;
|
||||
public:
|
||||
OBSERVABLE_OBJECT();
|
||||
PROPERTY_R(Platform::String ^, Name);
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
#include "NetworkManager.h"
|
||||
|
||||
using namespace CalculatorApp;
|
||||
using namespace CalculatorApp::ViewModel;
|
||||
using namespace CalculatorApp::ViewModel::Common;
|
||||
using namespace CalculatorApp::ViewModelNative;
|
||||
using namespace CalculatorApp::ViewModelNative::Common;
|
||||
using namespace Platform;
|
||||
using namespace Windows::Networking::Connectivity;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
namespace CalculatorApp::ViewModel::Common
|
||||
namespace CalculatorApp::ViewModelNative::Common
|
||||
{
|
||||
public
|
||||
enum class NetworkAccessBehavior
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// Licensed under the MIT License.
|
||||
|
||||
#pragma once
|
||||
namespace CalculatorApp::ViewModel::Common
|
||||
namespace CalculatorApp::ViewModelNative::Common
|
||||
{
|
||||
public
|
||||
enum class NumberBase
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
namespace CalculatorApp::ViewModel
|
||||
namespace CalculatorApp::ViewModelNative
|
||||
{
|
||||
namespace Common
|
||||
{
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
#include "CalculatorButtonUser.h"
|
||||
|
||||
using namespace CalculatorApp;
|
||||
using namespace CalculatorApp::ViewModel::Common;
|
||||
using namespace CalculatorApp::ViewModel;
|
||||
using namespace CalculatorApp::ViewModelNative::Common;
|
||||
using namespace CalculatorApp::ViewModelNative;
|
||||
using namespace TraceLogging;
|
||||
using namespace Concurrency;
|
||||
using namespace std;
|
||||
|
@ -148,7 +148,7 @@ namespace CalculatorApp
|
|||
TraceLoggingCommon::GetInstance()->LogLevel2Event(StringReference(EVENT_NAME_EXCEPTION), fields);
|
||||
}
|
||||
|
||||
void TraceLogger::LogPlatformExceptionInfo(CalculatorApp::ViewModel::Common::ViewMode mode, Platform::String ^ functionName, Platform::String^ message, int hresult)
|
||||
void TraceLogger::LogPlatformExceptionInfo(CalculatorApp::ViewModelNative::Common::ViewMode mode, Platform::String ^ functionName, Platform::String^ message, int hresult)
|
||||
{
|
||||
auto fields = ref new LoggingFields();
|
||||
fields->AddString(StringReference(CALC_MODE), NavCategoryStates::GetFriendlyName(mode));
|
||||
|
|
|
@ -8,15 +8,15 @@
|
|||
|
||||
// A trace logging provider can only be instantiated and registered once per module.
|
||||
// This class implements a singleton model ensure that only one instance is created.
|
||||
namespace CalculatorApp::ViewModel::Common
|
||||
namespace CalculatorApp::ViewModelNative::Common
|
||||
{
|
||||
struct ButtonLog
|
||||
{
|
||||
public:
|
||||
int count;
|
||||
CalculatorApp::ViewModel::Common::NumbersAndOperatorsEnum button;
|
||||
CalculatorApp::ViewModel::Common::ViewMode mode;
|
||||
ButtonLog(CalculatorApp::ViewModel::Common::NumbersAndOperatorsEnum btn, CalculatorApp::ViewModel::Common::ViewMode vMode)
|
||||
CalculatorApp::ViewModelNative::Common::NumbersAndOperatorsEnum button;
|
||||
CalculatorApp::ViewModelNative::Common::ViewMode mode;
|
||||
ButtonLog(CalculatorApp::ViewModelNative::Common::NumbersAndOperatorsEnum btn, CalculatorApp::ViewModelNative::Common::ViewMode vMode)
|
||||
{
|
||||
button = btn;
|
||||
mode = vMode;
|
||||
|
@ -62,20 +62,20 @@ namespace CalculatorApp::ViewModel::Common
|
|||
public:
|
||||
static TraceLogger ^ GetInstance();
|
||||
|
||||
void LogModeChange(CalculatorApp::ViewModel::Common::ViewMode mode);
|
||||
void LogHistoryItemLoad(CalculatorApp::ViewModel::Common::ViewMode mode, int historyListSize, int loadedIndex);
|
||||
void LogMemoryItemLoad(CalculatorApp::ViewModel::Common::ViewMode mode, int memoryListSize, int loadedIndex);
|
||||
void UpdateButtonUsage(CalculatorApp::ViewModel::Common::NumbersAndOperatorsEnum button, CalculatorApp::ViewModel::Common::ViewMode mode);
|
||||
void LogModeChange(CalculatorApp::ViewModelNative::Common::ViewMode mode);
|
||||
void LogHistoryItemLoad(CalculatorApp::ViewModelNative::Common::ViewMode mode, int historyListSize, int loadedIndex);
|
||||
void LogMemoryItemLoad(CalculatorApp::ViewModelNative::Common::ViewMode mode, int memoryListSize, int loadedIndex);
|
||||
void UpdateButtonUsage(CalculatorApp::ViewModelNative::Common::NumbersAndOperatorsEnum button, CalculatorApp::ViewModelNative::Common::ViewMode mode);
|
||||
void LogButtonUsage();
|
||||
void LogDateCalculationModeUsed(bool AddSubtractMode);
|
||||
void UpdateWindowCount(uint64 windowCount);
|
||||
void DecreaseWindowCount();
|
||||
bool IsWindowIdInLog(int windowId);
|
||||
void LogVisualStateChanged(CalculatorApp::ViewModel::Common::ViewMode mode, Platform::String ^ state, bool isAlwaysOnTop);
|
||||
void LogWindowCreated(CalculatorApp::ViewModel::Common::ViewMode mode, int windowId);
|
||||
void LogConverterInputReceived(CalculatorApp::ViewModel::Common::ViewMode mode);
|
||||
void LogVisualStateChanged(CalculatorApp::ViewModelNative::Common::ViewMode mode, Platform::String ^ state, bool isAlwaysOnTop);
|
||||
void LogWindowCreated(CalculatorApp::ViewModelNative::Common::ViewMode mode, int windowId);
|
||||
void LogConverterInputReceived(CalculatorApp::ViewModelNative::Common::ViewMode mode);
|
||||
void LogNavBarOpened();
|
||||
void LogError(CalculatorApp::ViewModel::Common::ViewMode mode, Platform::String ^ functionName, Platform::String ^ errorString);
|
||||
void LogError(CalculatorApp::ViewModelNative::Common::ViewMode mode, Platform::String ^ functionName, Platform::String ^ errorString);
|
||||
void LogShowHideButtonClicked(bool isHideButton);
|
||||
void LogGraphButtonClicked(GraphButton buttonName, GraphButtonValue buttonValue);
|
||||
void LogGraphLineStyleChanged(LineStyleType style);
|
||||
|
@ -83,12 +83,12 @@ namespace CalculatorApp::ViewModel::Common
|
|||
void LogVariableSettingsChanged(Platform::String ^ setting);
|
||||
void LogGraphSettingsChanged(GraphSettingsType settingsType, Platform::String ^ settingValue);
|
||||
void LogGraphTheme(Platform::String ^ graphTheme);
|
||||
void LogInputPasted(CalculatorApp::ViewModel::Common::ViewMode mode);
|
||||
void LogPlatformExceptionInfo(CalculatorApp::ViewModel::Common::ViewMode mode, Platform::String ^ functionName, Platform::String ^ message, int hresult);
|
||||
void LogInputPasted(CalculatorApp::ViewModelNative::Common::ViewMode mode);
|
||||
void LogPlatformExceptionInfo(CalculatorApp::ViewModelNative::Common::ViewMode mode, Platform::String ^ functionName, Platform::String ^ message, int hresult);
|
||||
|
||||
internal:
|
||||
void LogPlatformException(CalculatorApp::ViewModel::Common::ViewMode mode, Platform::String ^ functionName, Platform::Exception ^ e);
|
||||
void LogStandardException(CalculatorApp::ViewModel::Common::ViewMode mode, std::wstring_view functionName, _In_ const std::exception& e);
|
||||
void LogPlatformException(CalculatorApp::ViewModelNative::Common::ViewMode mode, Platform::String ^ functionName, Platform::Exception ^ e);
|
||||
void LogStandardException(CalculatorApp::ViewModelNative::Common::ViewMode mode, std::wstring_view functionName, _In_ const std::exception& e);
|
||||
|
||||
private:
|
||||
// Create an instance of TraceLogger
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#include "Common/ExpressionCommandDeserializer.h"
|
||||
|
||||
using namespace CalculatorApp;
|
||||
using namespace CalculatorApp::ViewModel::Common;
|
||||
using namespace CalculatorApp::ViewModelNative::Common;
|
||||
using namespace concurrency;
|
||||
using namespace Graphing::Renderer;
|
||||
using namespace Platform;
|
||||
|
@ -47,20 +47,6 @@ double Utils::GetDoubleFromWstring(wstring input)
|
|||
return stod(ws);
|
||||
}
|
||||
|
||||
// Returns windowId for the current view
|
||||
int Utils::GetWindowId()
|
||||
{
|
||||
int windowId = -1;
|
||||
|
||||
auto window = CoreWindow::GetForCurrentThread();
|
||||
if (window != nullptr)
|
||||
{
|
||||
windowId = ApplicationView::GetApplicationViewIdForWindow(window);
|
||||
}
|
||||
|
||||
return windowId;
|
||||
}
|
||||
|
||||
void Utils::RunOnUIThreadNonblocking(std::function<void()>&& function, _In_ CoreDispatcher ^ currentDispatcher)
|
||||
{
|
||||
if (currentDispatcher != nullptr)
|
||||
|
@ -181,7 +167,7 @@ bool operator!=(const Color& color1, const Color& color2)
|
|||
return !(color1 == color2);
|
||||
}
|
||||
|
||||
String^ CalculatorApp::ViewModel::Common::Utilities::EscapeHtmlSpecialCharacters(String^ originalString)
|
||||
String^ CalculatorApp::ViewModelNative::Common::Utilities::EscapeHtmlSpecialCharacters(String^ originalString)
|
||||
{
|
||||
// Construct a default special characters if not provided.
|
||||
const std::vector<wchar_t> specialCharacters {L'&', L'\"', L'\'', L'<', L'>'};
|
||||
|
@ -238,7 +224,7 @@ String^ CalculatorApp::ViewModel::Common::Utilities::EscapeHtmlSpecialCharacters
|
|||
return replaceCharacters ? replacementString : originalString;
|
||||
}
|
||||
|
||||
bool CalculatorApp::ViewModel::Common::Utilities::AreColorsEqual(Windows::UI::Color color1, Windows::UI::Color color2)
|
||||
bool CalculatorApp::ViewModelNative::Common::Utilities::AreColorsEqual(Windows::UI::Color color1, Windows::UI::Color color2)
|
||||
{
|
||||
return Utils::AreColorsEqual(color1, color2);
|
||||
}
|
||||
|
@ -246,7 +232,7 @@ bool CalculatorApp::ViewModel::Common::Utilities::AreColorsEqual(Windows::UI::Co
|
|||
// This method calculates the luminance ratio between White and the given background color.
|
||||
// The luminance is calculate using the RGB values and does not use the A value.
|
||||
// White or Black is returned
|
||||
SolidColorBrush ^ CalculatorApp::ViewModel::Common::Utilities::GetContrastColor(Color backgroundColor)
|
||||
SolidColorBrush ^ CalculatorApp::ViewModelNative::Common::Utilities::GetContrastColor(Color backgroundColor)
|
||||
{
|
||||
auto luminance = 0.2126 * backgroundColor.R + 0.7152 * backgroundColor.G + 0.0722 * backgroundColor.B;
|
||||
|
||||
|
@ -258,17 +244,12 @@ SolidColorBrush ^ CalculatorApp::ViewModel::Common::Utilities::GetContrastColor(
|
|||
return static_cast<SolidColorBrush ^>(Application::Current->Resources->Lookup(L"BlackBrush"));
|
||||
}
|
||||
|
||||
int CalculatorApp::ViewModel::Common::Utilities::GetWindowId()
|
||||
{
|
||||
return Utils::GetWindowId();
|
||||
}
|
||||
|
||||
long long CalculatorApp::ViewModel::Common::Utilities::GetConst_WINEVENT_KEYWORD_RESPONSE_TIME()
|
||||
long long CalculatorApp::ViewModelNative::Common::Utilities::GetConst_WINEVENT_KEYWORD_RESPONSE_TIME()
|
||||
{
|
||||
return WINEVENT_KEYWORD_RESPONSE_TIME;
|
||||
}
|
||||
|
||||
bool CalculatorApp::ViewModel::Common::Utilities::GetIntegratedDisplaySize(double* size)
|
||||
bool CalculatorApp::ViewModelNative::Common::Utilities::GetIntegratedDisplaySize(double* size)
|
||||
{
|
||||
if (SUCCEEDED(::GetIntegratedDisplaySize(size)))
|
||||
return true;
|
||||
|
|
|
@ -174,8 +174,8 @@ public:
|
|||
{ \
|
||||
if (!donotuse_##p) \
|
||||
{ \
|
||||
donotuse_##p = ref new CalculatorApp::ViewModel::Common::DelegateCommand( \
|
||||
CalculatorApp::ViewModel::Common::MakeDelegateCommandHandler(this, &m) \
|
||||
donotuse_##p = ref new CalculatorApp::ViewModelNative::Common::DelegateCommand( \
|
||||
CalculatorApp::ViewModelNative::Common::MakeDelegateCommandHandler(this, &m) \
|
||||
); \
|
||||
} \
|
||||
return donotuse_##p; \
|
||||
|
@ -394,7 +394,6 @@ namespace Utils
|
|||
}
|
||||
|
||||
double GetDoubleFromWstring(std::wstring input);
|
||||
int GetWindowId();
|
||||
void RunOnUIThreadNonblocking(std::function<void()>&& function, _In_ Windows::UI::Core::CoreDispatcher ^ currentDispatcher);
|
||||
|
||||
Windows::Foundation::DateTime GetUniversalSystemTime();
|
||||
|
@ -705,7 +704,7 @@ namespace CalculatorApp
|
|||
return to;
|
||||
}
|
||||
|
||||
namespace ViewModel::Common
|
||||
namespace ViewModelNative::Common
|
||||
{
|
||||
// below utilities are intended to support interops between C# and C++/CX
|
||||
// they can be removed if the entire codebase has been migrated to C#
|
||||
|
@ -715,7 +714,6 @@ namespace CalculatorApp
|
|||
static Platform::String ^ EscapeHtmlSpecialCharacters(Platform::String ^ originalString);
|
||||
static bool AreColorsEqual(Windows::UI::Color color1, Windows::UI::Color color2);
|
||||
static Windows::UI::Xaml::Media::SolidColorBrush ^ GetContrastColor(Windows::UI::Color backgroundColor);
|
||||
static int GetWindowId();
|
||||
static long long GetConst_WINEVENT_KEYWORD_RESPONSE_TIME();
|
||||
static bool GetIntegratedDisplaySize(double* size);
|
||||
};
|
||||
|
|
|
@ -11,11 +11,11 @@
|
|||
#include "UnitConverterDataConstants.h"
|
||||
|
||||
using namespace CalculatorApp;
|
||||
using namespace CalculatorApp::ViewModel::Common;
|
||||
using namespace CalculatorApp::ViewModel::Common::LocalizationServiceProperties;
|
||||
using namespace CalculatorApp::ViewModel::DataLoaders;
|
||||
using namespace CalculatorApp::ViewModel;
|
||||
using namespace CalculatorApp::ViewModel::DataLoaders::CurrencyDataLoaderConstants;
|
||||
using namespace CalculatorApp::ViewModelNative::Common;
|
||||
using namespace CalculatorApp::ViewModelNative::Common::LocalizationServiceProperties;
|
||||
using namespace CalculatorApp::ViewModelNative::DataLoaders;
|
||||
using namespace CalculatorApp::ViewModelNative;
|
||||
using namespace CalculatorApp::ViewModelNative::DataLoaders::CurrencyDataLoaderConstants;
|
||||
using namespace concurrency;
|
||||
using namespace Platform;
|
||||
using namespace std;
|
||||
|
@ -69,7 +69,7 @@ static constexpr auto DEFAULT_TO_CURRENCY = L"EUR";
|
|||
|
||||
namespace CalculatorApp
|
||||
{
|
||||
namespace ViewModel::DataLoaders
|
||||
namespace ViewModelNative::DataLoaders
|
||||
{
|
||||
namespace UnitConverterResourceKeys
|
||||
{
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
namespace CalculatorApp
|
||||
{
|
||||
namespace ViewModel::DataLoaders
|
||||
namespace ViewModelNative::DataLoaders
|
||||
{
|
||||
public
|
||||
enum class CurrencyLoadStatus
|
||||
|
@ -55,7 +55,7 @@ namespace CalculatorApp
|
|||
{
|
||||
public:
|
||||
CurrencyDataLoader(
|
||||
_In_ std::unique_ptr<CalculatorApp::ViewModel::DataLoaders::ICurrencyHttpClient> client,
|
||||
_In_ std::unique_ptr<CalculatorApp::ViewModelNative::DataLoaders::ICurrencyHttpClient> client,
|
||||
const wchar_t* overrideLanguage = nullptr);
|
||||
~CurrencyDataLoader();
|
||||
|
||||
|
@ -84,7 +84,7 @@ namespace CalculatorApp
|
|||
std::future<bool> TryLoadDataFromWebOverrideAsync() override;
|
||||
// ICurrencyConverterDataLoader
|
||||
|
||||
void OnNetworkBehaviorChanged(CalculatorApp::ViewModel::Common::NetworkAccessBehavior newBehavior);
|
||||
void OnNetworkBehaviorChanged(CalculatorApp::ViewModelNative::Common::NetworkAccessBehavior newBehavior);
|
||||
|
||||
private:
|
||||
void ResetLoadStatus();
|
||||
|
@ -114,7 +114,7 @@ namespace CalculatorApp
|
|||
|
||||
private:
|
||||
Platform::String ^ m_responseLanguage;
|
||||
std::unique_ptr<CalculatorApp::ViewModel::DataLoaders::ICurrencyHttpClient> m_client;
|
||||
std::unique_ptr<CalculatorApp::ViewModelNative::DataLoaders::ICurrencyHttpClient> m_client;
|
||||
|
||||
bool m_isRtlLanguage;
|
||||
|
||||
|
@ -132,8 +132,8 @@ namespace CalculatorApp
|
|||
|
||||
CurrencyLoadStatus m_loadStatus;
|
||||
|
||||
CalculatorApp::ViewModel::Common::NetworkManager ^ m_networkManager;
|
||||
CalculatorApp::ViewModel::Common::NetworkAccessBehavior m_networkAccessBehavior;
|
||||
CalculatorApp::ViewModelNative::Common::NetworkManager ^ m_networkManager;
|
||||
CalculatorApp::ViewModelNative::Common::NetworkAccessBehavior m_networkAccessBehavior;
|
||||
Windows::Foundation::EventRegistrationToken m_networkBehaviorToken;
|
||||
bool m_meteredOverrideSet;
|
||||
};
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#endif
|
||||
|
||||
using namespace CalculatorApp::DataLoaders;
|
||||
using namespace CalculatorApp::ViewModel::DataLoaders;
|
||||
using namespace CalculatorApp::ViewModelNative::DataLoaders;
|
||||
using namespace Platform;
|
||||
using namespace std;
|
||||
using namespace Windows::Foundation;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#pragma once
|
||||
|
@ -7,7 +7,7 @@
|
|||
|
||||
namespace CalculatorApp
|
||||
{
|
||||
namespace ViewModel::DataLoaders
|
||||
namespace ViewModelNative::DataLoaders
|
||||
{
|
||||
class CurrencyHttpClient : public ICurrencyHttpClient
|
||||
{
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace CalculatorApp
|
||||
{
|
||||
namespace ViewModel::DataLoaders
|
||||
namespace ViewModelNative::DataLoaders
|
||||
{
|
||||
class ICurrencyHttpClient
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
namespace CalculatorApp
|
||||
{
|
||||
namespace ViewModel::Common
|
||||
namespace ViewModelNative::Common
|
||||
{
|
||||
private
|
||||
enum UnitConverterUnits
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
#include "UnitConverterDataConstants.h"
|
||||
#include "CurrencyDataLoader.h"
|
||||
|
||||
using namespace CalculatorApp::ViewModel::Common;
|
||||
using namespace CalculatorApp::ViewModel::DataLoaders;
|
||||
using namespace CalculatorApp::ViewModel;
|
||||
using namespace CalculatorApp::ViewModelNative::Common;
|
||||
using namespace CalculatorApp::ViewModelNative::DataLoaders;
|
||||
using namespace CalculatorApp::ViewModelNative;
|
||||
using namespace Platform;
|
||||
using namespace std;
|
||||
using namespace Windows::ApplicationModel::Resources;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
namespace CalculatorApp
|
||||
{
|
||||
namespace ViewModel::Common
|
||||
namespace ViewModelNative::Common
|
||||
{
|
||||
struct OrderedUnit : UnitConversionManager::Unit
|
||||
{
|
||||
|
@ -34,7 +34,7 @@ namespace CalculatorApp
|
|||
|
||||
struct UnitData
|
||||
{
|
||||
CalculatorApp::ViewModel::Common::ViewMode categoryId;
|
||||
CalculatorApp::ViewModelNative::Common::ViewMode categoryId;
|
||||
int unitId;
|
||||
double factor;
|
||||
};
|
||||
|
@ -45,7 +45,7 @@ namespace CalculatorApp
|
|||
{
|
||||
}
|
||||
ExplicitUnitConversionData(
|
||||
CalculatorApp::ViewModel::Common::ViewMode categoryId,
|
||||
CalculatorApp::ViewModelNative::Common::ViewMode categoryId,
|
||||
int parentUnitId,
|
||||
int unitId,
|
||||
double ratio,
|
||||
|
@ -58,7 +58,7 @@ namespace CalculatorApp
|
|||
{
|
||||
}
|
||||
|
||||
CalculatorApp::ViewModel::Common::ViewMode categoryId;
|
||||
CalculatorApp::ViewModelNative::Common::ViewMode categoryId;
|
||||
int parentUnitId;
|
||||
int unitId;
|
||||
};
|
||||
|
@ -79,8 +79,8 @@ namespace CalculatorApp
|
|||
// IConverterDataLoader
|
||||
|
||||
void GetCategories(_In_ std::shared_ptr<std::vector<UnitConversionManager::Category>> categoriesList);
|
||||
void GetUnits(_In_ std::unordered_map<CalculatorApp::ViewModel::Common::ViewMode, std::vector<CalculatorApp::ViewModel::Common::OrderedUnit>>& unitMap);
|
||||
void GetConversionData(_In_ std::unordered_map<CalculatorApp::ViewModel::Common::ViewMode, std::unordered_map<int, double>>& categoryToUnitConversionMap);
|
||||
void GetUnits(_In_ std::unordered_map<CalculatorApp::ViewModelNative::Common::ViewMode, std::vector<CalculatorApp::ViewModelNative::Common::OrderedUnit>>& unitMap);
|
||||
void GetConversionData(_In_ std::unordered_map<CalculatorApp::ViewModelNative::Common::ViewMode, std::unordered_map<int, double>>& categoryToUnitConversionMap);
|
||||
void GetExplicitConversionData(_In_ std::unordered_map<int, std::unordered_map<int, UnitConversionManager::ConversionData>>& unitToUnitConversionList);
|
||||
|
||||
std::wstring GetLocalizedStringName(_In_ Platform::String ^ stringId);
|
||||
|
|
|
@ -10,9 +10,9 @@
|
|||
#include "Common/CopyPasteManager.h"
|
||||
|
||||
using namespace CalculatorApp;
|
||||
using namespace CalculatorApp::ViewModel::Common;
|
||||
using namespace CalculatorApp::ViewModel::Common::DateCalculation;
|
||||
using namespace CalculatorApp::ViewModel;
|
||||
using namespace CalculatorApp::ViewModelNative::Common;
|
||||
using namespace CalculatorApp::ViewModelNative::Common::DateCalculation;
|
||||
using namespace CalculatorApp::ViewModelNative;
|
||||
using namespace Platform;
|
||||
using namespace Platform::Collections;
|
||||
using namespace std;
|
||||
|
|
|
@ -10,7 +10,7 @@ const int c_maxOffsetValue = 999;
|
|||
|
||||
namespace CalculatorApp
|
||||
{
|
||||
namespace ViewModel
|
||||
namespace ViewModelNative
|
||||
{
|
||||
[Windows::UI::Xaml::Data::Bindable] public ref class DateCalculatorViewModel sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
|
||||
{
|
||||
|
@ -125,26 +125,26 @@ namespace CalculatorApp
|
|||
}
|
||||
}
|
||||
|
||||
property CalculatorApp::ViewModel::Common::DateCalculation::DateDifference DateDiffResult
|
||||
property CalculatorApp::ViewModelNative::Common::DateCalculation::DateDifference DateDiffResult
|
||||
{
|
||||
CalculatorApp::ViewModel::Common::DateCalculation::DateDifference get()
|
||||
CalculatorApp::ViewModelNative::Common::DateCalculation::DateDifference get()
|
||||
{
|
||||
return m_dateDiffResult;
|
||||
}
|
||||
void set(CalculatorApp::ViewModel::Common::DateCalculation::DateDifference value)
|
||||
void set(CalculatorApp::ViewModelNative::Common::DateCalculation::DateDifference value)
|
||||
{
|
||||
m_dateDiffResult = value;
|
||||
UpdateDisplayResult();
|
||||
}
|
||||
}
|
||||
|
||||
property CalculatorApp::ViewModel::Common::DateCalculation::DateDifference DateDiffResultInDays
|
||||
property CalculatorApp::ViewModelNative::Common::DateCalculation::DateDifference DateDiffResultInDays
|
||||
{
|
||||
CalculatorApp::ViewModel::Common::DateCalculation::DateDifference get()
|
||||
CalculatorApp::ViewModelNative::Common::DateCalculation::DateDifference get()
|
||||
{
|
||||
return m_dateDiffResultInDays;
|
||||
}
|
||||
void set(CalculatorApp::ViewModel::Common::DateCalculation::DateDifference value)
|
||||
void set(CalculatorApp::ViewModelNative::Common::DateCalculation::DateDifference value)
|
||||
{
|
||||
m_dateDiffResultInDays = value;
|
||||
UpdateDisplayResult();
|
||||
|
@ -172,13 +172,13 @@ namespace CalculatorApp
|
|||
Windows::Foundation::DateTime m_toDate;
|
||||
Windows::Foundation::DateTime m_startDate;
|
||||
Windows::Foundation::DateTime m_dateResult;
|
||||
CalculatorApp::ViewModel::Common::DateCalculation::DateDifference m_dateDiffResult;
|
||||
CalculatorApp::ViewModel::Common::DateCalculation::DateDifference m_dateDiffResultInDays;
|
||||
CalculatorApp::ViewModelNative::Common::DateCalculation::DateDifference m_dateDiffResult;
|
||||
CalculatorApp::ViewModelNative::Common::DateCalculation::DateDifference m_dateDiffResultInDays;
|
||||
|
||||
// Private members
|
||||
CalculatorApp::ViewModel::Common::DateCalculation::DateCalculationEngine ^ m_dateCalcEngine;
|
||||
CalculatorApp::ViewModel::Common::DateCalculation::DateUnit m_daysOutputFormat;
|
||||
CalculatorApp::ViewModel::Common::DateCalculation::DateUnit m_allDateUnitsOutputFormat;
|
||||
CalculatorApp::ViewModelNative::Common::DateCalculation::DateCalculationEngine ^ m_dateCalcEngine;
|
||||
CalculatorApp::ViewModelNative::Common::DateCalculation::DateUnit m_daysOutputFormat;
|
||||
CalculatorApp::ViewModelNative::Common::DateCalculation::DateUnit m_allDateUnitsOutputFormat;
|
||||
Windows::Globalization::DateTimeFormatting::DateTimeFormatter ^ m_dateTimeFormatter;
|
||||
std::wstring m_listSeparator;
|
||||
};
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "CalcViewModel\Common\LocalizationSettings.h"
|
||||
#include "CalcViewModel\GraphingCalculatorEnums.h"
|
||||
|
||||
using namespace CalculatorApp::ViewModel::Common;
|
||||
using namespace CalculatorApp::ViewModelNative::Common;
|
||||
using namespace Graphing;
|
||||
using namespace Platform;
|
||||
using namespace Platform::Collections;
|
||||
|
@ -17,7 +17,7 @@ using namespace Windows::UI::Xaml;
|
|||
using namespace Windows::Foundation::Collections;
|
||||
using namespace GraphControl;
|
||||
|
||||
namespace CalculatorApp::ViewModel
|
||||
namespace CalculatorApp::ViewModelNative
|
||||
{
|
||||
GridDisplayItems::GridDisplayItems()
|
||||
: m_Expression{ "" }
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace GraphControl
|
|||
ref class KeyGraphFeaturesInfo;
|
||||
}
|
||||
|
||||
namespace CalculatorApp::ViewModel
|
||||
namespace CalculatorApp::ViewModelNative
|
||||
{
|
||||
public
|
||||
ref class GridDisplayItems sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
|
||||
|
@ -100,7 +100,7 @@ public
|
|||
// Key Graph Features
|
||||
OBSERVABLE_PROPERTY_R(Platform::String ^, AnalysisErrorString);
|
||||
OBSERVABLE_PROPERTY_R(bool, AnalysisErrorVisible);
|
||||
OBSERVABLE_PROPERTY_R(Windows::Foundation::Collections::IObservableVector<CalculatorApp::ViewModel::KeyGraphFeaturesItem ^> ^, KeyGraphFeaturesItems)
|
||||
OBSERVABLE_PROPERTY_R(Windows::Foundation::Collections::IObservableVector<CalculatorApp::ViewModelNative::KeyGraphFeaturesItem ^> ^, KeyGraphFeaturesItems)
|
||||
|
||||
void PopulateKeyGraphFeatures(GraphControl::KeyGraphFeaturesInfo ^ info);
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "pch.h"
|
||||
#include "GraphingCalculatorViewModel.h"
|
||||
|
||||
using namespace CalculatorApp::ViewModel;
|
||||
using namespace CalculatorApp::ViewModelNative;
|
||||
using namespace Platform;
|
||||
using namespace Platform::Collections;
|
||||
using namespace Windows::Foundation;
|
||||
|
@ -12,7 +12,7 @@ using namespace Windows::Foundation::Collections;
|
|||
using namespace Windows::UI::Xaml::Data;
|
||||
using namespace GraphControl;
|
||||
|
||||
namespace CalculatorApp::ViewModel
|
||||
namespace CalculatorApp::ViewModelNative
|
||||
{
|
||||
GraphingCalculatorViewModel::GraphingCalculatorViewModel()
|
||||
: m_IsDecimalEnabled{ true }
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include "EquationViewModel.h"
|
||||
#include "VariableViewModel.h"
|
||||
|
||||
namespace CalculatorApp::ViewModel
|
||||
namespace CalculatorApp::ViewModelNative
|
||||
{
|
||||
[Windows::UI::Xaml::Data::Bindable] public ref class GraphingCalculatorViewModel sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
|
||||
{
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
#include "pch.h"
|
||||
#include "GraphingSettingsViewModel.h"
|
||||
|
||||
using namespace CalculatorApp::ViewModel;
|
||||
using namespace CalculatorApp::ViewModel::Common;
|
||||
using namespace CalculatorApp::ViewModelNative;
|
||||
using namespace CalculatorApp::ViewModelNative::Common;
|
||||
using namespace GraphControl;
|
||||
using namespace std;
|
||||
using namespace Platform;
|
||||
|
@ -102,7 +102,7 @@ void GraphingSettingsViewModel::UpdateDisplayRange()
|
|||
|
||||
m_Graph->SetDisplayRanges(m_XMinValue, m_XMaxValue, m_YMinValue, m_YMaxValue);
|
||||
|
||||
CalculatorApp::ViewModel::Common::TraceLogger::GetInstance()->LogGraphSettingsChanged(GraphSettingsType::Grid, L"");
|
||||
CalculatorApp::ViewModelNative::Common::TraceLogger::GetInstance()->LogGraphSettingsChanged(GraphSettingsType::Grid, L"");
|
||||
}
|
||||
|
||||
bool GraphingSettingsViewModel::HasError()
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "../Common/Utils.h"
|
||||
#include "CalcViewModel/Common/TraceLogger.h"
|
||||
|
||||
namespace CalculatorApp::ViewModel
|
||||
namespace CalculatorApp::ViewModelNative
|
||||
{
|
||||
#pragma once
|
||||
[Windows::UI::Xaml::Data::Bindable] public ref class GraphingSettingsViewModel sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
|
||||
|
@ -204,7 +204,7 @@ namespace CalculatorApp::ViewModel
|
|||
RaisePropertyChanged(L"TrigModeDegrees");
|
||||
RaisePropertyChanged(L"TrigModeGradians");
|
||||
|
||||
CalculatorApp::ViewModel::Common::TraceLogger::GetInstance()->LogGraphSettingsChanged(CalculatorApp::ViewModel::Common::GraphSettingsType::TrigUnits, L"Radians");
|
||||
CalculatorApp::ViewModelNative::Common::TraceLogger::GetInstance()->LogGraphSettingsChanged(CalculatorApp::ViewModelNative::Common::GraphSettingsType::TrigUnits, L"Radians");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -225,7 +225,7 @@ namespace CalculatorApp::ViewModel
|
|||
RaisePropertyChanged(L"TrigModeRadians");
|
||||
RaisePropertyChanged(L"TrigModeGradians");
|
||||
|
||||
CalculatorApp::ViewModel::Common::TraceLogger::GetInstance()->LogGraphSettingsChanged(CalculatorApp::ViewModel::Common::GraphSettingsType::TrigUnits, L"Degrees");
|
||||
CalculatorApp::ViewModelNative::Common::TraceLogger::GetInstance()->LogGraphSettingsChanged(CalculatorApp::ViewModelNative::Common::GraphSettingsType::TrigUnits, L"Degrees");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -246,7 +246,7 @@ namespace CalculatorApp::ViewModel
|
|||
RaisePropertyChanged(L"TrigModeDegrees");
|
||||
RaisePropertyChanged(L"TrigModeRadians");
|
||||
|
||||
CalculatorApp::ViewModel::Common::TraceLogger::GetInstance()->LogGraphSettingsChanged(CalculatorApp::ViewModel::Common::GraphSettingsType::TrigUnits, L"Gradians");
|
||||
CalculatorApp::ViewModelNative::Common::TraceLogger::GetInstance()->LogGraphSettingsChanged(CalculatorApp::ViewModelNative::Common::GraphSettingsType::TrigUnits, L"Gradians");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include "CalcViewModel/Common/LocalizationStringUtil.h"
|
||||
#include "EquationViewModel.h"
|
||||
|
||||
namespace CalculatorApp::ViewModel
|
||||
namespace CalculatorApp::ViewModelNative
|
||||
{
|
||||
|
||||
inline constexpr int DefaultMinMaxRange = 10;
|
||||
|
@ -127,8 +127,8 @@ public
|
|||
{
|
||||
Platform::String ^ get()
|
||||
{
|
||||
return CalculatorApp::ViewModel::Common::LocalizationStringUtil::GetLocalizedString(
|
||||
CalculatorApp::ViewModel::Common::AppResourceProvider::GetInstance()->GetResourceString(L"VariableListViewItem"), Name);
|
||||
return CalculatorApp::ViewModelNative::Common::LocalizationStringUtil::GetLocalizedString(
|
||||
CalculatorApp::ViewModelNative::Common::AppResourceProvider::GetInstance()->GetResourceString(L"VariableListViewItem"), Name);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
#include "HistoryItemViewModel.h"
|
||||
#include "Common/LocalizationService.h"
|
||||
|
||||
using namespace CalculatorApp::ViewModel::Common;
|
||||
using namespace CalculatorApp::ViewModel;
|
||||
using namespace CalculatorApp::ViewModelNative::Common;
|
||||
using namespace CalculatorApp::ViewModelNative;
|
||||
using namespace std;
|
||||
using namespace Platform;
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
namespace CalculatorApp
|
||||
{
|
||||
namespace ViewModel
|
||||
namespace ViewModelNative
|
||||
{
|
||||
[Windows::UI::Xaml::Data::Bindable] public ref class HistoryItemViewModel sealed
|
||||
{
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
#include "StandardCalculatorViewModel.h"
|
||||
|
||||
using namespace CalculatorApp;
|
||||
using namespace CalculatorApp::ViewModel::Common;
|
||||
using namespace CalculatorApp::ViewModel::Common::Automation;
|
||||
using namespace CalculatorApp::ViewModel;
|
||||
using namespace CalculatorApp::ViewModelNative::Common;
|
||||
using namespace CalculatorApp::ViewModelNative::Common::Automation;
|
||||
using namespace CalculatorApp::ViewModelNative;
|
||||
using namespace Platform;
|
||||
using namespace std;
|
||||
using namespace Windows::Foundation;
|
||||
|
|
|
@ -13,14 +13,14 @@ namespace CalculatorApp
|
|||
{
|
||||
namespace CM = CalculationManager;
|
||||
|
||||
namespace ViewModel
|
||||
namespace ViewModelNative
|
||||
{
|
||||
ref class StandardCalculatorViewModel;
|
||||
|
||||
public
|
||||
delegate void HideHistoryClickedHandler();
|
||||
public
|
||||
delegate void HistoryItemClickedHandler(CalculatorApp::ViewModel::HistoryItemViewModel ^ e);
|
||||
delegate void HistoryItemClickedHandler(CalculatorApp::ViewModelNative::HistoryItemViewModel ^ e);
|
||||
|
||||
[Windows::UI::Xaml::Data::Bindable] public ref class HistoryViewModel sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
|
||||
{
|
||||
|
@ -28,7 +28,7 @@ namespace CalculatorApp
|
|||
OBSERVABLE_OBJECT();
|
||||
OBSERVABLE_PROPERTY_R(Windows::Foundation::Collections::IObservableVector<HistoryItemViewModel ^> ^, Items);
|
||||
OBSERVABLE_PROPERTY_RW(bool, AreHistoryShortcutsEnabled);
|
||||
OBSERVABLE_PROPERTY_R(CalculatorApp::ViewModel::Common::Automation::NarratorAnnouncement ^, HistoryAnnouncement);
|
||||
OBSERVABLE_PROPERTY_R(CalculatorApp::ViewModelNative::Common::Automation::NarratorAnnouncement ^, HistoryAnnouncement);
|
||||
property int ItemsCount
|
||||
{
|
||||
int get()
|
||||
|
@ -47,9 +47,9 @@ namespace CalculatorApp
|
|||
// events that are created
|
||||
event HideHistoryClickedHandler ^ HideHistoryClicked;
|
||||
event HistoryItemClickedHandler ^ HistoryItemClicked;
|
||||
void ShowItem(_In_ CalculatorApp::ViewModel::HistoryItemViewModel ^ e);
|
||||
void DeleteItem(_In_ CalculatorApp::ViewModel::HistoryItemViewModel ^ e);
|
||||
void ReloadHistory(_In_ CalculatorApp::ViewModel::Common::ViewMode currentMode);
|
||||
void ShowItem(_In_ CalculatorApp::ViewModelNative::HistoryItemViewModel ^ e);
|
||||
void DeleteItem(_In_ CalculatorApp::ViewModelNative::HistoryItemViewModel ^ e);
|
||||
void ReloadHistory(_In_ CalculatorApp::ViewModelNative::Common::ViewMode currentMode);
|
||||
|
||||
internal : HistoryViewModel(_In_ CalculationManager::CalculatorManager* calculatorManager);
|
||||
void SetCalculatorDisplay(Common::CalculatorDisplay& calculatorDisplay);
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
#include "StandardCalculatorViewModel.h"
|
||||
|
||||
using namespace CalculatorApp;
|
||||
using namespace CalculatorApp::ViewModel::Common;
|
||||
using namespace CalculatorApp::ViewModel::Common::Automation;
|
||||
using namespace CalculatorApp::ViewModel;
|
||||
using namespace CalculatorApp::ViewModelNative::Common;
|
||||
using namespace CalculatorApp::ViewModelNative::Common::Automation;
|
||||
using namespace CalculatorApp::ViewModelNative;
|
||||
using namespace Platform;
|
||||
using namespace std;
|
||||
using namespace Windows::Foundation;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
namespace CalculatorApp
|
||||
{
|
||||
namespace ViewModel
|
||||
namespace ViewModelNative
|
||||
{
|
||||
ref class StandardCalculatorViewModel;
|
||||
|
||||
|
|
|
@ -10,9 +10,9 @@
|
|||
#include "Common/TraceLogger.h"
|
||||
|
||||
using namespace CalculatorApp;
|
||||
using namespace CalculatorApp::ViewModel::Common;
|
||||
using namespace CalculatorApp::ViewModel::Common::Automation;
|
||||
using namespace CalculatorApp::ViewModel;
|
||||
using namespace CalculatorApp::ViewModelNative::Common;
|
||||
using namespace CalculatorApp::ViewModelNative::Common::Automation;
|
||||
using namespace CalculatorApp::ViewModelNative;
|
||||
using namespace CalculationManager;
|
||||
using namespace concurrency;
|
||||
using namespace Platform;
|
||||
|
@ -1732,7 +1732,7 @@ ViewMode StandardCalculatorViewModel::GetCalculatorMode()
|
|||
return ViewMode::Programmer;
|
||||
}
|
||||
|
||||
void StandardCalculatorViewModel::ValueBitLength::set(CalculatorApp::ViewModel::Common::BitLength value)
|
||||
void StandardCalculatorViewModel::ValueBitLength::set(CalculatorApp::ViewModelNative::Common::BitLength value)
|
||||
{
|
||||
if (m_valueBitLength != value)
|
||||
{
|
||||
|
|
|
@ -22,14 +22,14 @@ namespace CalculatorApp
|
|||
namespace WS = Windows::System;
|
||||
namespace CM = CalculationManager;
|
||||
|
||||
namespace ViewModel
|
||||
namespace ViewModelNative
|
||||
{
|
||||
#define ASCII_0 48
|
||||
public delegate void HideMemoryClickedHandler();
|
||||
|
||||
public value struct ButtonInfo
|
||||
{
|
||||
CalculatorApp::ViewModel::Common::NumbersAndOperatorsEnum buttonId;
|
||||
CalculatorApp::ViewModelNative::Common::NumbersAndOperatorsEnum buttonId;
|
||||
bool canSendNegate;
|
||||
};
|
||||
|
||||
|
@ -73,12 +73,12 @@ namespace CalculatorApp
|
|||
OBSERVABLE_PROPERTY_R(Platform::String ^, CalculationResultAutomationName);
|
||||
OBSERVABLE_PROPERTY_R(Platform::String ^, CalculationExpressionAutomationName);
|
||||
OBSERVABLE_PROPERTY_R(bool, IsShiftProgrammerChecked);
|
||||
OBSERVABLE_PROPERTY_R(CalculatorApp::ViewModel::Common::NumberBase, CurrentRadixType);
|
||||
OBSERVABLE_PROPERTY_R(CalculatorApp::ViewModelNative::Common::NumberBase, CurrentRadixType);
|
||||
OBSERVABLE_PROPERTY_R(bool, AreTokensUpdated);
|
||||
OBSERVABLE_PROPERTY_R(bool, AreAlwaysOnTopResultsUpdated);
|
||||
OBSERVABLE_PROPERTY_R(bool, AreProgrammerRadixOperatorsVisible);
|
||||
OBSERVABLE_PROPERTY_R(bool, IsInputEmpty);
|
||||
OBSERVABLE_PROPERTY_R(CalculatorApp::ViewModel::Common::Automation::NarratorAnnouncement ^, Announcement);
|
||||
OBSERVABLE_PROPERTY_R(CalculatorApp::ViewModelNative::Common::Automation::NarratorAnnouncement ^, Announcement);
|
||||
OBSERVABLE_PROPERTY_R(unsigned int, OpenParenthesisCount);
|
||||
|
||||
COMMAND_FOR_METHOD(CopyCommand, StandardCalculatorViewModel::OnCopyCommand);
|
||||
|
@ -111,13 +111,13 @@ namespace CalculatorApp
|
|||
static property Platform::String
|
||||
^ IsBitFlipCheckedPropertyName { Platform::String ^ get() { return Platform::StringReference(L"IsBitFlipChecked"); } }
|
||||
|
||||
property CalculatorApp::ViewModel::Common::BitLength ValueBitLength
|
||||
property CalculatorApp::ViewModelNative::Common::BitLength ValueBitLength
|
||||
{
|
||||
CalculatorApp::ViewModel::Common::BitLength get()
|
||||
CalculatorApp::ViewModelNative::Common::BitLength get()
|
||||
{
|
||||
return m_valueBitLength;
|
||||
}
|
||||
void set(CalculatorApp::ViewModel::Common::BitLength value);
|
||||
void set(CalculatorApp::ViewModelNative::Common::BitLength value);
|
||||
}
|
||||
|
||||
property bool IsStandard
|
||||
|
@ -253,10 +253,10 @@ namespace CalculatorApp
|
|||
void OnMemoryClear(_In_ Platform::Object ^ memoryItemPosition);
|
||||
|
||||
void SelectHistoryItem(HistoryItemViewModel ^ item);
|
||||
void SwitchProgrammerModeBase(CalculatorApp::ViewModel::Common::NumberBase calculatorBase);
|
||||
void SwitchProgrammerModeBase(CalculatorApp::ViewModelNative::Common::NumberBase calculatorBase);
|
||||
void SetBitshiftRadioButtonCheckedAnnouncement(Platform::String ^ announcement);
|
||||
void SetOpenParenthesisCountNarratorAnnouncement();
|
||||
void SwitchAngleType(CalculatorApp::ViewModel::Common::NumbersAndOperatorsEnum num);
|
||||
void SwitchAngleType(CalculatorApp::ViewModelNative::Common::NumbersAndOperatorsEnum num);
|
||||
void FtoEButtonToggled();
|
||||
|
||||
internal:
|
||||
|
@ -277,7 +277,7 @@ namespace CalculatorApp
|
|||
|
||||
Platform::String ^ GetLocalizedStringFormat(Platform::String ^ format, Platform::String ^ displayValue);
|
||||
void OnPropertyChanged(Platform::String ^ propertyname);
|
||||
void SetCalculatorType(CalculatorApp::ViewModel::Common::ViewMode targetState);
|
||||
void SetCalculatorType(CalculatorApp::ViewModelNative::Common::ViewMode targetState);
|
||||
|
||||
Platform::String ^ GetRawDisplayValue();
|
||||
void Recalculate(bool fromHistory = false);
|
||||
|
@ -290,7 +290,7 @@ namespace CalculatorApp
|
|||
{
|
||||
m_standardCalculatorManager.UpdateMaxIntDigits();
|
||||
}
|
||||
CalculatorApp::ViewModel::Common::NumbersAndOperatorsEnum GetCurrentAngleType()
|
||||
CalculatorApp::ViewModelNative::Common::NumbersAndOperatorsEnum GetCurrentAngleType()
|
||||
{
|
||||
return m_CurrentAngleType;
|
||||
}
|
||||
|
@ -307,12 +307,12 @@ namespace CalculatorApp
|
|||
_Inout_ std::shared_ptr<std::vector<std::pair<std::wstring, int>>> const& tokens,
|
||||
_Inout_ std::shared_ptr<std::vector<std::shared_ptr<IExpressionCommand>>> const& commands);
|
||||
void SetTokens(_Inout_ std::shared_ptr<std::vector<std::pair<std::wstring, int>>> const& tokens);
|
||||
CalculatorApp::ViewModel::Common::NumbersAndOperatorsEnum ConvertIntegerToNumbersAndOperatorsEnum(unsigned int parameter);
|
||||
static RadixType GetRadixTypeFromNumberBase(CalculatorApp::ViewModel::Common::NumberBase base);
|
||||
CalculatorApp::ViewModel::Common::NumbersAndOperatorsEnum m_CurrentAngleType;
|
||||
CalculatorApp::ViewModelNative::Common::NumbersAndOperatorsEnum ConvertIntegerToNumbersAndOperatorsEnum(unsigned int parameter);
|
||||
static RadixType GetRadixTypeFromNumberBase(CalculatorApp::ViewModelNative::Common::NumberBase base);
|
||||
CalculatorApp::ViewModelNative::Common::NumbersAndOperatorsEnum m_CurrentAngleType;
|
||||
wchar_t m_decimalSeparator;
|
||||
CalculatorApp::ViewModel::Common::CalculatorDisplay m_calculatorDisplay;
|
||||
CalculatorApp::ViewModel::Common::EngineResourceProvider m_resourceProvider;
|
||||
CalculatorApp::ViewModelNative::Common::CalculatorDisplay m_calculatorDisplay;
|
||||
CalculatorApp::ViewModelNative::Common::EngineResourceProvider m_resourceProvider;
|
||||
CalculationManager::CalculatorManager m_standardCalculatorManager;
|
||||
Platform::String ^ m_expressionAutomationNameFormat;
|
||||
Platform::String ^ m_localizedCalculationResultAutomationFormat;
|
||||
|
@ -339,18 +339,18 @@ namespace CalculatorApp
|
|||
bool m_isRtlLanguage;
|
||||
bool m_operandUpdated;
|
||||
bool m_isLastOperationHistoryLoad;
|
||||
CalculatorApp::ViewModel::Common::BitLength m_valueBitLength;
|
||||
CalculatorApp::ViewModelNative::Common::BitLength m_valueBitLength;
|
||||
Platform::String ^ m_selectedExpressionLastData;
|
||||
Common::DisplayExpressionToken ^ m_selectedExpressionToken;
|
||||
|
||||
Platform::String ^ LocalizeDisplayValue(_In_ std::wstring const& displayValue);
|
||||
Platform::String
|
||||
^ CalculateNarratorDisplayValue(_In_ std::wstring const& displayValue, _In_ Platform::String ^ localizedDisplayValue);
|
||||
CalculatorApp::ViewModel::Common::Automation::NarratorAnnouncement ^ GetDisplayUpdatedNarratorAnnouncement();
|
||||
CalculatorApp::ViewModelNative::Common::Automation::NarratorAnnouncement ^ GetDisplayUpdatedNarratorAnnouncement();
|
||||
Platform::String ^ GetCalculatorExpressionAutomationName();
|
||||
Platform::String ^ GetNarratorStringReadRawNumbers(_In_ Platform::String ^ localizedDisplayValue);
|
||||
|
||||
CalculationManager::Command ConvertToOperatorsEnum(CalculatorApp::ViewModel::Common::NumbersAndOperatorsEnum operation);
|
||||
CalculationManager::Command ConvertToOperatorsEnum(CalculatorApp::ViewModelNative::Common::NumbersAndOperatorsEnum operation);
|
||||
void DisableButtons(CalculationManager::CommandType selectedExpressionCommandType);
|
||||
|
||||
Platform::String ^ m_feedbackForButtonPress;
|
||||
|
@ -371,9 +371,9 @@ namespace CalculatorApp
|
|||
|
||||
void SaveEditedCommand(_In_ unsigned int index, _In_ CalculationManager::Command command);
|
||||
|
||||
CalculatorApp::ViewModel::Common::ViewMode GetCalculatorMode();
|
||||
CalculatorApp::ViewModelNative::Common::ViewMode GetCalculatorMode();
|
||||
|
||||
friend class CalculatorApp::ViewModel::Common::CalculatorDisplay;
|
||||
friend class CalculatorApp::ViewModelNative::Common::CalculatorDisplay;
|
||||
friend class CalculatorUnitTests::MultiWindowUnitTests;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -15,10 +15,10 @@
|
|||
#include "DataLoaders/UnitConverterDataLoader.h"
|
||||
|
||||
using namespace CalculatorApp;
|
||||
using namespace CalculatorApp::ViewModel;
|
||||
using namespace CalculatorApp::ViewModel::Common;
|
||||
using namespace CalculatorApp::ViewModel::Common::Automation;
|
||||
using namespace CalculatorApp::ViewModel::DataLoaders;
|
||||
using namespace CalculatorApp::ViewModelNative;
|
||||
using namespace CalculatorApp::ViewModelNative::Common;
|
||||
using namespace CalculatorApp::ViewModelNative::Common::Automation;
|
||||
using namespace CalculatorApp::ViewModelNative::DataLoaders;
|
||||
using namespace concurrency;
|
||||
using namespace Platform;
|
||||
using namespace Platform::Collections;
|
||||
|
@ -76,7 +76,7 @@ namespace
|
|||
StringReference SupplementaryVisibilityPropertyName(L"SupplementaryVisibility");
|
||||
}
|
||||
|
||||
namespace CalculatorApp::ViewModel::DataLoaders::UnitConverterResourceKeys
|
||||
namespace CalculatorApp::ViewModelNative::DataLoaders::UnitConverterResourceKeys
|
||||
{
|
||||
StringReference ValueFromFormat(L"Format_ValueFrom");
|
||||
StringReference ValueFromDecimalFormat(L"Format_ValueFrom_Decimal");
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
namespace CalculatorApp
|
||||
{
|
||||
namespace ViewModel
|
||||
namespace ViewModelNative
|
||||
{
|
||||
[Windows::UI::Xaml::Data::Bindable] public ref class Category sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
|
||||
{
|
||||
|
@ -116,7 +116,7 @@ namespace CalculatorApp
|
|||
OBSERVABLE_OBJECT();
|
||||
|
||||
OBSERVABLE_PROPERTY_R(Platform::String ^, Value);
|
||||
OBSERVABLE_PROPERTY_R(CalculatorApp::ViewModel::Unit ^, Unit);
|
||||
OBSERVABLE_PROPERTY_R(CalculatorApp::ViewModelNative::Unit ^, Unit);
|
||||
};
|
||||
|
||||
public interface class IActivatable
|
||||
|
@ -161,7 +161,7 @@ namespace CalculatorApp
|
|||
OBSERVABLE_OBJECT_CALLBACK(OnPropertyChanged);
|
||||
|
||||
OBSERVABLE_PROPERTY_R(Windows::Foundation::Collections::IObservableVector<Category ^> ^, Categories);
|
||||
OBSERVABLE_PROPERTY_RW(CalculatorApp::ViewModel::Common::ViewMode, Mode);
|
||||
OBSERVABLE_PROPERTY_RW(CalculatorApp::ViewModelNative::Common::ViewMode, Mode);
|
||||
OBSERVABLE_PROPERTY_R(Windows::Foundation::Collections::IObservableVector<Unit ^> ^, Units);
|
||||
OBSERVABLE_PROPERTY_RW(Platform::String ^, CurrencySymbol1);
|
||||
OBSERVABLE_PROPERTY_RW(Unit ^, Unit1);
|
||||
|
@ -176,7 +176,7 @@ namespace CalculatorApp
|
|||
OBSERVABLE_PROPERTY_RW(Platform::String ^, Value2AutomationName);
|
||||
OBSERVABLE_PROPERTY_RW(Platform::String ^, Unit1AutomationName);
|
||||
OBSERVABLE_PROPERTY_RW(Platform::String ^, Unit2AutomationName);
|
||||
OBSERVABLE_PROPERTY_RW(CalculatorApp::ViewModel::Common::Automation::NarratorAnnouncement ^, Announcement);
|
||||
OBSERVABLE_PROPERTY_RW(CalculatorApp::ViewModelNative::Common::Automation::NarratorAnnouncement ^, Announcement);
|
||||
OBSERVABLE_PROPERTY_RW(bool, IsDecimalEnabled);
|
||||
OBSERVABLE_PROPERTY_RW(bool, IsDropDownOpen);
|
||||
OBSERVABLE_PROPERTY_RW(bool, IsDropDownEnabled);
|
||||
|
@ -185,7 +185,7 @@ namespace CalculatorApp
|
|||
OBSERVABLE_PROPERTY_RW(Platform::String ^, CurrencyRatioEquality);
|
||||
OBSERVABLE_PROPERTY_RW(Platform::String ^, CurrencyRatioEqualityAutomationName);
|
||||
OBSERVABLE_PROPERTY_RW(Platform::String ^, CurrencyTimestamp);
|
||||
OBSERVABLE_NAMED_PROPERTY_RW(CalculatorApp::ViewModel::Common::NetworkAccessBehavior, NetworkBehavior);
|
||||
OBSERVABLE_NAMED_PROPERTY_RW(CalculatorApp::ViewModelNative::Common::NetworkAccessBehavior, NetworkBehavior);
|
||||
OBSERVABLE_NAMED_PROPERTY_RW(bool, CurrencyDataLoadFailed);
|
||||
OBSERVABLE_NAMED_PROPERTY_RW(bool, CurrencyDataIsWeekOld);
|
||||
|
||||
|
@ -203,7 +203,7 @@ namespace CalculatorApp
|
|||
if (value != nullptr)
|
||||
{
|
||||
auto currentCategory = value->GetModelCategory();
|
||||
IsCurrencyCurrentCategory = currentCategory.id == CalculatorApp::ViewModel::Common::NavCategoryStates::Serialize(CalculatorApp::ViewModel::Common::ViewMode::Currency);
|
||||
IsCurrencyCurrentCategory = currentCategory.id == CalculatorApp::ViewModelNative::Common::NavCategoryStates::Serialize(CalculatorApp::ViewModelNative::Common::ViewMode::Currency);
|
||||
}
|
||||
RaisePropertyChanged("CurrentCategory");
|
||||
}
|
||||
|
@ -241,7 +241,7 @@ namespace CalculatorApp
|
|||
|
||||
internal : void ResetView();
|
||||
void PopulateData();
|
||||
CalculatorApp::ViewModel::Common::NumbersAndOperatorsEnum MapCharacterToButtonId(const wchar_t ch, bool& canSendNegate);
|
||||
CalculatorApp::ViewModelNative::Common::NumbersAndOperatorsEnum MapCharacterToButtonId(const wchar_t ch, bool& canSendNegate);
|
||||
void DisplayPasteError();
|
||||
|
||||
void OnCopyCommand(Platform::Object ^ parameter);
|
||||
|
@ -275,7 +275,7 @@ namespace CalculatorApp
|
|||
|
||||
void OnCurrencyDataLoadFinished(bool didLoad);
|
||||
void OnCurrencyTimestampUpdated(_In_ const std::wstring& timestamp, bool isWeekOld);
|
||||
void OnNetworkBehaviorChanged(_In_ CalculatorApp::ViewModel::Common::NetworkAccessBehavior newBehavior);
|
||||
void OnNetworkBehaviorChanged(_In_ CalculatorApp::ViewModelNative::Common::NetworkAccessBehavior newBehavior);
|
||||
|
||||
const std::wstring& GetValueFromUnlocalized() const
|
||||
{
|
||||
|
@ -301,7 +301,7 @@ namespace CalculatorApp
|
|||
void OnCategoryChanged(Platform::Object ^ unused);
|
||||
void OnUnitChanged(Platform::Object ^ unused);
|
||||
void OnSwitchActive(Platform::Object ^ unused);
|
||||
UnitConversionManager::Command CommandFromButtonId(CalculatorApp::ViewModel::Common::NumbersAndOperatorsEnum button);
|
||||
UnitConversionManager::Command CommandFromButtonId(CalculatorApp::ViewModelNative::Common::NumbersAndOperatorsEnum button);
|
||||
void SupplementaryResultsTimerTick(Windows::System::Threading::ThreadPoolTimer ^ timer);
|
||||
void SupplementaryResultsTimerCancel(Windows::System::Threading::ThreadPoolTimer ^ timer);
|
||||
void RefreshSupplementaryResults();
|
||||
|
@ -468,7 +468,7 @@ namespace CalculatorApp
|
|||
|
||||
void NetworkBehaviorChanged(_In_ int newBehavior) override
|
||||
{
|
||||
m_viewModel->OnNetworkBehaviorChanged(static_cast<CalculatorApp::ViewModel::Common::NetworkAccessBehavior>(newBehavior));
|
||||
m_viewModel->OnNetworkBehaviorChanged(static_cast<CalculatorApp::ViewModelNative::Common::NetworkAccessBehavior>(newBehavior));
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
@ -29,6 +29,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TraceLogging", "TraceLoggin
|
|||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CalcViewModelCopyForUT", "CalcViewModelCopyForUT\CalcViewModelCopyForUT.vcxproj", "{CC9B4FA7-D746-4F52-9401-0AD1B4D6B16D}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CalculatorApp.ViewModel", "CalculatorApp.ViewModel\CalculatorApp.ViewModel.csproj", "{081F0C62-AEAC-47E8-92BC-AD6945F24192}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CalculatorApp.ViewModel.Tests", "CalculatorApp.ViewModel.Tests\CalculatorApp.ViewModel.Tests.csproj", "{3A73F66F-05D7-43CB-8E75-441D7508D943}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|ARM = Debug|ARM
|
||||
|
@ -41,6 +45,30 @@ Global
|
|||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Debug|ARM.Deploy.0 = Debug|ARM
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Debug|ARM64.Deploy.0 = Debug|ARM64
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Debug|x64.Build.0 = Debug|x64
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Debug|x64.Deploy.0 = Debug|x64
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Debug|x86.Build.0 = Debug|x86
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Debug|x86.Deploy.0 = Debug|x86
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Release|ARM.Build.0 = Release|ARM
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Release|ARM.Deploy.0 = Release|ARM
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Release|ARM64.Deploy.0 = Release|ARM64
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Release|x64.ActiveCfg = Release|x64
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Release|x64.Build.0 = Release|x64
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Release|x64.Deploy.0 = Release|x64
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Release|x86.ActiveCfg = Release|x86
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Release|x86.Build.0 = Release|x86
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Release|x86.Deploy.0 = Release|x86
|
||||
{311E866D-8B93-4609-A691-265941FEE101}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{311E866D-8B93-4609-A691-265941FEE101}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{311E866D-8B93-4609-A691-265941FEE101}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
|
@ -169,30 +197,6 @@ Global
|
|||
{FC81FF41-02CD-4CD9-9BC5-45A1E39AC6ED}.Release|x64.Build.0 = Release|x64
|
||||
{FC81FF41-02CD-4CD9-9BC5-45A1E39AC6ED}.Release|x86.ActiveCfg = Release|Win32
|
||||
{FC81FF41-02CD-4CD9-9BC5-45A1E39AC6ED}.Release|x86.Build.0 = Release|Win32
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Debug|ARM.Deploy.0 = Debug|ARM
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Debug|ARM64.Deploy.0 = Debug|ARM64
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Debug|x64.Build.0 = Debug|x64
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Debug|x64.Deploy.0 = Debug|x64
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Debug|x86.Build.0 = Debug|x86
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Debug|x86.Deploy.0 = Debug|x86
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Release|ARM.Build.0 = Release|ARM
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Release|ARM.Deploy.0 = Release|ARM
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Release|ARM64.Deploy.0 = Release|ARM64
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Release|x64.ActiveCfg = Release|x64
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Release|x64.Build.0 = Release|x64
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Release|x64.Deploy.0 = Release|x64
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Release|x86.ActiveCfg = Release|x86
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Release|x86.Build.0 = Release|x86
|
||||
{3B773403-B0D6-4F9A-948E-512A7A5FB315}.Release|x86.Deploy.0 = Release|x86
|
||||
{CC9B4FA7-D746-4F52-9401-0AD1B4D6B16D}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{CC9B4FA7-D746-4F52-9401-0AD1B4D6B16D}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{CC9B4FA7-D746-4F52-9401-0AD1B4D6B16D}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
|
@ -207,6 +211,46 @@ Global
|
|||
{CC9B4FA7-D746-4F52-9401-0AD1B4D6B16D}.Release|x64.Build.0 = Release|x64
|
||||
{CC9B4FA7-D746-4F52-9401-0AD1B4D6B16D}.Release|x86.ActiveCfg = Release|Win32
|
||||
{CC9B4FA7-D746-4F52-9401-0AD1B4D6B16D}.Release|x86.Build.0 = Release|Win32
|
||||
{081F0C62-AEAC-47E8-92BC-AD6945F24192}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{081F0C62-AEAC-47E8-92BC-AD6945F24192}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{081F0C62-AEAC-47E8-92BC-AD6945F24192}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{081F0C62-AEAC-47E8-92BC-AD6945F24192}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{081F0C62-AEAC-47E8-92BC-AD6945F24192}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{081F0C62-AEAC-47E8-92BC-AD6945F24192}.Debug|x64.Build.0 = Debug|x64
|
||||
{081F0C62-AEAC-47E8-92BC-AD6945F24192}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{081F0C62-AEAC-47E8-92BC-AD6945F24192}.Debug|x86.Build.0 = Debug|x86
|
||||
{081F0C62-AEAC-47E8-92BC-AD6945F24192}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{081F0C62-AEAC-47E8-92BC-AD6945F24192}.Release|ARM.Build.0 = Release|ARM
|
||||
{081F0C62-AEAC-47E8-92BC-AD6945F24192}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{081F0C62-AEAC-47E8-92BC-AD6945F24192}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{081F0C62-AEAC-47E8-92BC-AD6945F24192}.Release|x64.ActiveCfg = Release|x64
|
||||
{081F0C62-AEAC-47E8-92BC-AD6945F24192}.Release|x64.Build.0 = Release|x64
|
||||
{081F0C62-AEAC-47E8-92BC-AD6945F24192}.Release|x86.ActiveCfg = Release|x86
|
||||
{081F0C62-AEAC-47E8-92BC-AD6945F24192}.Release|x86.Build.0 = Release|x86
|
||||
{3A73F66F-05D7-43CB-8E75-441D7508D943}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{3A73F66F-05D7-43CB-8E75-441D7508D943}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{3A73F66F-05D7-43CB-8E75-441D7508D943}.Debug|ARM.Deploy.0 = Debug|ARM
|
||||
{3A73F66F-05D7-43CB-8E75-441D7508D943}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{3A73F66F-05D7-43CB-8E75-441D7508D943}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{3A73F66F-05D7-43CB-8E75-441D7508D943}.Debug|ARM64.Deploy.0 = Debug|ARM64
|
||||
{3A73F66F-05D7-43CB-8E75-441D7508D943}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{3A73F66F-05D7-43CB-8E75-441D7508D943}.Debug|x64.Build.0 = Debug|x64
|
||||
{3A73F66F-05D7-43CB-8E75-441D7508D943}.Debug|x64.Deploy.0 = Debug|x64
|
||||
{3A73F66F-05D7-43CB-8E75-441D7508D943}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{3A73F66F-05D7-43CB-8E75-441D7508D943}.Debug|x86.Build.0 = Debug|x86
|
||||
{3A73F66F-05D7-43CB-8E75-441D7508D943}.Debug|x86.Deploy.0 = Debug|x86
|
||||
{3A73F66F-05D7-43CB-8E75-441D7508D943}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{3A73F66F-05D7-43CB-8E75-441D7508D943}.Release|ARM.Build.0 = Release|ARM
|
||||
{3A73F66F-05D7-43CB-8E75-441D7508D943}.Release|ARM.Deploy.0 = Release|ARM
|
||||
{3A73F66F-05D7-43CB-8E75-441D7508D943}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{3A73F66F-05D7-43CB-8E75-441D7508D943}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{3A73F66F-05D7-43CB-8E75-441D7508D943}.Release|ARM64.Deploy.0 = Release|ARM64
|
||||
{3A73F66F-05D7-43CB-8E75-441D7508D943}.Release|x64.ActiveCfg = Release|x64
|
||||
{3A73F66F-05D7-43CB-8E75-441D7508D943}.Release|x64.Build.0 = Release|x64
|
||||
{3A73F66F-05D7-43CB-8E75-441D7508D943}.Release|x64.Deploy.0 = Release|x64
|
||||
{3A73F66F-05D7-43CB-8E75-441D7508D943}.Release|x86.ActiveCfg = Release|x86
|
||||
{3A73F66F-05D7-43CB-8E75-441D7508D943}.Release|x86.Build.0 = Release|x86
|
||||
{3A73F66F-05D7-43CB-8E75-441D7508D943}.Release|x86.Deploy.0 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
// Declaration of the App class.
|
||||
//
|
||||
|
||||
using CalculatorApp.ViewModel.Common;
|
||||
using CalculatorApp.ViewModel.Common.Automation;
|
||||
using CalculatorApp.ViewModelNative.Common;
|
||||
using CalculatorApp.ViewModelNative.Common.Automation;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
|
|
@ -797,6 +797,10 @@
|
|||
<PackageReference Include="Microsoft.UI.Xaml" Version="2.8.1" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\CalculatorApp.ViewModel\CalculatorApp.ViewModel.csproj">
|
||||
<Project>{081f0c62-aeac-47e8-92bc-ad6945f24192}</Project>
|
||||
<Name>CalculatorApp.ViewModel</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\CalcViewModel\CalcViewModel.vcxproj">
|
||||
<Project>{812d1a7b-b8ac-49e4-8e6d-af5d59500d56}</Project>
|
||||
<Name>CalcViewModel</Name>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using CalculatorApp.ViewModel.Common;
|
||||
using CalculatorApp.ViewModelNative.Common;
|
||||
|
||||
using System;
|
||||
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using CalculatorApp.ViewModel;
|
||||
using CalculatorApp.ViewModel.Common;
|
||||
using CalculatorApp.ViewModelNative;
|
||||
using CalculatorApp.ViewModelNative.Common;
|
||||
using Utilities = CalculatorApp.ViewModel.Common.Utilities;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using CalculatorApp.ViewModel.Common;
|
||||
using CalculatorApp.ViewModelNative.Common;
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using CalculatorApp.ViewModel.Common;
|
||||
using CalculatorApp.ViewModelNative.Common;
|
||||
|
||||
using Windows.System;
|
||||
using Windows.UI.Xaml;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using CalculatorApp.ViewModel.Common;
|
||||
using CalculatorApp.ViewModelNative.Common;
|
||||
|
||||
using Windows.UI.Text;
|
||||
using Windows.UI.Xaml;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using CalculatorApp.ViewModel.Common;
|
||||
using CalculatorApp.ViewModelNative.Common;
|
||||
|
||||
using Windows.System;
|
||||
using Windows.UI.Xaml;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using CalculatorApp.ViewModel.Common;
|
||||
using CalculatorApp.ViewModelNative.Common;
|
||||
|
||||
namespace CalculatorApp
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using CalculatorApp.ViewModel;
|
||||
using CalculatorApp.ViewModelNative;
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using CalculatorApp.ViewModel.Common;
|
||||
using CalculatorApp.ViewModelNative.Common;
|
||||
|
||||
using System;
|
||||
|
||||
|
@ -19,7 +19,7 @@ namespace CalculatorApp
|
|||
DisplayExpressionToken token = (item as DisplayExpressionToken);
|
||||
if (token != null)
|
||||
{
|
||||
CalculatorApp.ViewModel.Common.TokenType type = token.Type;
|
||||
CalculatorApp.ViewModelNative.Common.TokenType type = token.Type;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using CalculatorApp.ViewModel.Common;
|
||||
using CalculatorApp.ViewModelNative.Common;
|
||||
|
||||
using System;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using CalculatorApp.ViewModel;
|
||||
using CalculatorApp.ViewModelNative;
|
||||
|
||||
using Windows.UI.Xaml;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using CalculatorApp.ViewModel.Common;
|
||||
using CalculatorApp.ViewModelNative.Common;
|
||||
|
||||
using System;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using CalculatorApp.ViewModel.Common;
|
||||
using CalculatorApp.ViewModelNative.Common;
|
||||
|
||||
using System;
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<UserControl x:Class="CalculatorApp.Calculator"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:automation="using:CalculatorApp.ViewModel.Common.Automation"
|
||||
xmlns:common="using:CalculatorApp.ViewModel.Common"
|
||||
xmlns:automation="using:CalculatorApp.ViewModelNative.Common.Automation"
|
||||
xmlns:common="using:CalculatorApp.ViewModelNative.Common"
|
||||
xmlns:contract7Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,7)"
|
||||
xmlns:contract8NotPresent="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractNotPresent(Windows.Foundation.UniversalApiContract,8)"
|
||||
xmlns:contract8Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,8)"
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
// Licensed under the MIT License.
|
||||
|
||||
using CalculatorApp.Utils;
|
||||
using CalculatorApp.ViewModel;
|
||||
using CalculatorApp.ViewModel.Common;
|
||||
using CalculatorApp.ViewModelNative;
|
||||
using CalculatorApp.ViewModelNative.Common;
|
||||
|
||||
using System;
|
||||
|
||||
|
@ -62,7 +62,7 @@ namespace CalculatorApp
|
|||
this.SizeChanged += Calculator_SizeChanged;
|
||||
}
|
||||
|
||||
public CalculatorApp.ViewModel.StandardCalculatorViewModel Model => (StandardCalculatorViewModel)this.DataContext;
|
||||
public CalculatorApp.ViewModelNative.StandardCalculatorViewModel Model => (StandardCalculatorViewModel)this.DataContext;
|
||||
|
||||
public bool IsStandard
|
||||
{
|
||||
|
@ -155,7 +155,7 @@ namespace CalculatorApp
|
|||
}
|
||||
}
|
||||
|
||||
public void InitializeHistoryView(CalculatorApp.ViewModel.HistoryViewModel historyVM)
|
||||
public void InitializeHistoryView(CalculatorApp.ViewModelNative.HistoryViewModel historyVM)
|
||||
{
|
||||
if (m_historyList == null)
|
||||
{
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
|
||||
|
||||
using CalculatorApp.Controls;
|
||||
using CalculatorApp.ViewModel;
|
||||
using CalculatorApp.ViewModel.Common;
|
||||
using CalculatorApp.ViewModelNative;
|
||||
using CalculatorApp.ViewModelNative.Common;
|
||||
|
||||
using System.Diagnostics;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
using CalculatorApp.Utils;
|
||||
using CalculatorApp.ViewModel.Common;
|
||||
using CalculatorApp.ViewModelNative.Common;
|
||||
|
||||
using System.Diagnostics;
|
||||
using System.Windows.Input;
|
||||
|
@ -32,12 +32,12 @@ namespace CalculatorApp
|
|||
|
||||
private ICommand donotuse_BitLengthButtonPressed;
|
||||
|
||||
public ViewModel.StandardCalculatorViewModel Model
|
||||
public ViewModelNative.StandardCalculatorViewModel Model
|
||||
{
|
||||
get
|
||||
{
|
||||
Debug.Assert(DataContext as ViewModel.StandardCalculatorViewModel != null, "static_cast result must NOT be null");
|
||||
return DataContext as ViewModel.StandardCalculatorViewModel;
|
||||
Debug.Assert(DataContext as ViewModelNative.StandardCalculatorViewModel != null, "static_cast result must NOT be null");
|
||||
return DataContext as ViewModelNative.StandardCalculatorViewModel;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.using CalculatorApp.ViewModel.Common;
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using CalculatorApp.Controls;
|
||||
using CalculatorApp.ViewModel;
|
||||
using CalculatorApp.ViewModel.Common;
|
||||
using CalculatorApp.ViewModelNative;
|
||||
using CalculatorApp.ViewModelNative.Common;
|
||||
|
||||
using System.Diagnostics;
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
using CalculatorApp.ViewModel;
|
||||
using CalculatorApp.ViewModel.Common;
|
||||
using CalculatorApp.ViewModelNative;
|
||||
using CalculatorApp.ViewModelNative.Common;
|
||||
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Controls;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:Controls="using:CalculatorApp.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="using:CalculatorApp.ViewModel.Common"
|
||||
xmlns:local="using:CalculatorApp.ViewModelNative.Common"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
x:Name="ControlRoot"
|
||||
d:DesignHeight="315"
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
//
|
||||
|
||||
using CalculatorApp.Utils;
|
||||
using CalculatorApp.ViewModel;
|
||||
using CalculatorApp.ViewModel.Common;
|
||||
using CalculatorApp.ViewModelNative;
|
||||
using CalculatorApp.ViewModelNative.Common;
|
||||
|
||||
using Windows.UI.Xaml;
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
//
|
||||
|
||||
using CalculatorApp.Common;
|
||||
using CalculatorApp.ViewModel;
|
||||
using CalculatorApp.ViewModel.Common;
|
||||
using CalculatorApp.ViewModelNative;
|
||||
using CalculatorApp.ViewModelNative.Common;
|
||||
|
||||
using Windows.UI.Xaml;
|
||||
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
|
||||
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
|
||||
|
||||
using CalculatorApp.ViewModel;
|
||||
using CalculatorApp.ViewModel.Common;
|
||||
using CalculatorApp.ViewModelNative;
|
||||
using CalculatorApp.ViewModelNative.Common;
|
||||
|
||||
using System;
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
xmlns:local="using:CalculatorApp"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:mux="using:Microsoft.UI.Xaml.Controls"
|
||||
xmlns:vm="using:CalculatorApp.ViewModel"
|
||||
xmlns:vm="using:CalculatorApp.ViewModelNative"
|
||||
d:DesignHeight="300"
|
||||
d:DesignWidth="400"
|
||||
mc:Ignorable="d">
|
||||
|
@ -136,14 +136,14 @@
|
|||
Grid.Column="1"
|
||||
Margin="8,0,8,-6"
|
||||
VerticalAlignment="Center"
|
||||
contract7Present:CornerRadius="{ThemeResource ControlCornerRadius}"
|
||||
DataContext="{x:Bind}"
|
||||
SmallChange="{x:Bind Step, Mode=TwoWay}"
|
||||
StepFrequency="{x:Bind Step, Mode=TwoWay}"
|
||||
ValueChanged="Slider_ValueChanged"
|
||||
Value="{x:Bind Value, Mode=TwoWay}"
|
||||
Maximum="{x:Bind Max, Mode=TwoWay}"
|
||||
Minimum="{x:Bind Min, Mode=TwoWay}"
|
||||
contract7Present:CornerRadius="{ThemeResource ControlCornerRadius}"/>
|
||||
Minimum="{x:Bind Min, Mode=TwoWay}"/>
|
||||
|
||||
<Grid Grid.Row="1"
|
||||
Padding="8,0,8,8"
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
using Calculator.Utils;
|
||||
|
||||
using CalculatorApp.Controls;
|
||||
using CalculatorApp.ViewModel;
|
||||
using CalculatorApp.ViewModel.Common;
|
||||
using CalculatorApp.ViewModel.Common.Automation;
|
||||
using CalculatorApp.ViewModelNative;
|
||||
using CalculatorApp.ViewModelNative.Common;
|
||||
using CalculatorApp.ViewModelNative.Common.Automation;
|
||||
|
||||
using GraphControl;
|
||||
|
||||
|
@ -53,7 +53,7 @@ namespace CalculatorApp
|
|||
OnPropertyChanged(p);
|
||||
}
|
||||
|
||||
public Windows.Foundation.Collections.IObservableVector<ViewModel.EquationViewModel> Equations
|
||||
public Windows.Foundation.Collections.IObservableVector<ViewModelNative.EquationViewModel> Equations
|
||||
{
|
||||
get => m_Equations;
|
||||
set
|
||||
|
@ -65,9 +65,9 @@ namespace CalculatorApp
|
|||
}
|
||||
}
|
||||
}
|
||||
private Windows.Foundation.Collections.IObservableVector<ViewModel.EquationViewModel> m_Equations;
|
||||
private Windows.Foundation.Collections.IObservableVector<ViewModelNative.EquationViewModel> m_Equations;
|
||||
|
||||
public Windows.Foundation.Collections.IObservableVector<ViewModel.VariableViewModel> Variables
|
||||
public Windows.Foundation.Collections.IObservableVector<ViewModelNative.VariableViewModel> Variables
|
||||
{
|
||||
get => m_Variables;
|
||||
set
|
||||
|
@ -79,7 +79,7 @@ namespace CalculatorApp
|
|||
}
|
||||
}
|
||||
}
|
||||
private Windows.Foundation.Collections.IObservableVector<ViewModel.VariableViewModel> m_Variables;
|
||||
private Windows.Foundation.Collections.IObservableVector<ViewModelNative.VariableViewModel> m_Variables;
|
||||
|
||||
public ObservableCollection<SolidColorBrush> AvailableColors
|
||||
{
|
||||
|
@ -110,7 +110,7 @@ namespace CalculatorApp
|
|||
}
|
||||
private bool m_IsMatchAppTheme;
|
||||
|
||||
public event System.EventHandler<ViewModel.EquationViewModel> KeyGraphFeaturesRequested;
|
||||
public event System.EventHandler<ViewModelNative.EquationViewModel> KeyGraphFeaturesRequested;
|
||||
public event System.EventHandler<CalculatorApp.Controls.MathRichEditBoxFormatRequest> EquationFormatRequested;
|
||||
|
||||
public static Visibility ManageEditVariablesButtonVisibility(uint numberOfVariables)
|
||||
|
@ -415,7 +415,7 @@ namespace CalculatorApp
|
|||
var eq = GetViewModelFromEquationTextBox(sender);
|
||||
eq.IsLineEnabled = !eq.IsLineEnabled;
|
||||
|
||||
CalculatorApp.ViewModel.Common.TraceLogger.GetInstance().LogShowHideButtonClicked(!eq.IsLineEnabled);
|
||||
CalculatorApp.ViewModelNative.Common.TraceLogger.GetInstance().LogShowHideButtonClicked(!eq.IsLineEnabled);
|
||||
}
|
||||
|
||||
private void EquationTextBox_Loaded(object sender, RoutedEventArgs e)
|
||||
|
@ -503,20 +503,20 @@ namespace CalculatorApp
|
|||
{
|
||||
val = validateDouble(sender.Text, variableViewModel.Value);
|
||||
variableViewModel.Value = val;
|
||||
CalculatorApp.ViewModel.Common.TraceLogger.GetInstance().LogVariableChanged("ValueTextBox", variableViewModel.Name);
|
||||
CalculatorApp.ViewModelNative.Common.TraceLogger.GetInstance().LogVariableChanged("ValueTextBox", variableViewModel.Name);
|
||||
}
|
||||
else if (sender.Name == "MinTextBox")
|
||||
{
|
||||
val = validateDouble(sender.Text, variableViewModel.Min);
|
||||
|
||||
variableViewModel.Min = val;
|
||||
CalculatorApp.ViewModel.Common.TraceLogger.GetInstance().LogVariableSettingsChanged("MinTextBox");
|
||||
CalculatorApp.ViewModelNative.Common.TraceLogger.GetInstance().LogVariableSettingsChanged("MinTextBox");
|
||||
}
|
||||
else if (sender.Name == "MaxTextBox")
|
||||
{
|
||||
val = validateDouble(sender.Text, variableViewModel.Max);
|
||||
variableViewModel.Max = val;
|
||||
CalculatorApp.ViewModel.Common.TraceLogger.GetInstance().LogVariableSettingsChanged("MaxTextBox");
|
||||
CalculatorApp.ViewModelNative.Common.TraceLogger.GetInstance().LogVariableSettingsChanged("MaxTextBox");
|
||||
}
|
||||
else if (sender.Name == "StepTextBox")
|
||||
{
|
||||
|
@ -529,7 +529,7 @@ namespace CalculatorApp
|
|||
}
|
||||
|
||||
variableViewModel.Step = val;
|
||||
CalculatorApp.ViewModel.Common.TraceLogger.GetInstance().LogVariableSettingsChanged("StepTextBox");
|
||||
CalculatorApp.ViewModelNative.Common.TraceLogger.GetInstance().LogVariableSettingsChanged("StepTextBox");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -589,7 +589,7 @@ namespace CalculatorApp
|
|||
DispatcherTimerDelayer delayer = new DispatcherTimerDelayer(timeSpan);
|
||||
delayer.Action += (s, arg) =>
|
||||
{
|
||||
CalculatorApp.ViewModel.Common.TraceLogger.GetInstance().LogVariableChanged("Slider", name);
|
||||
CalculatorApp.ViewModelNative.Common.TraceLogger.GetInstance().LogVariableChanged("Slider", name);
|
||||
variableSliders.Remove(name);
|
||||
};
|
||||
delayer.Start();
|
||||
|
@ -636,7 +636,7 @@ namespace CalculatorApp
|
|||
private int m_lastLineColorIndex;
|
||||
private int m_lastFunctionLabelIndex;
|
||||
private bool m_isHighContrast;
|
||||
private ViewModel.EquationViewModel m_equationToFocus;
|
||||
private ViewModelNative.EquationViewModel m_equationToFocus;
|
||||
private SortedDictionary<string, DispatcherTimerDelayer> variableSliders;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using CalculatorApp.ViewModel.Common;
|
||||
using CalculatorApp.ViewModelNative.Common;
|
||||
|
||||
using GraphControl;
|
||||
|
||||
|
@ -239,7 +239,7 @@ namespace CalculatorApp
|
|||
SelectedColor = brush.Color;
|
||||
}
|
||||
|
||||
CalculatorApp.ViewModel.Common.TraceLogger.GetInstance().LogGraphLineStyleChanged(LineStyleType.Color);
|
||||
CalculatorApp.ViewModelNative.Common.TraceLogger.GetInstance().LogGraphLineStyleChanged(LineStyleType.Color);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -284,7 +284,7 @@ namespace CalculatorApp
|
|||
if (oldStyle != newStyle)
|
||||
{
|
||||
SelectStyle(newStyle);
|
||||
CalculatorApp.ViewModel.Common.TraceLogger.GetInstance().LogGraphLineStyleChanged(LineStyleType.Pattern);
|
||||
CalculatorApp.ViewModelNative.Common.TraceLogger.GetInstance().LogGraphLineStyleChanged(LineStyleType.Pattern);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
using CalculatorApp.Common;
|
||||
using CalculatorApp.Controls;
|
||||
using CalculatorApp.Utils;
|
||||
using CalculatorApp.ViewModel;
|
||||
using CalculatorApp.ViewModel.Common;
|
||||
using CalculatorApp.ViewModel.Common.Automation;
|
||||
using CalculatorApp.ViewModelNative;
|
||||
using CalculatorApp.ViewModelNative.Common;
|
||||
using CalculatorApp.ViewModelNative.Common.Automation;
|
||||
|
||||
using GraphControl;
|
||||
|
||||
|
@ -86,13 +86,13 @@ namespace CalculatorApp
|
|||
if (isMatchAppLocalSetting)
|
||||
{
|
||||
IsMatchAppTheme = true;
|
||||
CalculatorApp.ViewModel.Common.TraceLogger.GetInstance().LogGraphTheme("IsMatchAppTheme");
|
||||
CalculatorApp.ViewModelNative.Common.TraceLogger.GetInstance().LogGraphTheme("IsMatchAppTheme");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
IsMatchAppTheme = false;
|
||||
CalculatorApp.ViewModel.Common.TraceLogger.GetInstance().LogGraphTheme("IsAlwaysLightTheme");
|
||||
CalculatorApp.ViewModelNative.Common.TraceLogger.GetInstance().LogGraphTheme("IsAlwaysLightTheme");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -200,7 +200,7 @@ namespace CalculatorApp
|
|||
}
|
||||
private bool m_IsManualAdjustment;
|
||||
|
||||
public CalculatorApp.ViewModel.GraphingCalculatorViewModel ViewModel
|
||||
public CalculatorApp.ViewModelNative.GraphingCalculatorViewModel ViewModel
|
||||
{
|
||||
get => m_viewModel;
|
||||
set
|
||||
|
@ -327,13 +327,13 @@ namespace CalculatorApp
|
|||
private void OnZoomInCommand(object parameter)
|
||||
{
|
||||
GraphingControl.ZoomFromCenter(zoomInScale);
|
||||
CalculatorApp.ViewModel.Common.TraceLogger.GetInstance().LogGraphButtonClicked(GraphButton.ZoomIn, GraphButtonValue.None);
|
||||
CalculatorApp.ViewModelNative.Common.TraceLogger.GetInstance().LogGraphButtonClicked(GraphButton.ZoomIn, GraphButtonValue.None);
|
||||
}
|
||||
|
||||
private void OnZoomOutCommand(object parameter)
|
||||
{
|
||||
GraphingControl.ZoomFromCenter(zoomOutScale);
|
||||
CalculatorApp.ViewModel.Common.TraceLogger.GetInstance().LogGraphButtonClicked(GraphButton.ZoomOut, GraphButtonValue.None);
|
||||
CalculatorApp.ViewModelNative.Common.TraceLogger.GetInstance().LogGraphButtonClicked(GraphButton.ZoomOut, GraphButtonValue.None);
|
||||
}
|
||||
|
||||
private void OnShareClick(object sender, RoutedEventArgs e)
|
||||
|
@ -342,7 +342,7 @@ namespace CalculatorApp
|
|||
try
|
||||
{
|
||||
DataTransferManager.ShowShareUI();
|
||||
CalculatorApp.ViewModel.Common.TraceLogger.GetInstance().LogGraphButtonClicked(GraphButton.Share, GraphButtonValue.None);
|
||||
CalculatorApp.ViewModelNative.Common.TraceLogger.GetInstance().LogGraphButtonClicked(GraphButton.Share, GraphButtonValue.None);
|
||||
}
|
||||
catch (System.Runtime.InteropServices.COMException ex)
|
||||
{
|
||||
|
@ -351,7 +351,7 @@ namespace CalculatorApp
|
|||
if (ex.HResult == unchecked(rpc_e_servercall_retrylater))
|
||||
{
|
||||
ShowShareError();
|
||||
CalculatorApp.ViewModel.Common.TraceLogger.GetInstance().LogPlatformExceptionInfo(ViewMode.Graphing, System.Reflection.MethodBase.GetCurrentMethod().Name, ex.Message, ex.HResult);
|
||||
CalculatorApp.ViewModelNative.Common.TraceLogger.GetInstance().LogPlatformExceptionInfo(ViewMode.Graphing, System.Reflection.MethodBase.GetCurrentMethod().Name, ex.Message, ex.HResult);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -495,7 +495,7 @@ namespace CalculatorApp
|
|||
catch (Exception ex)
|
||||
{
|
||||
ShowShareError();
|
||||
CalculatorApp.ViewModel.Common.TraceLogger.GetInstance().LogPlatformExceptionInfo(ViewMode.Graphing, System.Reflection.MethodBase.GetCurrentMethod().Name, ex.Message, ex.HResult);
|
||||
CalculatorApp.ViewModelNative.Common.TraceLogger.GetInstance().LogPlatformExceptionInfo(ViewMode.Graphing, System.Reflection.MethodBase.GetCurrentMethod().Name, ex.Message, ex.HResult);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -627,7 +627,7 @@ namespace CalculatorApp
|
|||
KeyboardShortcutManager.IgnoreEscape(false);
|
||||
|
||||
TracePointer.Visibility = Visibility.Visible;
|
||||
CalculatorApp.ViewModel.Common.TraceLogger.GetInstance().LogGraphButtonClicked(GraphButton.ActiveTracingChecked, GraphButtonValue.None);
|
||||
CalculatorApp.ViewModelNative.Common.TraceLogger.GetInstance().LogGraphButtonClicked(GraphButton.ActiveTracingChecked, GraphButtonValue.None);
|
||||
}
|
||||
|
||||
private void ActiveTracing_Unchecked(object sender, RoutedEventArgs e)
|
||||
|
@ -637,7 +637,7 @@ namespace CalculatorApp
|
|||
KeyboardShortcutManager.HonorEscape();
|
||||
|
||||
TracePointer.Visibility = Visibility.Collapsed;
|
||||
CalculatorApp.ViewModel.Common.TraceLogger.GetInstance().LogGraphButtonClicked(GraphButton.ActiveTracingUnchecked, GraphButtonValue.None);
|
||||
CalculatorApp.ViewModelNative.Common.TraceLogger.GetInstance().LogGraphButtonClicked(GraphButton.ActiveTracingUnchecked, GraphButtonValue.None);
|
||||
}
|
||||
|
||||
private void ActiveTracing_KeyUp(CoreWindow sender, KeyEventArgs args)
|
||||
|
@ -664,7 +664,7 @@ namespace CalculatorApp
|
|||
private void GraphSettingsButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
DisplayGraphSettings();
|
||||
CalculatorApp.ViewModel.Common.TraceLogger.GetInstance().LogGraphButtonClicked(GraphButton.GraphSettings, GraphButtonValue.None);
|
||||
CalculatorApp.ViewModelNative.Common.TraceLogger.GetInstance().LogGraphButtonClicked(GraphButton.GraphSettings, GraphButtonValue.None);
|
||||
}
|
||||
|
||||
private void SwitchModeToggleButton_Toggled(object sender, RoutedEventArgs e)
|
||||
|
@ -802,7 +802,7 @@ namespace CalculatorApp
|
|||
private const string sc_ViewModelPropertyName = "ViewModel";
|
||||
private const string sc_IsGraphThemeMatchApp = "IsGraphThemeMatchApp";
|
||||
|
||||
private CalculatorApp.ViewModel.GraphingCalculatorViewModel m_viewModel;
|
||||
private CalculatorApp.ViewModelNative.GraphingCalculatorViewModel m_viewModel;
|
||||
private readonly Windows.UI.ViewManagement.AccessibilitySettings m_accessibilitySettings;
|
||||
private bool m_cursorShadowInitialized;
|
||||
private readonly Windows.UI.ViewManagement.UISettings m_uiSettings;
|
||||
|
@ -851,7 +851,7 @@ namespace CalculatorApp
|
|||
|
||||
private void OnVisualStateChanged(object sender, VisualStateChangedEventArgs e)
|
||||
{
|
||||
CalculatorApp.ViewModel.Common.TraceLogger.GetInstance().LogVisualStateChanged(ViewMode.Graphing, e.NewState.Name, false);
|
||||
CalculatorApp.ViewModelNative.Common.TraceLogger.GetInstance().LogVisualStateChanged(ViewMode.Graphing, e.NewState.Name, false);
|
||||
}
|
||||
|
||||
private void GraphViewButton_Click(object sender, RoutedEventArgs e)
|
||||
|
@ -872,7 +872,7 @@ namespace CalculatorApp
|
|||
var announcement = CalculatorAnnouncement.GetGraphViewBestFitChangedAnnouncement(announcementText);
|
||||
narratorNotifier.Announce(announcement);
|
||||
|
||||
CalculatorApp.ViewModel.Common.TraceLogger.GetInstance().LogGraphButtonClicked(
|
||||
CalculatorApp.ViewModelNative.Common.TraceLogger.GetInstance().LogGraphButtonClicked(
|
||||
GraphButton.GraphView, IsManualAdjustment ? GraphButtonValue.ManualAdjustment : GraphButtonValue.AutomaticBestFit);
|
||||
}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue