diff --git a/src/CalcViewModel/CalcViewModel.vcxproj b/src/CalcViewModel/CalcViewModel.vcxproj
index 49bc036f..c00baff7 100644
--- a/src/CalcViewModel/CalcViewModel.vcxproj
+++ b/src/CalcViewModel/CalcViewModel.vcxproj
@@ -313,16 +313,13 @@
-
-
-
@@ -330,7 +327,6 @@
-
@@ -341,7 +337,6 @@
-
@@ -361,16 +356,13 @@
-
-
-
@@ -420,16 +412,7 @@
-
-
-
-
-
-
- This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
-
+
\ No newline at end of file
diff --git a/src/CalcViewModel/CalcViewModel.vcxproj.filters b/src/CalcViewModel/CalcViewModel.vcxproj.filters
index ac5d41d3..051808a6 100644
--- a/src/CalcViewModel/CalcViewModel.vcxproj.filters
+++ b/src/CalcViewModel/CalcViewModel.vcxproj.filters
@@ -23,18 +23,12 @@
Common
-
- Common
-
Common
Common
-
- Common
-
Common
@@ -50,9 +44,6 @@
Common
-
- Common
-
Common
@@ -94,15 +85,9 @@
-
- Common
-
Common
-
- Common
-
Common
@@ -112,18 +97,12 @@
Common
-
- Common
-
Common
Common
-
- Common
-
Common
@@ -136,9 +115,6 @@
Common
-
- Common
-
Common
@@ -163,9 +139,6 @@
Common
-
- Common
-
Common\Automation
@@ -199,14 +172,13 @@
Common
+
+ Common
+
DataLoaders
-
-
-
-
\ No newline at end of file
diff --git a/src/CalcViewModel/Common/BindableBase.cpp b/src/CalcViewModel/Common/BindableBase.cpp
deleted file mode 100644
index ccba7985..00000000
--- a/src/CalcViewModel/Common/BindableBase.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-#include "pch.h"
-#include "BindableBase.h"
-
-using namespace CalculatorApp::Common;
-
-using namespace Platform;
-using namespace Windows::UI::Xaml::Data;
-
-///
-/// Notifies listeners that a property value has changed.
-///
-/// Name of the property used to notify listeners.
-void BindableBase::OnPropertyChanged(String ^ propertyName)
-{
- PropertyChanged(this, ref new PropertyChangedEventArgs(propertyName));
-}
-
-Windows::UI::Xaml::Data::ICustomProperty ^ BindableBase::GetCustomProperty(Platform::String ^ name)
-{
- return nullptr;
-}
-
-Windows::UI::Xaml::Data::ICustomProperty ^ BindableBase::GetIndexedProperty(Platform::String ^ name, Windows::UI::Xaml::Interop::TypeName type)
-{
- return nullptr;
-}
-
-Platform::String ^ BindableBase::GetStringRepresentation()
-{
- return this->ToString();
-}
diff --git a/src/CalcViewModel/Common/BindableBase.h b/src/CalcViewModel/Common/BindableBase.h
deleted file mode 100644
index d1f958f5..00000000
--- a/src/CalcViewModel/Common/BindableBase.h
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-#pragma once
-
-namespace CalculatorApp
-{
- namespace Common
- {
- ///
- /// Implementation of to simplify models.
- ///
- [Windows::Foundation::Metadata::WebHostHidden] public ref class BindableBase : Windows::UI::Xaml::DependencyObject,
- Windows::UI::Xaml::Data::INotifyPropertyChanged,
- Windows::UI::Xaml::Data::ICustomPropertyProvider
- {
- public:
- virtual event Windows::UI::Xaml::Data::PropertyChangedEventHandler ^ PropertyChanged;
-
- public:
- // ICustomPropertyProvider
- virtual Windows::UI::Xaml::Data::ICustomProperty ^ GetCustomProperty(Platform::String ^ name);
- virtual Windows::UI::Xaml::Data::ICustomProperty ^ GetIndexedProperty(Platform::String ^ name, Windows::UI::Xaml::Interop::TypeName type);
- virtual Platform::String ^ GetStringRepresentation();
-
- property Windows::UI::Xaml::Interop::TypeName Type
- {
- virtual Windows::UI::Xaml::Interop::TypeName get()
- {
- return this->GetType();
- }
- }
-
- protected:
- virtual void OnPropertyChanged(Platform::String ^ propertyName);
- };
- }
-}
diff --git a/src/CalcViewModel/Common/ConversionResultTaskHelper.cpp b/src/CalcViewModel/Common/ConversionResultTaskHelper.cpp
deleted file mode 100644
index ec90228f..00000000
--- a/src/CalcViewModel/Common/ConversionResultTaskHelper.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-#include "pch.h"
-#include "ConversionResultTaskHelper.h"
-
-using namespace CalculatorApp::Common;
-using namespace concurrency;
-using namespace std;
-
-ConversionResultTaskHelper::ConversionResultTaskHelper(unsigned int delay, const function functionToRun)
- : m_delay{ delay }
- , m_storedFunction{ functionToRun }
-{
- auto token = m_cts.get_token();
- auto delayTask = CompleteAfter(delay);
- delayTask.then(
- [this, token]() {
- if (!token.is_canceled())
- {
- m_storedFunction();
- }
- },
- task_continuation_context::use_current());
-}
-
-ConversionResultTaskHelper::~ConversionResultTaskHelper()
-{
- m_cts.cancel();
-}
-
-#pragma optimize("", off)
-// Creates a task that completes after the specified delay.
-//
-// Taken from: How to: Create a Task that Completes After a Delay
-// https://msdn.microsoft.com/en-us/library/hh873170.aspx
-task ConversionResultTaskHelper::CompleteAfter(unsigned int timeout)
-{
- co_await winrt::resume_after(winrt::Windows::Foundation::TimeSpan{ std::chrono::duration(timeout) });
-};
-#pragma optimize("", on)
diff --git a/src/CalcViewModel/Common/ConversionResultTaskHelper.h b/src/CalcViewModel/Common/ConversionResultTaskHelper.h
deleted file mode 100644
index 2fe543c3..00000000
--- a/src/CalcViewModel/Common/ConversionResultTaskHelper.h
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-#pragma once
-
-namespace CalculatorApp
-{
- namespace Common
- {
- class ConversionResultTaskHelper
- {
- public:
- ConversionResultTaskHelper(unsigned int delay, const std::function functionToRun);
- ~ConversionResultTaskHelper();
-
- private:
- concurrency::task CompleteAfter(unsigned int timeout);
-
- unsigned int m_delay;
- concurrency::cancellation_token_source m_cts;
- const std::function m_storedFunction;
- };
- }
-}
diff --git a/src/CalcViewModel/Common/TraceActivity.h b/src/CalcViewModel/Common/TraceActivity.h
index 41046a63..003bf6bd 100644
--- a/src/CalcViewModel/Common/TraceActivity.h
+++ b/src/CalcViewModel/Common/TraceActivity.h
@@ -1,12 +1,11 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once
+#include
namespace CalculatorApp
{
- constexpr int64_t WINEVENT_KEYWORD_RESPONSE_TIME = 0x1000000000000;
-
// RAII wrapper that automatically sends the Stop event when the class gets destructed.
class TraceActivity
{
diff --git a/src/CalcViewModel/HistoryViewModel.cpp b/src/CalcViewModel/HistoryViewModel.cpp
index 58bd726d..473322ed 100644
--- a/src/CalcViewModel/HistoryViewModel.cpp
+++ b/src/CalcViewModel/HistoryViewModel.cpp
@@ -36,12 +36,6 @@ HistoryViewModel::HistoryViewModel(_In_ CalculationManager::CalculatorManager* c
ItemSize = 0;
}
-void HistoryViewModel::RestoreCompleteHistory()
-{
- RestoreHistory(CalculationManager::CALCULATOR_MODE::CM_STD);
- RestoreHistory(CalculationManager::CALCULATOR_MODE::CM_SCI);
-}
-
// this will reload Items with the history list based on current mode
void HistoryViewModel::ReloadHistory(_In_ ViewMode currentMode)
{
diff --git a/src/CalcViewModel/HistoryViewModel.h b/src/CalcViewModel/HistoryViewModel.h
index 75321d39..c1c37731 100644
--- a/src/CalcViewModel/HistoryViewModel.h
+++ b/src/CalcViewModel/HistoryViewModel.h
@@ -41,7 +41,6 @@ namespace CalculatorApp
event HistoryItemClickedHandler ^ HistoryItemClicked;
void ShowItem(_In_ CalculatorApp::ViewModel::HistoryItemViewModel ^ e);
void ClearHistory();
- void RestoreCompleteHistory();
internal : HistoryViewModel(_In_ CalculationManager::CalculatorManager* calculatorManager);
void SetCalculatorDisplay(CalculatorDisplay& calculatorDisplay);
diff --git a/src/CalcViewModel/StandardCalculatorViewModel.cpp b/src/CalcViewModel/StandardCalculatorViewModel.cpp
index 3b3647dd..2bfeb521 100644
--- a/src/CalcViewModel/StandardCalculatorViewModel.cpp
+++ b/src/CalcViewModel/StandardCalculatorViewModel.cpp
@@ -903,21 +903,6 @@ void StandardCalculatorViewModel::OnClearMemoryCommand(Object ^ parameter)
Announcement = CalculatorAnnouncement::GetMemoryClearedAnnouncement(m_localizedMemoryCleared);
}
-void StandardCalculatorViewModel::OnPinUnpinCommand(Object ^ parameter)
-{
- SetViewPinnedState(!IsViewPinned());
-}
-
-bool StandardCalculatorViewModel::IsViewPinned()
-{
- return m_IsCurrentViewPinned;
-}
-
-void StandardCalculatorViewModel::SetViewPinnedState(bool pinned)
-{
- IsCurrentViewPinned = pinned;
-}
-
ButtonInfo StandardCalculatorViewModel::MapCharacterToButtonId(char16 ch)
{
ButtonInfo result;
@@ -1476,15 +1461,6 @@ void StandardCalculatorViewModel::Recalculate(bool fromHistory)
}
}
-CommandType StandardCalculatorViewModel::GetSelectedTokenType(_In_ unsigned int tokenPosition)
-{
- const pair& token = m_tokens->at(tokenPosition);
- unsigned int tokenCommandIndex = token.second;
- const shared_ptr& tokenCommand = m_commands->at(tokenCommandIndex);
-
- return tokenCommand->GetCommandType();
-}
-
bool StandardCalculatorViewModel::IsOpnd(Command command)
{
static constexpr Command opnd[] = { Command::Command0, Command::Command1, Command::Command2, Command::Command3, Command::Command4, Command::Command5,
@@ -1626,26 +1602,6 @@ void StandardCalculatorViewModel::SwitchAngleType(NumbersAndOperatorsEnum num)
OnButtonPressed(num);
}
-NumbersAndOperatorsEnum StandardCalculatorViewModel::ConvertIntegerToNumbersAndOperatorsEnum(unsigned int parameter)
-{
- NumbersAndOperatorsEnum angletype;
- switch (parameter)
- {
- case 321:
- angletype = NumbersAndOperatorsEnum::Degree;
- break;
- case 322:
- angletype = NumbersAndOperatorsEnum::Radians;
- break;
- case 323:
- angletype = NumbersAndOperatorsEnum::Grads;
- break;
- default:
- angletype = NumbersAndOperatorsEnum::Degree;
- };
- return angletype;
-}
-
void StandardCalculatorViewModel::UpdateOperand(int pos, String ^ text)
{
pair p = m_tokens->at(pos);
diff --git a/src/CalcViewModel/StandardCalculatorViewModel.h b/src/CalcViewModel/StandardCalculatorViewModel.h
index 909e32c9..38584b5d 100644
--- a/src/CalcViewModel/StandardCalculatorViewModel.h
+++ b/src/CalcViewModel/StandardCalculatorViewModel.h
@@ -71,7 +71,6 @@ namespace CalculatorApp
OBSERVABLE_PROPERTY_R(bool, IsUnaryOperatorEnabled);
OBSERVABLE_PROPERTY_R(bool, IsNegateEnabled);
OBSERVABLE_PROPERTY_RW(bool, IsDecimalEnabled);
- OBSERVABLE_PROPERTY_R(bool, IsCurrentViewPinned);
OBSERVABLE_PROPERTY_R(Windows::Foundation::Collections::IVector ^, MemorizedNumbers);
OBSERVABLE_NAMED_PROPERTY_RW(bool, IsMemoryEmpty);
OBSERVABLE_PROPERTY_R(bool, IsFToEChecked);
@@ -209,7 +208,6 @@ namespace CalculatorApp
{
if (m_isEditingEnabled != value)
{
- // Numbers::Common::KeyboardShortcutManager::IsCalculatorInEditingMode = value;
m_isEditingEnabled = value;
bool currentEditToggleValue = !m_isEditingEnabled;
IsBinaryOperatorEnabled = currentEditToggleValue;
@@ -262,7 +260,6 @@ namespace CalculatorApp
void OnMemoryAdd(Platform::Object ^ memoryItemPosition);
void OnMemorySubtract(Platform::Object ^ memoryItemPosition);
void OnMemoryClear(_In_ Platform::Object ^ memoryItemPosition);
- void OnPinUnpinCommand(Platform::Object ^ parameter);
void OnInputChanged();
void DisplayPasteError();
@@ -332,7 +329,6 @@ namespace CalculatorApp
Platform::String ^ m_localizedOpenParenthesisCountChangedAutomationFormat;
Platform::String ^ m_localizedNoRightParenthesisAddedFormat;
- bool m_pinned;
bool m_isOperandEnabled;
bool m_isEditingEnabled;
bool m_isStandard;
@@ -372,12 +368,8 @@ namespace CalculatorApp
bool IsOpnd(CalculationManager::Command command);
bool IsRecoverableCommand(CalculationManager::Command command);
- CalculationManager::CommandType GetSelectedTokenType(_In_ unsigned int);
void SaveEditedCommand(_In_ unsigned int index, _In_ CalculationManager::Command command);
- bool IsViewPinned();
- void SetViewPinnedState(bool pinned);
-
CalculatorApp::Common::ViewMode GetCalculatorMode();
friend class CalculatorDisplay;
diff --git a/src/CalcViewModel/UnitConverterViewModel.cpp b/src/CalcViewModel/UnitConverterViewModel.cpp
index bab3c786..ecf4f80b 100644
--- a/src/CalcViewModel/UnitConverterViewModel.cpp
+++ b/src/CalcViewModel/UnitConverterViewModel.cpp
@@ -478,21 +478,11 @@ void UnitConverterViewModel::OnButtonPressed(Platform::Object ^ parameter)
static constexpr UCM::Command OPERANDS[] = { UCM::Command::Zero, UCM::Command::One, UCM::Command::Two, UCM::Command::Three, UCM::Command::Four,
UCM::Command::Five, UCM::Command::Six, UCM::Command::Seven, UCM::Command::Eight, UCM::Command::Nine };
-
- if (find(begin(OPERANDS), end(OPERANDS), command) != end(OPERANDS))
- {
- if (m_isInputBlocked)
- {
- return;
- }
-
- if (m_IsCurrencyCurrentCategory)
- {
- StartConversionResultTimer();
- }
- }
-
- m_model->SendCommand(command);
+ if (m_isInputBlocked)
+ {
+ return;
+ }
+ m_model->SendCommand(command);
TraceLogger::GetInstance()->LogConverterInputReceived(Mode);
}
@@ -998,18 +988,6 @@ bool UnitConverterViewModel::UnitsAreValid()
return UnitFrom != nullptr && !UnitFrom->Abbreviation->IsEmpty() && UnitTo != nullptr && !UnitTo->Abbreviation->IsEmpty();
}
-void UnitConverterViewModel::StartConversionResultTimer()
-{
- auto that(this);
- m_conversionResultTaskHelper = make_unique(CONVERSION_FINALIZED_DELAY_IN_MS, [that]() {
- if (that->UnitsAreValid())
- {
- String ^ valueFrom = that->m_Value1Active ? that->m_Value1 : that->m_Value2;
- String ^ valueTo = that->m_Value1Active ? that->m_Value2 : that->m_Value1;
- }
- });
-}
-
String ^ SupplementaryResult::GetLocalizedAutomationName()
{
auto format = AppResourceProvider::GetInstance()->GetResourceString("SupplementaryUnit_AutomationName");
diff --git a/src/CalcViewModel/UnitConverterViewModel.h b/src/CalcViewModel/UnitConverterViewModel.h
index 6a8761a3..5891f037 100644
--- a/src/CalcViewModel/UnitConverterViewModel.h
+++ b/src/CalcViewModel/UnitConverterViewModel.h
@@ -7,7 +7,6 @@
#include "Common/Utils.h"
#include "Common/NetworkManager.h"
#include "Common/Automation/NarratorAnnouncement.h"
-#include "Common/ConversionResultTaskHelper.h"
#include "Common/CalculatorButtonUser.h"
#include "Common/NavCategory.h"
@@ -264,8 +263,6 @@ namespace CalculatorApp
void OnButtonPressed(Platform::Object ^ parameter);
Platform::String ^ ConvertToLocalizedString(const std::wstring& stringToLocalize, bool allowPartialStrings);
- void StartConversionResultTimer();
-
std::shared_ptr m_model;
wchar_t m_decimalSeparator;
@@ -326,8 +323,6 @@ namespace CalculatorApp
Platform::String ^ m_lastAnnouncedConversionResult;
bool m_isCurrencyDataLoaded;
-
- std::unique_ptr m_conversionResultTaskHelper;
};
class UnitConverterVMCallback : public UnitConversionManager::IUnitConverterVMCallback
diff --git a/src/CalcViewModel/packages.config b/src/CalcViewModel/packages.config
deleted file mode 100644
index c148e5d7..00000000
--- a/src/CalcViewModel/packages.config
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/src/Calculator/Calculator.vcxproj b/src/Calculator/Calculator.vcxproj
index 24908557..14ab6036 100644
--- a/src/Calculator/Calculator.vcxproj
+++ b/src/Calculator/Calculator.vcxproj
@@ -230,10 +230,12 @@
AboutFlyout.xaml
+
+
+
-
@@ -363,9 +365,10 @@
App.xaml
+
+
-
diff --git a/src/Calculator/Calculator.vcxproj.filters b/src/Calculator/Calculator.vcxproj.filters
index ee5ce92e..328c8bab 100644
--- a/src/Calculator/Calculator.vcxproj.filters
+++ b/src/Calculator/Calculator.vcxproj.filters
@@ -225,9 +225,6 @@
-
- Common
-
Controls
@@ -308,6 +305,10 @@
Controls
+
+ Common
+
+
@@ -315,9 +316,6 @@
Common
-
- Common
-
Controls
@@ -398,6 +396,13 @@
Controls
+
+ Common
+
+
+ Common
+
+
@@ -465,6 +470,7 @@
Views
+
@@ -1510,4 +1516,4 @@
-
+
\ No newline at end of file
diff --git a/src/Calculator/Common/AppLifecycleLogger.cpp b/src/Calculator/Common/AppLifecycleLogger.cpp
index 0df91361..bc4b760f 100644
--- a/src/Calculator/Common/AppLifecycleLogger.cpp
+++ b/src/Calculator/Common/AppLifecycleLogger.cpp
@@ -3,7 +3,7 @@
#include "pch.h"
#include "AppLifecycleLogger.h"
-#include "CalcViewModel/Common/TraceActivity.h"
+#include
using namespace std;
using namespace winrt;
diff --git a/src/Calculator/Common/BindableBase.cpp b/src/Calculator/Common/BindableBase.cpp
deleted file mode 100644
index ccba7985..00000000
--- a/src/Calculator/Common/BindableBase.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-#include "pch.h"
-#include "BindableBase.h"
-
-using namespace CalculatorApp::Common;
-
-using namespace Platform;
-using namespace Windows::UI::Xaml::Data;
-
-///
-/// Notifies listeners that a property value has changed.
-///
-/// Name of the property used to notify listeners.
-void BindableBase::OnPropertyChanged(String ^ propertyName)
-{
- PropertyChanged(this, ref new PropertyChangedEventArgs(propertyName));
-}
-
-Windows::UI::Xaml::Data::ICustomProperty ^ BindableBase::GetCustomProperty(Platform::String ^ name)
-{
- return nullptr;
-}
-
-Windows::UI::Xaml::Data::ICustomProperty ^ BindableBase::GetIndexedProperty(Platform::String ^ name, Windows::UI::Xaml::Interop::TypeName type)
-{
- return nullptr;
-}
-
-Platform::String ^ BindableBase::GetStringRepresentation()
-{
- return this->ToString();
-}
diff --git a/src/Calculator/Common/BindableBase.h b/src/Calculator/Common/BindableBase.h
deleted file mode 100644
index d1f958f5..00000000
--- a/src/Calculator/Common/BindableBase.h
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-#pragma once
-
-namespace CalculatorApp
-{
- namespace Common
- {
- ///
- /// Implementation of to simplify models.
- ///
- [Windows::Foundation::Metadata::WebHostHidden] public ref class BindableBase : Windows::UI::Xaml::DependencyObject,
- Windows::UI::Xaml::Data::INotifyPropertyChanged,
- Windows::UI::Xaml::Data::ICustomPropertyProvider
- {
- public:
- virtual event Windows::UI::Xaml::Data::PropertyChangedEventHandler ^ PropertyChanged;
-
- public:
- // ICustomPropertyProvider
- virtual Windows::UI::Xaml::Data::ICustomProperty ^ GetCustomProperty(Platform::String ^ name);
- virtual Windows::UI::Xaml::Data::ICustomProperty ^ GetIndexedProperty(Platform::String ^ name, Windows::UI::Xaml::Interop::TypeName type);
- virtual Platform::String ^ GetStringRepresentation();
-
- property Windows::UI::Xaml::Interop::TypeName Type
- {
- virtual Windows::UI::Xaml::Interop::TypeName get()
- {
- return this->GetType();
- }
- }
-
- protected:
- virtual void OnPropertyChanged(Platform::String ^ propertyName);
- };
- }
-}
diff --git a/src/CalcViewModel/Common/KeyboardShortcutManager.cpp b/src/Calculator/Common/KeyboardShortcutManager.cpp
similarity index 99%
rename from src/CalcViewModel/Common/KeyboardShortcutManager.cpp
rename to src/Calculator/Common/KeyboardShortcutManager.cpp
index 8990d5e8..d828a864 100644
--- a/src/CalcViewModel/Common/KeyboardShortcutManager.cpp
+++ b/src/Calculator/Common/KeyboardShortcutManager.cpp
@@ -3,9 +3,9 @@
#include "pch.h"
#include "KeyboardShortcutManager.h"
-#include "AppResourceProvider.h"
-#include "ApplicationViewModel.h"
-#include "LocalizationSettings.h"
+#include "CalcViewModel/Common/AppResourceProvider.h"
+#include "CalcViewModel/ApplicationViewModel.h"
+#include "CalcViewModel/Common/LocalizationSettings.h"
using namespace Concurrency;
using namespace Platform;
diff --git a/src/CalcViewModel/Common/KeyboardShortcutManager.h b/src/Calculator/Common/KeyboardShortcutManager.h
similarity index 97%
rename from src/CalcViewModel/Common/KeyboardShortcutManager.h
rename to src/Calculator/Common/KeyboardShortcutManager.h
index 6663f2ce..0d6fce55 100644
--- a/src/CalcViewModel/Common/KeyboardShortcutManager.h
+++ b/src/Calculator/Common/KeyboardShortcutManager.h
@@ -3,8 +3,8 @@
#pragma once
-#include "Utils.h"
-#include "MyVirtualKey.h"
+#include "CalcViewModel/Common/Utils.h"
+#include "CalcViewModel/Common/MyVirtualKey.h"
namespace CalculatorApp
{
diff --git a/src/CalcViewModel/Common/ValidatingConverters.h b/src/Calculator/Common/ValidatingConverters.h
similarity index 100%
rename from src/CalcViewModel/Common/ValidatingConverters.h
rename to src/Calculator/Common/ValidatingConverters.h
diff --git a/src/Calculator/Common/ViewState.cpp b/src/Calculator/Common/ViewState.cpp
new file mode 100644
index 00000000..63a5d30e
--- /dev/null
+++ b/src/Calculator/Common/ViewState.cpp
@@ -0,0 +1,19 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+#include "pch.h"
+#include "ViewState.h"
+
+namespace CalculatorApp
+{
+ namespace ViewState
+ {
+ Platform::StringReference Snap(L"Snap");
+ Platform::StringReference DockedView(L"DockedView");
+
+ bool IsValidViewState(Platform::String ^ viewState)
+ {
+ return viewState->Equals(ViewState::Snap) || viewState->Equals(ViewState::DockedView);
+ }
+ }
+}
diff --git a/src/Calculator/Common/ViewState.h b/src/Calculator/Common/ViewState.h
new file mode 100644
index 00000000..0a103d09
--- /dev/null
+++ b/src/Calculator/Common/ViewState.h
@@ -0,0 +1,15 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+#pragma once
+
+namespace CalculatorApp
+{
+ namespace ViewState
+ {
+ extern Platform::StringReference Snap;
+ extern Platform::StringReference DockedView;
+
+ bool IsValidViewState(Platform::String ^ viewState);
+ }
+}
diff --git a/src/Calculator/Views/CalculatorScientificOperators.xaml.cpp b/src/Calculator/Views/CalculatorScientificOperators.xaml.cpp
index 45f06431..5b7b612d 100644
--- a/src/Calculator/Views/CalculatorScientificOperators.xaml.cpp
+++ b/src/Calculator/Views/CalculatorScientificOperators.xaml.cpp
@@ -8,7 +8,7 @@
#include "pch.h"
#include "CalculatorScientificOperators.xaml.h"
-#include "CalcViewModel/Common/KeyboardShortcutManager.h"
+#include "Common/KeyboardShortcutManager.h"
#include "CalcViewModel/Common/TraceLogger.h"
#include "Controls/CalculatorButton.h"
#include "CalcViewModel/StandardCalculatorViewModel.h"
diff --git a/src/Calculator/Views/DateCalculator.xaml b/src/Calculator/Views/DateCalculator.xaml
index 37e007db..43ae80a8 100644
--- a/src/Calculator/Views/DateCalculator.xaml
+++ b/src/Calculator/Views/DateCalculator.xaml
@@ -403,7 +403,7 @@
Grid.Row="2"
Visibility="{Binding IsDateDiffMode, Converter={StaticResource BooleanToVisibilityConverter}}">
-
+
diff --git a/src/Calculator/Views/MainPage.xaml.cpp b/src/Calculator/Views/MainPage.xaml.cpp
index e9b29fe1..c7ba04ee 100644
--- a/src/Calculator/Views/MainPage.xaml.cpp
+++ b/src/Calculator/Views/MainPage.xaml.cpp
@@ -4,7 +4,6 @@
#include "pch.h"
#include "MainPage.xaml.h"
#include "CalcViewModel/Common/TraceLogger.h"
-#include "CalcViewModel/Common/KeyboardShortcutManager.h"
#include "CalcViewModel/Common/LocalizationService.h"
#include "CalcViewModel/Common/Automation/NarratorNotifier.h"
#include "CalcViewModel/Common/AppResourceProvider.h"
@@ -12,6 +11,8 @@
#include "Converters/BooleanToVisibilityConverter.h"
#include "CalcViewModel/Common/LocalizationStringUtil.h"
#include "Common/AppLifecycleLogger.h"
+#include "Common/KeyboardShortcutManager.h"
+
using namespace CalculatorApp;
using namespace CalculatorApp::Common;
using namespace CalculatorApp::Common::Automation;
diff --git a/src/Calculator/Views/NumberPad.xaml.h b/src/Calculator/Views/NumberPad.xaml.h
index 1dc10ce0..806da99b 100644
--- a/src/Calculator/Views/NumberPad.xaml.h
+++ b/src/Calculator/Views/NumberPad.xaml.h
@@ -9,7 +9,7 @@
#pragma once
#include "Views/NumberPad.g.h"
-#include "CalcViewModel/Common/KeyboardShortcutManager.h"
+#include "Common/KeyboardShortcutManager.h"
#include "CalcViewModel/Common/NumberBase.h"
#include "CalcManager/Header Files/RadixType.h"
diff --git a/src/Calculator/Views/UnitConverter.xaml.cpp b/src/Calculator/Views/UnitConverter.xaml.cpp
index f1bafdea..88ff8f33 100644
--- a/src/Calculator/Views/UnitConverter.xaml.cpp
+++ b/src/Calculator/Views/UnitConverter.xaml.cpp
@@ -11,9 +11,9 @@
#include "Controls/CalculationResult.h"
#include "Controls/CalculatorButton.h"
#include "CalcViewModel/Common/CopyPasteManager.h"
-#include "CalcViewModel/Common/KeyboardShortcutManager.h"
#include "CalcViewModel/Common/LocalizationService.h"
#include "CalcViewModel/Common/LocalizationSettings.h"
+#include "Common/KeyboardShortcutManager.h"
using namespace std;
using namespace CalculatorApp;
diff --git a/src/Calculator/Views/UnitConverter.xaml.h b/src/Calculator/Views/UnitConverter.xaml.h
index 5b460fa6..16c669c0 100644
--- a/src/Calculator/Views/UnitConverter.xaml.h
+++ b/src/Calculator/Views/UnitConverter.xaml.h
@@ -8,7 +8,7 @@
#include "Views/UnitConverter.g.h"
#include "Common/AlwaysSelectedCollectionView.h"
-#include "CalcViewModel/Common/ValidatingConverters.h"
+#include "Common/ValidatingConverters.h"
#include "Converters/BooleanToVisibilityConverter.h"
#include "Converters/VisibilityNegationConverter.h"
#include "CalcViewModel/UnitConverterViewModel.h"
diff --git a/src/Calculator/WindowFrameService.cpp b/src/Calculator/WindowFrameService.cpp
index 37ad911b..5d39c5fd 100644
--- a/src/Calculator/WindowFrameService.cpp
+++ b/src/Calculator/WindowFrameService.cpp
@@ -3,7 +3,7 @@
#include "pch.h"
#include "WindowFrameService.h"
-#include "CalcViewModel/Common/KeyboardShortcutManager.h"
+#include "Common/KeyboardShortcutManager.h"
#include "CalcViewModel/Common/TraceLogger.h"
using namespace concurrency;