Merge branch 'master' into patch-2

This commit is contained in:
Alfonso Gregory 2021-07-15 11:27:44 -04:00 committed by GitHub
commit 34521dbf0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
300 changed files with 14563 additions and 16717 deletions

View file

@ -16,8 +16,8 @@ pr: none
variables:
versionMajor: 10
versionMinor: 2103
versionBuild: $[counter('10.2103.*', 0)]
versionMinor: 2108
versionBuild: $[counter('10.2108.*', 0)]
versionPatch: 0
name: '$(versionMajor).$(versionMinor).$(versionBuild).$(versionPatch)'

View file

@ -42,11 +42,28 @@ jobs:
treatNotIndexedAsWarning: true
symbolsArtifactName: $(System.teamProject)/$(Build.BuildNumber)_$(BuildPlatform)$(BuildConfiguration)
- task: CopyFiles@2
displayName: Copy Files for BinSkim analysis
inputs:
SourceFolder: '$(Build.BinariesDirectory)\$(BuildConfiguration)\$(BuildPlatform)\Calculator\'
# Setting up a folder to store all the binary files that we need BinSkim to scan.
# If we put more things than we produce pdbs for and can index (such as nuget packages that ship without pdbs), binskim will fail.
# Below are ignored files
# - clrcompression.dll
Contents: |
**\*
!**\clrcompression.dll
TargetFolder: '$(Agent.BuildDirectory)\binskim'
CleanTargetFolder: true
OverWrite: true
flattenFolders: false
analyzeTarget: '$(Agent.BuildDirectory)\binskim\*'
- task: securedevelopmentteam.vss-secure-development-tools.build-task-binskim.BinSkim@3
displayName: Run BinSkim
inputs:
inputType: Basic
analyzeTarget: $(Build.BinariesDirectory)\$(BuildConfiguration)\$(BuildPlatform)\Calculator\*
analyzeTarget: '$(Agent.BuildDirectory)\binskim\*'
analyzeVerbose: true
analyzeHashes: true
continueOnError: true

View file

@ -29,7 +29,7 @@ steps:
inputs:
solution: src/Calculator.sln
vsVersion: 16.0
msbuildArgs: /bl:$(Build.BinariesDirectory)\$(BuildConfiguration)\$(BuildPlatform)\Calculator.binlog /p:OutDir=$(Build.BinariesDirectory)\$(BuildConfiguration)\$(BuildPlatform)\ /p:GenerateProjectSpecificOutputFolder=true /p:AppVersion=$(Build.BuildNumber) /t:Publish /p:PublishDir=$(Build.BinariesDirectory)\$(BuildConfiguration)\$(BuildPlatform)\publish\ ${{ parameters.extraMsBuildArgs }}
msbuildArgs: /bl:$(Build.BinariesDirectory)\$(BuildConfiguration)\$(BuildPlatform)\Calculator.binlog /p:OutDir=$(Build.BinariesDirectory)\$(BuildConfiguration)\$(BuildPlatform)\ /p:GenerateProjectSpecificOutputFolder=true /p:Version=$(Build.BuildNumber) /t:Publish /p:PublishDir=$(Build.BinariesDirectory)\$(BuildConfiguration)\$(BuildPlatform)\publish\ ${{ parameters.extraMsBuildArgs }}
platform: $(BuildPlatform)
configuration: $(BuildConfiguration)
maximumCpuCount: true

View file

@ -12,8 +12,8 @@
#include "DataLoaders/UnitConverterDataLoader.h"
using namespace CalculatorApp;
using namespace CalculatorApp::Common;
using namespace CalculatorApp::DataLoaders;
using namespace CalculatorApp::ViewModel::Common;
using namespace CalculatorApp::ViewModel::DataLoaders;
using namespace CalculatorApp::ViewModel;
using namespace CalculationManager;
using namespace Platform;

View file

@ -17,14 +17,14 @@ namespace CalculatorApp
public:
ApplicationViewModel();
void Initialize(CalculatorApp::Common::ViewMode mode); // Use for first init, use deserialize for rehydration
void Initialize(CalculatorApp::ViewModel::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::Common::ViewMode, PreviousMode);
OBSERVABLE_PROPERTY_RW(CalculatorApp::ViewModel::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::Common::ViewMode Mode
property CalculatorApp::ViewModel::Common::ViewMode Mode
{
CalculatorApp::Common::ViewMode get()
CalculatorApp::ViewModel::Common::ViewMode get()
{
return m_mode;
}
void set(CalculatorApp::Common::ViewMode value);
void set(CalculatorApp::ViewModel::Common::ViewMode value);
}
static property Platform::String^ ModePropertyName
{
@ -51,21 +51,21 @@ namespace CalculatorApp
}
}
property Windows::Foundation::Collections::IObservableVector<CalculatorApp::Common::NavCategoryGroup^>^ Categories
property Windows::Foundation::Collections::IObservableVector<CalculatorApp::ViewModel::Common::NavCategoryGroup^>^ Categories
{
Windows::Foundation::Collections::IObservableVector<CalculatorApp::Common::NavCategoryGroup^>^ get()
Windows::Foundation::Collections::IObservableVector<CalculatorApp::ViewModel::Common::NavCategoryGroup^>^ get()
{
return m_categories;
}
void set(Windows::Foundation::Collections::IObservableVector<CalculatorApp::Common::NavCategoryGroup^>^ value);
void set(Windows::Foundation::Collections::IObservableVector<CalculatorApp::ViewModel::Common::NavCategoryGroup^>^ value);
}
property Windows::UI::Xaml::Visibility ClearMemoryVisibility
{
Windows::UI::Xaml::Visibility get()
{
return CalculatorApp::Common::NavCategory::IsCalculatorViewMode(Mode) ? Windows::UI::Xaml::Visibility::Visible
return CalculatorApp::ViewModel::Common::NavCategory::IsCalculatorViewMode(Mode) ? Windows::UI::Xaml::Visibility::Visible
: Windows::UI::Xaml::Visibility::Collapsed;
}
}
@ -106,8 +106,8 @@ namespace CalculatorApp
void SetMenuCategories();
CalculatorApp::Common::ViewMode m_mode;
Windows::Foundation::Collections::IObservableVector<CalculatorApp::Common::NavCategoryGroup ^> ^ m_categories;
CalculatorApp::ViewModel::Common::ViewMode m_mode;
Windows::Foundation::Collections::IObservableVector<CalculatorApp::ViewModel::Common::NavCategoryGroup ^> ^ m_categories;
Concurrency::task<void> HandleToggleAlwaysOnTop(float width, float height);
void SetDisplayNormalAlwaysOnTopOption();
};

View file

@ -1,9 +1,9 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#define APP_FILE_NAME "Calculator"
#define APP_FILE_NAME "CalcViewModel"
#define APP_FILE_IS_EXE
#define APP_PRODUCT_NAME "Microsoft Calculator"
#define APP_PRODUCT_NAME "Microsoft Calculator ViewModel"
#define APP_COMPANY_NAME "Microsoft Corporation"
#define APP_COPYRIGHT "\251 Microsoft Corporation. All rights reserved."

View file

@ -35,9 +35,9 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{90e9761d-9262-4773-942d-caeae75d7140}</ProjectGuid>
<Keyword>StaticLibrary</Keyword>
<RootNamespace>CalcViewModel</RootNamespace>
<ProjectGuid>{812d1a7b-b8ac-49e4-8e6d-af5d59500d56}</ProjectGuid>
<Keyword>WindowsRuntimeComponent</Keyword>
<RootNamespace>CalculatorApp.ViewModel</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<AppContainerApplication>true</AppContainerApplication>
@ -48,45 +48,45 @@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v142</PlatformToolset>
@ -105,13 +105,13 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@ -122,175 +122,181 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<GenerateManifest>false</GenerateManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<GenerateManifest>false</GenerateManifest>
<GenerateProjectSpecificOutputFolder>true</GenerateProjectSpecificOutputFolder>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4453</DisableSpecificWarnings>
<AdditionalOptions>/bigobj /await /std:c++17 /utf-8 %(AdditionalOptions)</AdditionalOptions>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<PreprocessorDefinitions>_WINRT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
<AdditionalIncludeDirectories>$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalOptions>/bigobj /await %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>28204;4453</DisableSpecificWarnings>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
</Link>
<Lib>
<AdditionalOptions>/ignore:4264 %(AdditionalOptions)</AdditionalOptions>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4453</DisableSpecificWarnings>
<AdditionalOptions>/bigobj /await /std:c++17 /utf-8 %(AdditionalOptions)</AdditionalOptions>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<PreprocessorDefinitions>_WINRT_DLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
<AdditionalIncludeDirectories>$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalOptions>/bigobj /await %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>28204;4453</DisableSpecificWarnings>
<LanguageStandard>stdcpp17</LanguageStandard>
<ControlFlowGuard>Guard</ControlFlowGuard>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
</Link>
<Lib>
<AdditionalOptions>/ignore:4264 %(AdditionalOptions)</AdditionalOptions>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|arm'">
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4453</DisableSpecificWarnings>
<AdditionalOptions>/bigobj /await /std:c++17 /utf-8 %(AdditionalOptions)</AdditionalOptions>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<PreprocessorDefinitions>_WINRT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
<AdditionalIncludeDirectories>$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalOptions>/bigobj /await %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>28204;4453</DisableSpecificWarnings>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
</Link>
<Lib>
<AdditionalOptions>/ignore:4264 %(AdditionalOptions)</AdditionalOptions>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|arm'">
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4453</DisableSpecificWarnings>
<AdditionalOptions>/bigobj /await /std:c++17 /utf-8 %(AdditionalOptions)</AdditionalOptions>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<PreprocessorDefinitions>_WINRT_DLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
<AdditionalIncludeDirectories>$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalOptions>/bigobj /await %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>28204;4453</DisableSpecificWarnings>
<LanguageStandard>stdcpp17</LanguageStandard>
<ControlFlowGuard>Guard</ControlFlowGuard>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PreprocessorDefinitions>_WINRT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
<AdditionalIncludeDirectories>$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalOptions>/bigobj /await %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>28204;4453</DisableSpecificWarnings>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<PreprocessorDefinitions>_WINRT_DLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
<AdditionalIncludeDirectories>$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalOptions>/bigobj /await %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>28204;4453</DisableSpecificWarnings>
<LanguageStandard>stdcpp17</LanguageStandard>
<ControlFlowGuard>Guard</ControlFlowGuard>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
</Link>
<Lib>
<AdditionalOptions>/ignore:4264 %(AdditionalOptions)</AdditionalOptions>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4453</DisableSpecificWarnings>
<AdditionalOptions>/bigobj /await /std:c++17 /utf-8 %(AdditionalOptions)</AdditionalOptions>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<PreprocessorDefinitions>_WINRT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
<AdditionalIncludeDirectories>$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalOptions>/bigobj /await %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>28204;4453</DisableSpecificWarnings>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
</Link>
<Lib>
<AdditionalOptions>/ignore:4264 %(AdditionalOptions)</AdditionalOptions>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4453</DisableSpecificWarnings>
<AdditionalOptions>/bigobj /await /std:c++17 /utf-8 %(AdditionalOptions)</AdditionalOptions>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<PreprocessorDefinitions>_WINRT_DLL;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
<AdditionalIncludeDirectories>$(SolutionDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>
<AdditionalOptions>/bigobj /await %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>28204;4453</DisableSpecificWarnings>
<LanguageStandard>stdcpp17</LanguageStandard>
<ControlFlowGuard>Guard</ControlFlowGuard>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
</Link>
<Lib>
<AdditionalOptions>/ignore:4264 %(AdditionalOptions)</AdditionalOptions>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|arm64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4453</DisableSpecificWarnings>
<AdditionalOptions>/bigobj /await /std:c++17 /utf-8 %(AdditionalOptions)</AdditionalOptions>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
</Link>
<Lib>
<AdditionalOptions>/ignore:4264 %(AdditionalOptions)</AdditionalOptions>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|arm64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4453</DisableSpecificWarnings>
<AdditionalOptions>/bigobj /await /std:c++17 /utf-8 %(AdditionalOptions)</AdditionalOptions>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
</Link>
<Lib>
<AdditionalOptions>/ignore:4264 %(AdditionalOptions)</AdditionalOptions>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(IsStoreBuild)' == 'True'">
<ClCompile>
<AdditionalOptions>/DSEND_DIAGNOSTICS %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<Version Condition="'$(Version)' == ''">0.0.0.0</Version>
</PropertyGroup>
<ItemGroup>
<ResourceCompile Include="CalcViewModel.rc" PreprocessorDefinitions="%(PreprocessorDefinitions);APP_VERSION_MAJOR=$(Version.Split(`.`)[0]);APP_VERSION_MINOR=$(Version.Split(`.`)[1]);APP_VERSION_BUILD=$(Version.Split(`.`)[2]);APP_VERSION_REVISION=$(Version.Split(`.`)[3])" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="ApplicationViewModel.h" />
<ClInclude Include="Common\AppResourceProvider.h" />
@ -314,6 +320,7 @@
<ClInclude Include="Common\NavCategory.h" />
<ClInclude Include="Common\NetworkManager.h" />
<ClInclude Include="Common\NumberBase.h" />
<ClInclude Include="Common\RadixType.h" />
<ClInclude Include="Common\TraceLogger.h" />
<ClInclude Include="Common\Utils.h" />
<ClInclude Include="DataLoaders\CurrencyDataLoader.h" />
@ -350,6 +357,7 @@
<ClCompile Include="Common\LocalizationService.cpp" />
<ClCompile Include="Common\NavCategory.cpp" />
<ClCompile Include="Common\NetworkManager.cpp" />
<ClCompile Include="Common\RadixType.cpp" />
<ClCompile Include="Common\TraceLogger.cpp" />
<ClCompile Include="Common\Utils.cpp" />
<ClCompile Include="DataLoaders\CurrencyDataLoader.cpp" />
@ -365,10 +373,10 @@
<ClCompile Include="pch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
@ -407,5 +415,6 @@
<None Include="DataLoaders\DefaultFromToCurrency.json" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View file

@ -2,27 +2,20 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Common">
<UniqueIdentifier>{1daab7c4-63f6-4266-a259-f34acad66d09}</UniqueIdentifier>
<UniqueIdentifier>{05fb7833-4679-4430-bf21-808354e815bf}</UniqueIdentifier>
</Filter>
<Filter Include="Common\Automation">
<UniqueIdentifier>{8d4edf06-c312-4312-978a-b6c2beb8295a}</UniqueIdentifier>
<UniqueIdentifier>{8f1ef587-e5ce-4fc2-b9b7-73326d5e779a}</UniqueIdentifier>
</Filter>
<Filter Include="DataLoaders">
<UniqueIdentifier>{0184f727-b8aa-4af8-a699-63f1b56e7853}</UniqueIdentifier>
<UniqueIdentifier>{70216695-3d7b-451a-98e4-cacbea3ba0a6}</UniqueIdentifier>
</Filter>
<Filter Include="GraphingCalculator">
<UniqueIdentifier>{cf7dca32-9727-4f98-83c3-1c0ca7dd1e0c}</UniqueIdentifier>
<UniqueIdentifier>{9b94309f-6b9b-4cbb-8584-4273061cc432}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="pch.cpp" />
<ClCompile Include="ApplicationViewModel.cpp" />
<ClCompile Include="DateCalculatorViewModel.cpp" />
<ClCompile Include="HistoryItemViewModel.cpp" />
<ClCompile Include="HistoryViewModel.cpp" />
<ClCompile Include="MemoryItemViewModel.cpp" />
<ClCompile Include="StandardCalculatorViewModel.cpp" />
<ClCompile Include="UnitConverterViewModel.cpp" />
<ClCompile Include="Common\AppResourceProvider.cpp">
<Filter>Common</Filter>
</ClCompile>
@ -56,12 +49,18 @@
<ClCompile Include="Common\NetworkManager.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="Common\RadixType.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="Common\TraceLogger.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="Common\Utils.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="Common\Automation\NarratorAnnouncement.cpp">
<Filter>Common\Automation</Filter>
</ClCompile>
<ClCompile Include="Common\Automation\NarratorNotifier.cpp">
<Filter>Common\Automation</Filter>
</ClCompile>
@ -80,26 +79,25 @@
<ClCompile Include="GraphingCalculator\GraphingCalculatorViewModel.cpp">
<Filter>GraphingCalculator</Filter>
</ClCompile>
<ClCompile Include="Common\Automation\NarratorAnnouncement.cpp">
<Filter>Common\Automation</Filter>
</ClCompile>
<ClCompile Include="GraphingCalculator\GraphingSettingsViewModel.cpp">
<Filter>GraphingCalculator</Filter>
</ClCompile>
<ClCompile Include="ApplicationViewModel.cpp" />
<ClCompile Include="DateCalculatorViewModel.cpp" />
<ClCompile Include="HistoryItemViewModel.cpp" />
<ClCompile Include="HistoryViewModel.cpp" />
<ClCompile Include="MemoryItemViewModel.cpp" />
<ClCompile Include="StandardCalculatorViewModel.cpp" />
<ClCompile Include="UnitConverterViewModel.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
<ClInclude Include="targetver.h" />
<ClInclude Include="ApplicationViewModel.h" />
<ClInclude Include="DateCalculatorViewModel.h" />
<ClInclude Include="HistoryItemViewModel.h" />
<ClInclude Include="HistoryViewModel.h" />
<ClInclude Include="MemoryItemViewModel.h" />
<ClInclude Include="StandardCalculatorViewModel.h" />
<ClInclude Include="UnitConverterViewModel.h" />
<ClInclude Include="Common\AppResourceProvider.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="Common\BitLength.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="Common\CalculatorButtonPressedEventArgs.h">
<Filter>Common</Filter>
</ClInclude>
@ -115,6 +113,9 @@
<ClInclude Include="Common\DateCalculator.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="Common\DelegateCommand.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="Common\DisplayExpressionToken.h">
<Filter>Common</Filter>
</ClInclude>
@ -145,12 +146,21 @@
<ClInclude Include="Common\NetworkManager.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="Common\NumberBase.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="Common\RadixType.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="Common\TraceLogger.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="Common\Utils.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="Common\Automation\NarratorAnnouncement.h">
<Filter>Common\Automation</Filter>
</ClInclude>
<ClInclude Include="Common\Automation\NarratorNotifier.h">
<Filter>Common\Automation</Filter>
</ClInclude>
@ -160,6 +170,9 @@
<ClInclude Include="DataLoaders\CurrencyHttpClient.h">
<Filter>DataLoaders</Filter>
</ClInclude>
<ClInclude Include="DataLoaders\DataLoaderMockConstants.h">
<Filter>DataLoaders</Filter>
</ClInclude>
<ClInclude Include="DataLoaders\ICurrencyHttpClient.h">
<Filter>DataLoaders</Filter>
</ClInclude>
@ -169,43 +182,31 @@
<ClInclude Include="DataLoaders\UnitConverterDataLoader.h">
<Filter>DataLoaders</Filter>
</ClInclude>
<ClInclude Include="DataLoaders\DataLoaderMockConstants.h">
<Filter>DataLoaders</Filter>
</ClInclude>
<ClInclude Include="Common\Automation\NarratorAnnouncement.h">
<Filter>Common\Automation</Filter>
</ClInclude>
<ClInclude Include="Common\BitLength.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="Common\NumberBase.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="GraphingCalculator\EquationViewModel.h">
<Filter>GraphingCalculator</Filter>
</ClInclude>
<ClInclude Include="GraphingCalculator\GraphingCalculatorViewModel.h">
<Filter>GraphingCalculator</Filter>
</ClInclude>
<ClInclude Include="GraphingCalculatorEnums.h">
<Filter>Common</Filter>
<ClInclude Include="GraphingCalculator\GraphingSettingsViewModel.h">
<Filter>GraphingCalculator</Filter>
</ClInclude>
<ClInclude Include="GraphingCalculator\VariableViewModel.h">
<Filter>GraphingCalculator</Filter>
</ClInclude>
<ClInclude Include="GraphingCalculator\GraphingSettingsViewModel.h">
<Filter>GraphingCalculator</Filter>
</ClInclude>
<ClInclude Include="Common\DelegateCommand.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="ApplicationViewModel.h" />
<ClInclude Include="DateCalculatorViewModel.h" />
<ClInclude Include="GraphingCalculatorEnums.h" />
<ClInclude Include="HistoryItemViewModel.h" />
<ClInclude Include="HistoryViewModel.h" />
<ClInclude Include="MemoryItemViewModel.h" />
<ClInclude Include="StandardCalculatorViewModel.h" />
<ClInclude Include="targetver.h" />
<ClInclude Include="UnitConverterViewModel.h" />
</ItemGroup>
<ItemGroup>
<None Include="DataLoaders\DefaultFromToCurrency.json">
<Filter>DataLoaders</Filter>
</None>
</ItemGroup>
<ItemGroup>
<Page Include="$(MSBuildThisFileDirectory)DensityStyles\Compact.xaml" />
</ItemGroup>
</Project>

View file

@ -7,6 +7,7 @@
using namespace Platform;
using namespace Windows::ApplicationModel::Resources;
using namespace CalculatorApp;
using namespace CalculatorApp::ViewModel::Common;
AppResourceProvider::AppResourceProvider()
{

View file

@ -3,7 +3,7 @@
#pragma once
namespace CalculatorApp
namespace CalculatorApp::ViewModel::Common
{
public ref class AppResourceProvider sealed
{

View file

@ -9,7 +9,7 @@
// being used. Depending on the version of the OS the app is running on,
// the app may need a host that uses LiveRegionChanged or RaiseNotification.
namespace CalculatorApp::Common::Automation
namespace CalculatorApp::ViewModel::Common::Automation
{
public
interface class INarratorAnnouncementHost

View file

@ -4,7 +4,7 @@
#include "pch.h"
#include "LiveRegionHost.h"
using namespace CalculatorApp::Common::Automation;
using namespace CalculatorApp::ViewModel::Common::Automation;
using namespace Windows::UI::Xaml::Automation;
using namespace Windows::UI::Xaml::Automation::Peers;
using namespace Windows::UI::Xaml::Controls;

View file

@ -9,7 +9,7 @@
// This event is unreliable and should be deprecated in favor of the new
// RaiseNotification API in RS3.
namespace CalculatorApp::Common::Automation
namespace CalculatorApp::ViewModel::Common::Automation
{
// This class exists so that the app can run on RS2 and use LiveRegions
// to host notifications on those builds.

View file

@ -4,11 +4,11 @@
#include "pch.h"
#include "NarratorAnnouncement.h"
using namespace CalculatorApp::Common::Automation;
using namespace CalculatorApp::ViewModel::Common::Automation;
using namespace Platform;
using namespace Windows::UI::Xaml::Automation::Peers;
namespace CalculatorApp::Common::Automation
namespace CalculatorApp::ViewModel::Common::Automation
{
namespace CalculatorActivityIds
{

View file

@ -3,7 +3,7 @@
#pragma once
namespace CalculatorApp::Common::Automation
namespace CalculatorApp::ViewModel::Common::Automation
{
public
ref class NarratorAnnouncement sealed
@ -28,25 +28,23 @@ public
static bool IsValid(NarratorAnnouncement ^ announcement);
private:
// Make CalculatorAnnouncement a friend class so it is the only
// class that can access the private constructor.
friend class CalculatorAnnouncement;
Platform::String ^ m_announcement;
Platform::String ^ m_activityId;
Windows::UI::Xaml::Automation::Peers::AutomationNotificationKind m_kind;
Windows::UI::Xaml::Automation::Peers::AutomationNotificationProcessing m_processing;
internal:
NarratorAnnouncement(
Platform::String ^ announcement,
Platform::String ^ activityId,
Windows::UI::Xaml::Automation::Peers::AutomationNotificationKind kind,
Windows::UI::Xaml::Automation::Peers::AutomationNotificationProcessing processing);
Platform::String ^ m_announcement;
Platform::String ^ m_activityId;
Windows::UI::Xaml::Automation::Peers::AutomationNotificationKind m_kind;
Windows::UI::Xaml::Automation::Peers::AutomationNotificationProcessing m_processing;
};
// CalculatorAnnouncement is intended to contain only static methods
// that return announcements made for the Calculator app.
class CalculatorAnnouncement
public
ref class CalculatorAnnouncement sealed
{
public:
static NarratorAnnouncement ^ GetDisplayUpdatedAnnouncement(Platform::String ^ announcement);

View file

@ -6,7 +6,7 @@
#include "NotificationHost.h"
#include "LiveRegionHost.h"
using namespace CalculatorApp::Common::Automation;
using namespace CalculatorApp::ViewModel::Common::Automation;
using namespace std;
INarratorAnnouncementHost ^ NarratorAnnouncementHostFactory::s_hostProducer;

View file

@ -9,7 +9,7 @@
// Depending on the version of the OS the app is running on, the factory will return
// an announcement host appropriate for that version.
namespace CalculatorApp::Common::Automation
namespace CalculatorApp::ViewModel::Common::Automation
{
class NarratorAnnouncementHostFactory
{

View file

@ -6,7 +6,7 @@
#include "pch.h"
#include "NarratorNotifier.h"
using namespace CalculatorApp::Common::Automation;
using namespace CalculatorApp::ViewModel::Common::Automation;
using namespace Platform;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Automation;

View file

@ -6,7 +6,7 @@
#pragma once
#include "NarratorAnnouncement.h"
namespace CalculatorApp::Common::Automation
namespace CalculatorApp::ViewModel::Common::Automation
{
public
ref class NarratorNotifier sealed : public Windows::UI::Xaml::DependencyObject

View file

@ -4,7 +4,7 @@
#include "pch.h"
#include "NotificationHost.h"
using namespace CalculatorApp::Common::Automation;
using namespace CalculatorApp::ViewModel::Common::Automation;
using namespace Windows::Foundation::Metadata;
using namespace Windows::UI::Xaml::Automation;
using namespace Windows::UI::Xaml::Automation::Peers;

View file

@ -8,7 +8,7 @@
// This class announces NarratorAnnouncements using the RaiseNotification API
// available in RS3.
namespace CalculatorApp::Common::Automation
namespace CalculatorApp::ViewModel::Common::Automation
{
public
ref class NotificationHost sealed : public INarratorAnnouncementHost
@ -23,10 +23,10 @@ public
private:
static Windows::UI::Xaml::Automation::Peers::AutomationNotificationKind
GetWindowsNotificationKind(CalculatorApp::Common::Automation::AutomationNotificationKind customKindType);
GetWindowsNotificationKind(CalculatorApp::ViewModel::Common::Automation::AutomationNotificationKind customKindType);
static Windows::UI::Xaml::Automation::Peers::AutomationNotificationProcessing
GetWindowsNotificationProcessing(CalculatorApp::Common::Automation::AutomationNotificationProcessing customProcessingType);
GetWindowsNotificationProcessing(CalculatorApp::ViewModel::Common::Automation::AutomationNotificationProcessing customProcessingType);
private:
Windows::UI::Xaml::UIElement ^ m_host;

View file

@ -1,6 +1,6 @@
#pragma once
namespace CalculatorApp
namespace CalculatorApp::ViewModel
{
namespace Common
{

View file

@ -5,7 +5,8 @@
#include "CalculatorButtonPressedEventArgs.h"
using namespace CalculatorApp;
using namespace CalculatorApp::Common;
using namespace CalculatorApp::ViewModel;
using namespace CalculatorApp::ViewModel::Common;
using namespace Platform;
NumbersAndOperatorsEnum CalculatorButtonPressedEventArgs::GetOperationFromCommandParameter(_In_ Object ^ commandParameter)

View file

@ -6,7 +6,7 @@
#include "CalculatorButtonUser.h"
#include "Utils.h"
namespace CalculatorApp
namespace CalculatorApp::ViewModel
{
namespace Common
{
@ -15,15 +15,15 @@ namespace CalculatorApp
{
public:
PROPERTY_R(Platform::String ^, AuditoryFeedback);
PROPERTY_R(CalculatorApp::NumbersAndOperatorsEnum, Operation);
PROPERTY_R(CalculatorApp::ViewModel::Common::NumbersAndOperatorsEnum, Operation);
CalculatorButtonPressedEventArgs(Platform::String ^ feedback, CalculatorApp::NumbersAndOperatorsEnum operation)
CalculatorButtonPressedEventArgs(Platform::String ^ feedback, CalculatorApp::ViewModel::Common::NumbersAndOperatorsEnum operation)
: m_AuditoryFeedback(feedback)
, m_Operation(operation)
{
}
static CalculatorApp::NumbersAndOperatorsEnum GetOperationFromCommandParameter(_In_ Platform::Object ^ commandParameter);
static CalculatorApp::ViewModel::Common::NumbersAndOperatorsEnum GetOperationFromCommandParameter(_In_ Platform::Object ^ commandParameter);
static Platform::String ^ GetAuditoryFeedbackFromCommandParameter(_In_ Platform::Object ^ commandParameter);
};
}

View file

@ -5,12 +5,11 @@
#include "CalcManager/Command.h"
namespace CalculatorApp
namespace CalculatorApp::ViewModel::Common
{
namespace CM = CalculationManager;
public
enum class NumbersAndOperatorsEnum
public enum class NumbersAndOperatorsEnum
{
Zero = (int)CM::Command::Command0,
One = (int)CM::Command::Command1,

View file

@ -8,143 +8,149 @@
#include "StandardCalculatorViewModel.h"
using namespace CalculatorApp;
using namespace CalculatorApp::ViewModel;
using namespace CalculatorApp::ViewModel::Common;
using namespace CalculationManager;
using namespace Platform;
using namespace std;
CalculatorDisplay::CalculatorDisplay()
namespace CalculatorApp::ViewModel::Common
{
}
void CalculatorDisplay::SetCallback(Platform::WeakReference callbackReference)
{
m_callbackReference = callbackReference;
}
void CalculatorDisplay::SetHistoryCallback(Platform::WeakReference callbackReference)
{
m_historyCallbackReference = callbackReference;
}
void CalculatorDisplay::SetPrimaryDisplay(_In_ const wstring& displayStringValue, _In_ bool isError)
{
if (m_callbackReference)
CalculatorDisplay::CalculatorDisplay()
{
if (auto calcVM = m_callbackReference.Resolve<ViewModel::StandardCalculatorViewModel>())
}
void CalculatorDisplay::SetCallback(Platform::WeakReference callbackReference)
{
m_callbackReference = callbackReference;
}
void CalculatorDisplay::SetHistoryCallback(Platform::WeakReference callbackReference)
{
m_historyCallbackReference = callbackReference;
}
void CalculatorDisplay::SetPrimaryDisplay(_In_ const wstring& displayStringValue, _In_ bool isError)
{
if (m_callbackReference)
{
calcVM->SetPrimaryDisplay(StringReference(displayStringValue.c_str()), isError);
if (auto calcVM = m_callbackReference.Resolve<ViewModel::StandardCalculatorViewModel>())
{
calcVM->SetPrimaryDisplay(StringReference(displayStringValue.c_str()), isError);
}
}
}
void CalculatorDisplay::SetParenthesisNumber(_In_ unsigned int parenthesisCount)
{
if (m_callbackReference != nullptr)
{
if (auto calcVM = m_callbackReference.Resolve<ViewModel::StandardCalculatorViewModel>())
{
calcVM->SetParenthesisCount(parenthesisCount);
}
}
}
void CalculatorDisplay::OnNoRightParenAdded()
{
if (m_callbackReference != nullptr)
{
if (auto calcVM = m_callbackReference.Resolve<ViewModel::StandardCalculatorViewModel>())
{
calcVM->OnNoRightParenAdded();
}
}
}
void CalculatorDisplay::SetIsInError(bool isError)
{
if (m_callbackReference != nullptr)
{
if (auto calcVM = m_callbackReference.Resolve<ViewModel::StandardCalculatorViewModel>())
{
calcVM->IsInError = isError;
}
}
}
void CalculatorDisplay::SetExpressionDisplay(
_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)
{
if (m_callbackReference != nullptr)
{
if (auto calcVM = m_callbackReference.Resolve<ViewModel::StandardCalculatorViewModel>())
{
calcVM->SetExpressionDisplay(tokens, commands);
}
}
}
void CalculatorDisplay::SetMemorizedNumbers(_In_ const vector<std::wstring>& newMemorizedNumbers)
{
if (m_callbackReference != nullptr)
{
if (auto calcVM = m_callbackReference.Resolve<ViewModel::StandardCalculatorViewModel>())
{
calcVM->SetMemorizedNumbers(newMemorizedNumbers);
}
}
}
void CalculatorDisplay::OnHistoryItemAdded(_In_ unsigned int addedItemIndex)
{
if (m_historyCallbackReference != nullptr)
{
if (auto historyVM = m_historyCallbackReference.Resolve<ViewModel::HistoryViewModel>())
{
historyVM->OnHistoryItemAdded(addedItemIndex);
}
}
}
void CalculatorDisplay::MaxDigitsReached()
{
if (m_callbackReference != nullptr)
{
if (auto calcVM = m_callbackReference.Resolve<ViewModel::StandardCalculatorViewModel>())
{
calcVM->OnMaxDigitsReached();
}
}
}
void CalculatorDisplay::BinaryOperatorReceived()
{
if (m_callbackReference != nullptr)
{
if (auto calcVM = m_callbackReference.Resolve<ViewModel::StandardCalculatorViewModel>())
{
calcVM->OnBinaryOperatorReceived();
}
}
}
void CalculatorDisplay::MemoryItemChanged(unsigned int indexOfMemory)
{
if (m_callbackReference != nullptr)
{
if (auto calcVM = m_callbackReference.Resolve<ViewModel::StandardCalculatorViewModel>())
{
calcVM->OnMemoryItemChanged(indexOfMemory);
}
}
}
void CalculatorDisplay::InputChanged()
{
if (m_callbackReference != nullptr)
{
if (auto calcVM = m_callbackReference.Resolve<ViewModel::StandardCalculatorViewModel>())
{
calcVM->OnInputChanged();
}
}
}
}
void CalculatorDisplay::SetParenthesisNumber(_In_ unsigned int parenthesisCount)
{
if (m_callbackReference != nullptr)
{
if (auto calcVM = m_callbackReference.Resolve<ViewModel::StandardCalculatorViewModel>())
{
calcVM->SetParenthesisCount(parenthesisCount);
}
}
}
void CalculatorDisplay::OnNoRightParenAdded()
{
if (m_callbackReference != nullptr)
{
if (auto calcVM = m_callbackReference.Resolve<ViewModel::StandardCalculatorViewModel>())
{
calcVM->OnNoRightParenAdded();
}
}
}
void CalculatorDisplay::SetIsInError(bool isError)
{
if (m_callbackReference != nullptr)
{
if (auto calcVM = m_callbackReference.Resolve<ViewModel::StandardCalculatorViewModel>())
{
calcVM->IsInError = isError;
}
}
}
void CalculatorDisplay::SetExpressionDisplay(
_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)
{
if (m_callbackReference != nullptr)
{
if (auto calcVM = m_callbackReference.Resolve<ViewModel::StandardCalculatorViewModel>())
{
calcVM->SetExpressionDisplay(tokens, commands);
}
}
}
void CalculatorDisplay::SetMemorizedNumbers(_In_ const vector<std::wstring>& newMemorizedNumbers)
{
if (m_callbackReference != nullptr)
{
if (auto calcVM = m_callbackReference.Resolve<ViewModel::StandardCalculatorViewModel>())
{
calcVM->SetMemorizedNumbers(newMemorizedNumbers);
}
}
}
void CalculatorDisplay::OnHistoryItemAdded(_In_ unsigned int addedItemIndex)
{
if (m_historyCallbackReference != nullptr)
{
if (auto historyVM = m_historyCallbackReference.Resolve<ViewModel::HistoryViewModel>())
{
historyVM->OnHistoryItemAdded(addedItemIndex);
}
}
}
void CalculatorDisplay::MaxDigitsReached()
{
if (m_callbackReference != nullptr)
{
if (auto calcVM = m_callbackReference.Resolve<ViewModel::StandardCalculatorViewModel>())
{
calcVM->OnMaxDigitsReached();
}
}
}
void CalculatorDisplay::BinaryOperatorReceived()
{
if (m_callbackReference != nullptr)
{
if (auto calcVM = m_callbackReference.Resolve<ViewModel::StandardCalculatorViewModel>())
{
calcVM->OnBinaryOperatorReceived();
}
}
}
void CalculatorDisplay::MemoryItemChanged(unsigned int indexOfMemory)
{
if (m_callbackReference != nullptr)
{
if (auto calcVM = m_callbackReference.Resolve<ViewModel::StandardCalculatorViewModel>())
{
calcVM->OnMemoryItemChanged(indexOfMemory);
}
}
}
void CalculatorDisplay::InputChanged()
{
if (m_callbackReference != nullptr)
{
if (auto calcVM = m_callbackReference.Resolve<ViewModel::StandardCalculatorViewModel>())
{
calcVM->OnInputChanged();
}
}
}

View file

@ -5,7 +5,7 @@
#include "CalcManager/Header Files/ICalcDisplay.h"
namespace CalculatorApp
namespace CalculatorApp::ViewModel::Common
{
// Callback interface to be implemented by the CalculatorManager
class CalculatorDisplay : public ICalcDisplay

View file

@ -9,7 +9,8 @@
using namespace std;
using namespace concurrency;
using namespace CalculatorApp;
using namespace CalculatorApp::Common;
using namespace CalculatorApp::ViewModel::Common;
using namespace CalculatorApp::ViewModel;
using namespace Platform;
using namespace Platform::Collections;
using namespace Windows::Foundation;
@ -116,7 +117,7 @@ String
}
// Get english translated expression
String ^ englishString = LocalizationSettings::GetInstance().GetEnglishValueFromLocalizedDigits(pastedText);
String ^ englishString = LocalizationSettings::GetInstance()->GetEnglishValueFromLocalizedDigits(pastedText);
// Removing the spaces, comma separator from the pasteExpression to allow pasting of expressions like 1 + 2+1,333
auto pasteExpression = wstring(RemoveUnwantedCharsFromString(englishString)->Data());
@ -614,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::Common::LocalizationSettings::GetInstance().RemoveGroupSeparators(input);
input = CalculatorApp::ViewModel::Common::LocalizationSettings::GetInstance()->RemoveGroupSeparators(input);
return ref new String(Utils::RemoveUnwantedCharsFromString(input->Data(), unWantedChars).c_str());
}

View file

@ -13,10 +13,9 @@ namespace CalculatorUnitTests
class CopyPasteManagerTest;
}
namespace CalculatorApp
namespace CalculatorApp::ViewModel::Common
{
public
value struct CopyPasteMaxOperandLengthAndValue
public value struct CopyPasteMaxOperandLengthAndValue
{
unsigned int maxLength;
unsigned long long maxValue;
@ -26,9 +25,11 @@ public
{
public:
static void CopyToClipboard(Platform::String ^ stringToCopy);
static Windows::Foundation::IAsyncOperation<
Platform::String
^> ^ GetStringToPaste(CalculatorApp::Common::ViewMode mode, CalculatorApp::Common::CategoryGroupType modeType, CalculatorApp::Common::NumberBase programmerNumberBase, CalculatorApp::Common::BitLength bitLengthType);
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);
static bool HasStringToPaste();
static bool IsErrorMessage(Platform::String ^ message);
static property unsigned int MaxPasteableLength
@ -87,39 +88,39 @@ public
static Platform::String
^ ValidatePasteExpression(
Platform::String ^ pastedText,
CalculatorApp::Common::ViewMode mode,
CalculatorApp::Common::NumberBase programmerNumberBase,
CalculatorApp::Common::BitLength bitLengthType);
CalculatorApp::ViewModel::Common::ViewMode mode,
CalculatorApp::ViewModel::Common::NumberBase programmerNumberBase,
CalculatorApp::ViewModel::Common::BitLength bitLengthType);
static Platform::String
^ ValidatePasteExpression(
Platform::String ^ pastedText,
CalculatorApp::Common::ViewMode mode,
CalculatorApp::Common::CategoryGroupType modeType,
CalculatorApp::Common::NumberBase programmerNumberBase,
CalculatorApp::Common::BitLength bitLengthType);
CalculatorApp::ViewModel::Common::ViewMode mode,
CalculatorApp::ViewModel::Common::CategoryGroupType modeType,
CalculatorApp::ViewModel::Common::NumberBase programmerNumberBase,
CalculatorApp::ViewModel::Common::BitLength bitLengthType);
static CopyPasteMaxOperandLengthAndValue GetMaxOperandLengthAndValue(
CalculatorApp::Common::ViewMode mode,
CalculatorApp::Common::CategoryGroupType modeType,
CalculatorApp::Common::NumberBase programmerNumberBase,
CalculatorApp::Common::BitLength bitLengthType);
CalculatorApp::ViewModel::Common::ViewMode mode,
CalculatorApp::ViewModel::Common::CategoryGroupType modeType,
CalculatorApp::ViewModel::Common::NumberBase programmerNumberBase,
CalculatorApp::ViewModel::Common::BitLength bitLengthType);
static Windows::Foundation::Collections::IVector<
Platform::String ^> ^ ExtractOperands(Platform::String ^ pasteExpression, CalculatorApp::Common::ViewMode mode);
Platform::String ^> ^ ExtractOperands(Platform::String ^ pasteExpression, CalculatorApp::ViewModel::Common::ViewMode mode);
static bool ExpressionRegExMatch(
Windows::Foundation::Collections::IVector<Platform::String ^> ^ operands,
CalculatorApp::Common::ViewMode mode,
CalculatorApp::Common::CategoryGroupType modeType,
CalculatorApp::Common::NumberBase programmerNumberBase,
CalculatorApp::Common::BitLength bitLengthType);
CalculatorApp::ViewModel::Common::ViewMode mode,
CalculatorApp::ViewModel::Common::CategoryGroupType modeType,
CalculatorApp::ViewModel::Common::NumberBase programmerNumberBase,
CalculatorApp::ViewModel::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::Common::NumberBase numberBase);
static Platform::IBox<unsigned long long int> ^ TryOperandToULL(Platform::String ^ operand, CalculatorApp::ViewModel::Common::NumberBase numberBase);
static ULONG32 StandardScientificOperandLength(Platform::String ^ operand);
static ULONG32 OperandLength(
Platform::String ^ operand,
CalculatorApp::Common::ViewMode mode,
CalculatorApp::Common::CategoryGroupType modeType,
CalculatorApp::Common::NumberBase programmerNumberBase);
static ULONG32 ProgrammerOperandLength(Platform::String ^ operand, CalculatorApp::Common::NumberBase numberBase);
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);
private:
static constexpr size_t MaxStandardOperandLengthValue = 16;

View file

@ -7,7 +7,7 @@
using namespace Platform;
using namespace Windows::Foundation;
using namespace Windows::Globalization;
using namespace CalculatorApp::Common::DateCalculation;
using namespace CalculatorApp::ViewModel::Common::DateCalculation;
bool operator==(const DateDifference& l, const DateDifference& r)
{

View file

@ -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
namespace CalculatorApp::ViewModel
{
namespace Common
{
@ -68,4 +68,4 @@ namespace CalculatorApp
}
}
bool operator==(const CalculatorApp::Common::DateCalculation::DateDifference& l, const CalculatorApp::Common::DateCalculation::DateDifference& r);
bool operator==(const CalculatorApp::ViewModel::Common::DateCalculation::DateDifference& l, const CalculatorApp::ViewModel::Common::DateCalculation::DateDifference& r);

View file

@ -3,22 +3,18 @@
#pragma once
namespace CalculatorApp
namespace CalculatorApp::ViewModel
{
namespace Common
{
template <typename TTarget>
ref class DelegateCommand : public Windows::UI::Xaml::Input::ICommand
public delegate void DelegateCommandHandler(Platform::Object ^ parameter);
public ref class DelegateCommand sealed : public Windows::UI::Xaml::Input::ICommand
{
internal :
typedef void (TTarget::*CommandHandlerFunc)(Platform::Object ^);
DelegateCommand(TTarget ^ target, CommandHandlerFunc func)
: m_weakTarget(target)
, m_function(func)
{
}
public:
DelegateCommand(DelegateCommandHandler ^ handler)
: m_handler(handler)
{}
private:
// Explicit, and private, implementation of ICommand, this way of programming makes it so
@ -27,11 +23,7 @@ namespace CalculatorApp
// code in the app calling Execute.
virtual void ExecuteImpl(Platform::Object ^ parameter) sealed = Windows::UI::Xaml::Input::ICommand::Execute
{
TTarget ^ target = m_weakTarget.Resolve<TTarget>();
if (target)
{
(target->*m_function)(parameter);
}
m_handler->Invoke(parameter);
}
virtual bool CanExecuteImpl(Platform::Object ^ parameter) sealed = Windows::UI::Xaml::Input::ICommand::CanExecute
@ -39,9 +31,9 @@ namespace CalculatorApp
return true;
}
virtual event Windows::Foundation::EventHandler<Platform::Object^>^ CanExecuteChangedImpl
virtual event Windows::Foundation::EventHandler<Platform::Object ^> ^ CanExecuteChangedImpl
{
virtual Windows::Foundation::EventRegistrationToken add(Windows::Foundation::EventHandler<Platform::Object^>^ handler) sealed = Windows::UI::Xaml::Input::ICommand::CanExecuteChanged::add
virtual Windows::Foundation::EventRegistrationToken add(Windows::Foundation::EventHandler<Platform::Object ^> ^ handler) sealed = Windows::UI::Xaml::Input::ICommand::CanExecuteChanged::add
{
return m_canExecuteChanged += handler;
}
@ -52,17 +44,25 @@ namespace CalculatorApp
}
private:
DelegateCommandHandler ^ m_handler;
event Windows::Foundation::EventHandler<Platform::Object^>^ m_canExecuteChanged;
CommandHandlerFunc m_function;
Platform::WeakReference m_weakTarget;
event Windows::Foundation::EventHandler<Platform::Object ^> ^ m_canExecuteChanged;
};
template <typename TTarget, typename TFuncPtr>
DelegateCommand<TTarget> ^ MakeDelegate(TTarget ^ target, TFuncPtr&& function) {
return ref new DelegateCommand<TTarget>(target, std::forward<TFuncPtr>(function));
}
DelegateCommandHandler ^ MakeDelegateCommandHandler(TTarget ^ target, TFuncPtr&& function)
{
Platform::WeakReference weakTarget(target);
return ref new DelegateCommandHandler([weakTarget, function=std::forward<TFuncPtr>(function)](Platform::Object ^ param)
{
TTarget ^ thatTarget = weakTarget.Resolve<TTarget>();
if (nullptr != thatTarget)
{
(thatTarget->*function)(param);
}
}
);
}
}
}

View file

@ -5,7 +5,7 @@
#include "Utils.h"
namespace CalculatorApp::Common
namespace CalculatorApp::ViewModel::Common
{
public
enum class TokenType
@ -33,6 +33,7 @@ public
OBSERVABLE_PROPERTY_RW(int, TokenPosition);
OBSERVABLE_PROPERTY_RW(bool, IsTokenEditable);
OBSERVABLE_PROPERTY_RW(int, CommandIndex);
OBSERVABLE_PROPERTY_RW(TokenType, Type);
OBSERVABLE_PROPERTY_R(Platform::String ^, OriginalToken);
property bool IsTokenInEditMode
@ -50,7 +51,6 @@ public
m_InEditMode = val;
}
}
internal : OBSERVABLE_PROPERTY_RW(TokenType, Type);
private:
bool m_InEditMode;

View file

@ -5,7 +5,7 @@
#include "EngineResourceProvider.h"
#include "Common/LocalizationSettings.h"
using namespace CalculatorApp::Common;
using namespace CalculatorApp::ViewModel::Common;
using namespace Platform;
using namespace Windows::ApplicationModel::Resources;
using namespace std;
@ -19,16 +19,16 @@ namespace CalculatorApp
wstring EngineResourceProvider::GetCEngineString(wstring_view id)
{
const auto& localizationSettings = LocalizationSettings::GetInstance();
LocalizationSettings^ localizationSettings = LocalizationSettings::GetInstance();
if (id.compare(L"sDecimal") == 0)
{
return localizationSettings.GetDecimalSeparatorStr();
return localizationSettings->GetDecimalSeparatorStr();
}
if (id.compare(L"sThousand") == 0)
{
return localizationSettings.GetNumberGroupingSeparatorStr();
return localizationSettings->GetNumberGroupingSeparatorStr();
}
if (id.compare(L"sGrouping") == 0)
@ -39,7 +39,7 @@ namespace CalculatorApp
// 3;2;0 0x023 - group 1st 3 and then every 2 digits
// 4;0 0x004 - group every 4 digits
// 5;3;2;0 0x235 - group 5, then 3, then every 2
wstring numberGroupingString = localizationSettings.GetNumberGroupingStr();
wstring numberGroupingString = localizationSettings->GetNumberGroupingStr();
return numberGroupingString;
}

View file

@ -5,7 +5,7 @@
#include "CalcManager/CalculatorResource.h"
namespace CalculatorApp
namespace CalculatorApp::ViewModel::Common
{
class EngineResourceProvider : public CalculationManager::IResourceProvider
{

View file

@ -4,7 +4,7 @@
#include "pch.h"
#include "ExpressionCommandDeserializer.h"
using namespace CalculatorApp::Common;
using namespace CalculatorApp::ViewModel::Common;
using namespace Windows::Storage::Streams;
CommandDeserializer::CommandDeserializer(_In_ DataReader ^ dataReader)

View file

@ -5,7 +5,7 @@
#include "CalcManager/ExpressionCommand.h"
namespace CalculatorApp
namespace CalculatorApp::ViewModel
{
namespace Common
{

View file

@ -4,7 +4,7 @@
#include "pch.h"
#include "Common/ExpressionCommandSerializer.h"
using namespace CalculatorApp::Common;
using namespace CalculatorApp::ViewModel::Common;
using namespace Windows::Storage::Streams;
SerializeCommandVisitor::SerializeCommandVisitor(_In_ DataWriter ^ dataWriter)

View file

@ -5,7 +5,7 @@
#include "CalcManager/ExpressionCommand.h"
namespace CalculatorApp
namespace CalculatorApp::ViewModel
{
namespace Common
{

View file

@ -6,8 +6,9 @@
#include "LocalizationSettings.h"
#include "AppResourceProvider.h"
using namespace CalculatorApp::Common;
using namespace CalculatorApp::Common::LocalizationServiceProperties;
using namespace CalculatorApp::ViewModel::Common;
using namespace CalculatorApp::ViewModel::Common::LocalizationServiceProperties;
using namespace CalculatorApp::ViewModel;
using namespace Concurrency;
using namespace Platform;
using namespace Platform::Collections;
@ -371,7 +372,7 @@ void LocalizationService::UpdateFontFamilyAndSize(DependencyObject ^ target)
// If successful, returns a formatter that respects the user's regional format settings,
// as configured by running intl.cpl.
DecimalFormatter ^ LocalizationService::GetRegionalSettingsAwareDecimalFormatter() const
DecimalFormatter ^ LocalizationService::GetRegionalSettingsAwareDecimalFormatter()
{
IIterable<String ^> ^ languageIdentifiers = LocalizationService::GetLanguageIdentifiers();
if (languageIdentifiers != nullptr)
@ -386,7 +387,7 @@ DecimalFormatter ^ LocalizationService::GetRegionalSettingsAwareDecimalFormatter
// as configured by running intl.cpl.
//
// This helper function creates a DateTimeFormatter with a TwentyFour hour clock
DateTimeFormatter ^ LocalizationService::GetRegionalSettingsAwareDateTimeFormatter(_In_ String ^ format) const
DateTimeFormatter ^ LocalizationService::GetRegionalSettingsAwareDateTimeFormatter(_In_ String ^ format)
{
IIterable<String ^> ^ languageIdentifiers = LocalizationService::GetLanguageIdentifiers();
if (languageIdentifiers == nullptr)
@ -399,7 +400,7 @@ DateTimeFormatter ^ LocalizationService::GetRegionalSettingsAwareDateTimeFormatt
// If successful, returns a formatter that respects the user's regional format settings,
// as configured by running intl.cpl.
DateTimeFormatter ^ LocalizationService::GetRegionalSettingsAwareDateTimeFormatter(_In_ String ^ format, _In_ String ^ calendarIdentifier, _In_ String ^ clockIdentifier) const
DateTimeFormatter ^ LocalizationService::GetRegionalSettingsAwareDateTimeFormatter(_In_ String ^ format, _In_ String ^ calendarIdentifier, _In_ String ^ clockIdentifier)
{
IIterable<String ^> ^ languageIdentifiers = LocalizationService::GetLanguageIdentifiers();
if (languageIdentifiers == nullptr)
@ -410,7 +411,7 @@ DateTimeFormatter ^ LocalizationService::GetRegionalSettingsAwareDateTimeFormatt
return ref new DateTimeFormatter(format, languageIdentifiers, GlobalizationPreferences::HomeGeographicRegion, calendarIdentifier, clockIdentifier);
}
CurrencyFormatter ^ LocalizationService::GetRegionalSettingsAwareCurrencyFormatter() const
CurrencyFormatter ^ LocalizationService::GetRegionalSettingsAwareCurrencyFormatter()
{
String ^ userCurrency =
(GlobalizationPreferences::Currencies->Size > 0) ? GlobalizationPreferences::Currencies->GetAt(0) : StringReference(DefaultCurrencyCode.data());
@ -423,7 +424,7 @@ CurrencyFormatter ^ LocalizationService::GetRegionalSettingsAwareCurrencyFormatt
auto currencyFormatter = ref new CurrencyFormatter(userCurrency, languageIdentifiers, GlobalizationPreferences::HomeGeographicRegion);
int fractionDigits = LocalizationSettings::GetInstance().GetCurrencyTrailingDigits();
int fractionDigits = LocalizationSettings::GetInstance()->GetCurrencyTrailingDigits();
currencyFormatter->FractionDigits = fractionDigits;
return currencyFormatter;

View file

@ -5,7 +5,7 @@
#include "Utils.h"
namespace CalculatorApp
namespace CalculatorApp::ViewModel
{
namespace Common
{
@ -30,10 +30,7 @@ namespace CalculatorApp
DEPENDENCY_PROPERTY_ATTACHED_WITH_DEFAULT_AND_CALLBACK(LanguageFontType, FontType, LanguageFontType::UIText);
DEPENDENCY_PROPERTY_ATTACHED_WITH_CALLBACK(double, FontSize);
internal:
static LocalizationService ^ GetInstance();
static void OverrideWithLanguage(_In_ const wchar_t* const language);
Windows::UI::Xaml::FlowDirection GetFlowDirection();
bool IsRtlLayout();
bool GetOverrideFontApiValues();
@ -42,7 +39,17 @@ namespace CalculatorApp
Platform::String ^ GetFontFamilyOverride();
Windows::UI::Text::FontWeight GetFontWeightOverride();
double GetFontScaleFactorOverride(LanguageFontType fontType);
Windows::Globalization::NumberFormatting::DecimalFormatter ^ GetRegionalSettingsAwareDecimalFormatter();
Windows::Globalization::DateTimeFormatting::DateTimeFormatter ^ GetRegionalSettingsAwareDateTimeFormatter(_In_ Platform::String ^ format);
Windows::Globalization::DateTimeFormatting::DateTimeFormatter
^ GetRegionalSettingsAwareDateTimeFormatter(
_In_ Platform::String ^ format,
_In_ Platform::String ^ calendarIdentifier,
_In_ Platform::String ^ clockIdentifier);
Windows::Globalization::NumberFormatting::CurrencyFormatter ^ GetRegionalSettingsAwareCurrencyFormatter();
internal:
static void OverrideWithLanguage(_In_ const wchar_t* const language);
void Sort(std::vector<Platform::String ^>& source);
template <typename T>
@ -56,16 +63,6 @@ namespace CalculatorApp
});
}
Windows::Globalization::NumberFormatting::DecimalFormatter ^ GetRegionalSettingsAwareDecimalFormatter() const;
Windows::Globalization::DateTimeFormatting::DateTimeFormatter ^ GetRegionalSettingsAwareDateTimeFormatter(_In_ Platform::String ^ format) const;
Windows::Globalization::DateTimeFormatting::DateTimeFormatter
^ GetRegionalSettingsAwareDateTimeFormatter(
_In_ Platform::String ^ format,
_In_ Platform::String ^ calendarIdentifier,
_In_ Platform::String ^ clockIdentifier) const;
Windows::Globalization::NumberFormatting::CurrencyFormatter ^ GetRegionalSettingsAwareCurrencyFormatter() const;
static Platform::String ^ GetNarratorReadableToken(Platform::String ^ rawToken);
static Platform::String ^ GetNarratorReadableString(Platform::String ^ rawString);
@ -101,6 +98,5 @@ namespace CalculatorApp
double m_uiCaptionFontScaleFactorOverride;
std::locale m_locale;
};
}
}

View file

@ -6,22 +6,191 @@
#include <iterator>
namespace CalculatorApp
namespace CalculatorApp::ViewModel
{
namespace Common
{
class LocalizationSettings
public ref class LocalizationSettings sealed
{
private:
LocalizationSettings()
// Use DecimalFormatter as it respects the locale and the user setting
: LocalizationSettings(LocalizationService::GetInstance()->GetRegionalSettingsAwareDecimalFormatter())
{
Initialize(LocalizationService::GetInstance()->GetRegionalSettingsAwareDecimalFormatter());
}
public:
// This is only public for unit testing purposes.
LocalizationSettings(Windows::Globalization::NumberFormatting::DecimalFormatter ^ formatter)
{
Initialize(formatter);
}
// Provider of the singleton LocalizationSettings instance.
static LocalizationSettings^ GetInstance()
{
static LocalizationSettings^ localizationSettings = ref new LocalizationSettings();
return localizationSettings;
}
Platform::String ^ GetLocaleName()
{
return m_resolvedName;
}
bool IsDigitEnUsSetting()
{
return (this->GetDigitSymbolFromEnUsDigit('0') == L'0');
}
Platform::String ^ GetEnglishValueFromLocalizedDigits(Platform::String ^ localizedString)
{
if (m_resolvedName == L"en-US")
{
return localizedString;
}
std::wstring englishString;
englishString.reserve(localizedString->Length());
for (wchar_t ch : localizedString)
{
if (!IsEnUsDigit(ch))
{
auto it = std::find(m_digitSymbols.begin(), m_digitSymbols.end(), ch);
if (it != m_digitSymbols.end())
{
auto index = std::distance(m_digitSymbols.begin(), it);
ch = index.ToString()->Data()[0];
}
}
if (ch == m_decimalSeparator)
{
ch = L'.';
}
englishString += ch;
}
return ref new Platform::String(englishString.c_str());
}
Platform::String ^ RemoveGroupSeparators(Platform::String ^ source)
{
std::wstring destination;
std::copy_if(
begin(source), end(source), std::back_inserter(destination), [this](auto const c) { return c != L' ' && c != m_numberGroupSeparator; });
return ref new Platform::String(destination.c_str());
}
Platform::String ^ GetCalendarIdentifier()
{
return m_calendarIdentifier;
}
Windows::Globalization::DayOfWeek GetFirstDayOfWeek()
{
return m_firstDayOfWeek;
}
int GetCurrencyTrailingDigits()
{
return m_currencyTrailingDigits;
}
int GetCurrencySymbolPrecedence()
{
return m_currencySymbolPrecedence;
}
wchar_t GetDecimalSeparator()
{
return m_decimalSeparator;
}
wchar_t GetDigitSymbolFromEnUsDigit(wchar_t digitSymbol)
{
assert(digitSymbol >= L'0' && digitSymbol <= L'9');
int digit = digitSymbol - L'0';
return m_digitSymbols.at(digit); // throws on out of range
}
wchar_t GetNumberGroupSeparator()
{
return m_numberGroupSeparator;
}
bool IsEnUsDigit(wchar_t digit)
{
return (digit >= L'0' && digit <= L'9');
}
bool IsLocalizedDigit(wchar_t digit)
{
return std::find(m_digitSymbols.begin(), m_digitSymbols.end(), digit) != m_digitSymbols.end();
}
bool IsLocalizedHexDigit(wchar_t digit)
{
if (IsLocalizedDigit(digit))
{
return true;
}
return std::find(s_hexSymbols.begin(), s_hexSymbols.end(), digit) != s_hexSymbols.end();
}
Platform::String ^ GetListSeparatorWinRT()
{
return ref new Platform::String(GetListSeparator().c_str());
}
Platform::String ^ GetDecimalSeparatorStrWinRT()
{
return ref new Platform::String(GetDecimalSeparatorStr().c_str());
}
internal:
void LocalizeDisplayValue(_Inout_ std::wstring* stringToLocalize)
{
if (IsDigitEnUsSetting())
{
return;
}
for (wchar_t& ch : *stringToLocalize)
{
if (IsEnUsDigit(ch))
{
ch = GetDigitSymbolFromEnUsDigit(ch);
}
}
}
std::wstring GetDecimalSeparatorStr()
{
return std::wstring(1, m_decimalSeparator);
}
std::wstring GetNumberGroupingSeparatorStr()
{
return std::wstring(1, m_numberGroupSeparator);
}
std::wstring GetNumberGroupingStr()
{
return m_numberGrouping;
}
std::wstring GetListSeparator()
{
return m_listSeparator;
}
private:
void Initialize(Windows::Globalization::NumberFormatting::DecimalFormatter ^ formatter)
{
formatter->FractionDigits = 0;
formatter->IsDecimalPointAlwaysDisplayed = false;
@ -125,167 +294,6 @@ namespace CalculatorApp
m_firstDayOfWeek = static_cast<Windows::Globalization::DayOfWeek>((_wtoi(day) + 1) % 7); // static cast int to DayOfWeek enum
}
// A LocalizationSettings object is not copyable.
LocalizationSettings(const LocalizationSettings&) = delete;
LocalizationSettings& operator=(const LocalizationSettings&) = delete;
// A LocalizationSettings object is not moveable.
LocalizationSettings(LocalizationSettings&&) = delete;
LocalizationSettings& operator=(LocalizationSettings&&) = delete;
// Provider of the singleton LocalizationSettings instance.
static const LocalizationSettings& GetInstance()
{
static const LocalizationSettings localizationSettings;
return localizationSettings;
}
Platform::String ^ GetLocaleName() const
{
return m_resolvedName;
}
bool IsDigitEnUsSetting() const
{
return (this->GetDigitSymbolFromEnUsDigit('0') == L'0');
}
void LocalizeDisplayValue(_Inout_ std::wstring* stringToLocalize) const
{
if (IsDigitEnUsSetting())
{
return;
}
for (wchar_t& ch : *stringToLocalize)
{
if (IsEnUsDigit(ch))
{
ch = GetDigitSymbolFromEnUsDigit(ch);
}
}
}
Platform::String ^ GetEnglishValueFromLocalizedDigits(Platform::String ^ localizedString) const
{
if (m_resolvedName == L"en-US")
{
return localizedString;
}
std::wstring englishString;
englishString.reserve(localizedString->Length());
for (wchar_t ch : localizedString)
{
if (!IsEnUsDigit(ch))
{
auto it = std::find(m_digitSymbols.begin(), m_digitSymbols.end(), ch);
if (it != m_digitSymbols.end())
{
auto index = std::distance(m_digitSymbols.begin(), it);
ch = index.ToString()->Data()[0];
}
}
if (ch == m_decimalSeparator)
{
ch = L'.';
}
englishString += ch;
}
return ref new Platform::String(englishString.c_str());
}
bool IsEnUsDigit(const wchar_t digit) const
{
return (digit >= L'0' && digit <= L'9');
}
bool IsLocalizedDigit(const wchar_t digit) const
{
return std::find(m_digitSymbols.begin(), m_digitSymbols.end(), digit) != m_digitSymbols.end();
}
bool IsLocalizedHexDigit(const wchar_t digit) const
{
if (IsLocalizedDigit(digit))
{
return true;
}
return std::find(s_hexSymbols.begin(), s_hexSymbols.end(), digit) != s_hexSymbols.end();
}
wchar_t GetDigitSymbolFromEnUsDigit(wchar_t digitSymbol) const
{
assert(digitSymbol >= L'0' && digitSymbol <= L'9');
int digit = digitSymbol - L'0';
return m_digitSymbols.at(digit); // throws on out of range
}
wchar_t GetDecimalSeparator() const
{
return m_decimalSeparator;
}
wchar_t GetNumberGroupSeparator() const
{
return m_numberGroupSeparator;
}
std::wstring GetDecimalSeparatorStr() const
{
return std::wstring(1, m_decimalSeparator);
}
std::wstring GetNumberGroupingSeparatorStr() const
{
return std::wstring(1, m_numberGroupSeparator);
}
std::wstring GetNumberGroupingStr() const
{
return m_numberGrouping;
}
Platform::String ^ RemoveGroupSeparators(Platform::String ^ source) const
{
std::wstring destination;
std::copy_if(
begin(source), end(source), std::back_inserter(destination), [this](auto const c) { return c != L' ' && c != m_numberGroupSeparator; });
return ref new Platform::String(destination.c_str());
}
Platform::String ^ GetCalendarIdentifier() const
{
return m_calendarIdentifier;
}
std::wstring GetListSeparator() const
{
return m_listSeparator;
}
Windows::Globalization::DayOfWeek GetFirstDayOfWeek() const
{
return m_firstDayOfWeek;
}
int GetCurrencyTrailingDigits() const
{
return m_currencyTrailingDigits;
}
int GetCurrencySymbolPrecedence() const
{
return m_currencySymbolPrecedence;
}
private:
static Platform::String^ GetCalendarIdentifierFromCalid(CALID calId)
{
switch (calId)

View file

@ -5,7 +5,7 @@
#include "AppResourceProvider.h"
namespace CalculatorApp
namespace CalculatorApp::ViewModel
{
namespace Common
{

View file

@ -3,7 +3,7 @@
#pragma once
namespace CalculatorApp
namespace CalculatorApp::ViewModel
{
namespace Common
{

View file

@ -8,7 +8,8 @@
#include <initializer_list>
using namespace CalculatorApp;
using namespace CalculatorApp::Common;
using namespace CalculatorApp::ViewModel::Common;
using namespace CalculatorApp::ViewModel;
using namespace Concurrency;
using namespace Platform;
using namespace Platform::Collections;
@ -480,18 +481,19 @@ ViewMode NavCategory::GetViewModeForVirtualKey(MyVirtualKey virtualKey)
return (iter != s_categoryManifest.end()) ? iter->viewMode : ViewMode::None;
}
vector<MyVirtualKey> NavCategory::GetCategoryAcceleratorKeys()
void NavCategory::GetCategoryAcceleratorKeys(IVector<MyVirtualKey> ^ accelerators)
{
vector<MyVirtualKey> accelerators{};
for (auto category : s_categoryManifest)
if (accelerators != nullptr)
{
if (category.virtualKey != MyVirtualKey::None)
accelerators->Clear();
for (auto category : s_categoryManifest)
{
accelerators.push_back(category.virtualKey);
if (category.virtualKey != MyVirtualKey::None)
{
accelerators->Append(category.virtualKey);
}
}
}
return accelerators;
}
NavCategoryGroup::NavCategoryGroup(const NavCategoryGroupInitializer& groupInitializer)
@ -550,3 +552,4 @@ NavCategoryGroup ^ NavCategoryGroup::CreateConverterCategory()
return ref new NavCategoryGroup(
NavCategoryGroupInitializer{ CategoryGroupType::Converter, L"ConverterModeTextCaps", L"ConverterModeText", L"ConverterModePluralText" });
}

View file

@ -17,7 +17,7 @@
#include "Utils.h"
#include "MyVirtualKey.h"
namespace CalculatorApp
namespace CalculatorApp::ViewModel
{
namespace Common
{
@ -153,6 +153,7 @@ namespace CalculatorApp
static int GetPosition(ViewMode mode);
static ViewMode GetViewModeForVirtualKey(MyVirtualKey virtualKey);
static void GetCategoryAcceleratorKeys(Windows::Foundation::Collections::IVector<MyVirtualKey> ^ resutls);
internal : NavCategory(
Platform::String ^ name,
@ -174,8 +175,6 @@ namespace CalculatorApp
{
}
static std::vector<MyVirtualKey> GetCategoryAcceleratorKeys();
private:
static bool IsModeInCategoryGroup(ViewMode mode, CategoryGroupType groupType);
@ -193,7 +192,7 @@ namespace CalculatorApp
static Windows::Foundation::Collections::IObservableVector<NavCategoryGroup ^> ^ CreateMenuOptions();
internal : static NavCategoryGroup ^ CreateCalculatorCategory();
static NavCategoryGroup ^ CreateCalculatorCategory();
static NavCategoryGroup ^ CreateConverterCategory();
private:

View file

@ -5,6 +5,8 @@
#include "NetworkManager.h"
using namespace CalculatorApp;
using namespace CalculatorApp::ViewModel;
using namespace CalculatorApp::ViewModel::Common;
using namespace Platform;
using namespace Windows::Networking::Connectivity;

View file

@ -3,7 +3,7 @@
#pragma once
namespace CalculatorApp
namespace CalculatorApp::ViewModel::Common
{
public
enum class NetworkAccessBehavior

View file

@ -2,7 +2,7 @@
// Licensed under the MIT License.
#pragma once
namespace CalculatorApp::Common
namespace CalculatorApp::ViewModel::Common
{
public
enum class NumberBase

View file

@ -0,0 +1,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "pch.h"
#include "RadixType.h"
// export enum RadixType

View file

@ -0,0 +1,19 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once
namespace CalculatorApp::ViewModel
{
namespace Common
{
// This is expected to be in same order as IDM_HEX, IDM_DEC, IDM_OCT, IDM_BIN
public enum class RadixType
{
Hex,
Decimal,
Octal,
Binary
};
}
}

View file

@ -7,7 +7,8 @@
#include "CalculatorButtonUser.h"
using namespace CalculatorApp;
using namespace CalculatorApp::Common;
using namespace CalculatorApp::ViewModel::Common;
using namespace CalculatorApp::ViewModel;
using namespace TraceLogging;
using namespace Concurrency;
using namespace std;
@ -147,16 +148,21 @@ namespace CalculatorApp
TraceLoggingCommon::GetInstance()->LogLevel2Event(StringReference(EVENT_NAME_EXCEPTION), fields);
}
void TraceLogger::LogPlatformException(ViewMode mode, wstring_view functionName, Platform::Exception ^ e)
void TraceLogger::LogPlatformExceptionInfo(CalculatorApp::ViewModel::Common::ViewMode mode, Platform::String ^ functionName, Platform::String^ message, int hresult)
{
auto fields = ref new LoggingFields();
fields->AddString(StringReference(CALC_MODE), NavCategory::GetFriendlyName(mode));
fields->AddString(StringReference(L"FunctionName"), StringReference(functionName.data()));
fields->AddString(StringReference(L"Message"), e->Message);
fields->AddInt32(StringReference(L"HRESULT"), e->HResult);
fields->AddString(StringReference(L"FunctionName"), functionName);
fields->AddString(StringReference(L"Message"), message);
fields->AddInt32(StringReference(L"HRESULT"), hresult);
TraceLoggingCommon::GetInstance()->LogLevel2Event(StringReference(EVENT_NAME_EXCEPTION), fields);
}
void TraceLogger::LogPlatformException(ViewMode mode, Platform::String ^ functionName, Platform::Exception ^ e)
{
LogPlatformExceptionInfo(mode, functionName, e->Message, e->HResult);
}
void TraceLogger::UpdateButtonUsage(NumbersAndOperatorsEnum button, ViewMode mode)
{
// IsProgrammerMode, IsScientificMode, IsStandardMode and None are not actual buttons, so ignore them

View file

@ -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
namespace CalculatorApp::ViewModel::Common
{
struct ButtonLog
{
public:
int count;
CalculatorApp::NumbersAndOperatorsEnum button;
CalculatorApp::Common::ViewMode mode;
ButtonLog(CalculatorApp::NumbersAndOperatorsEnum btn, CalculatorApp::Common::ViewMode vMode)
CalculatorApp::ViewModel::Common::NumbersAndOperatorsEnum button;
CalculatorApp::ViewModel::Common::ViewMode mode;
ButtonLog(CalculatorApp::ViewModel::Common::NumbersAndOperatorsEnum btn, CalculatorApp::ViewModel::Common::ViewMode vMode)
{
button = btn;
mode = vMode;
@ -62,20 +62,20 @@ namespace CalculatorApp
public:
static TraceLogger ^ GetInstance();
void LogModeChange(CalculatorApp::Common::ViewMode mode);
void LogHistoryItemLoad(CalculatorApp::Common::ViewMode mode, int historyListSize, int loadedIndex);
void LogMemoryItemLoad(CalculatorApp::Common::ViewMode mode, int memoryListSize, int loadedIndex);
void UpdateButtonUsage(CalculatorApp::NumbersAndOperatorsEnum button, CalculatorApp::Common::ViewMode mode);
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 LogButtonUsage();
void LogDateCalculationModeUsed(bool AddSubtractMode);
void UpdateWindowCount(uint64 windowCount);
void DecreaseWindowCount();
bool IsWindowIdInLog(int windowId);
void LogVisualStateChanged(CalculatorApp::Common::ViewMode mode, Platform::String ^ state, bool isAlwaysOnTop);
void LogWindowCreated(CalculatorApp::Common::ViewMode mode, int windowId);
void LogConverterInputReceived(CalculatorApp::Common::ViewMode mode);
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 LogNavBarOpened();
void LogError(CalculatorApp::Common::ViewMode mode, Platform::String ^ functionName, Platform::String ^ errorString);
void LogError(CalculatorApp::ViewModel::Common::ViewMode mode, Platform::String ^ functionName, Platform::String ^ errorString);
void LogShowHideButtonClicked(bool isHideButton);
void LogGraphButtonClicked(GraphButton buttonName, GraphButtonValue buttonValue);
void LogGraphLineStyleChanged(LineStyleType style);
@ -83,10 +83,12 @@ namespace CalculatorApp
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);
internal:
void LogStandardException(CalculatorApp::Common::ViewMode mode, std::wstring_view functionName, _In_ const std::exception& e);
void LogPlatformException(CalculatorApp::Common::ViewMode mode, std::wstring_view functionName, _In_ Platform::Exception ^ e);
void LogInputPasted(CalculatorApp::Common::ViewMode mode);
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);
private:
// Create an instance of TraceLogger

View file

@ -6,13 +6,17 @@
//
#include "pch.h"
#include <winmeta.h>
#include "Utils.h"
#include "Common/AppResourceProvider.h"
#include "Common/ExpressionCommandSerializer.h"
#include "Common/ExpressionCommandDeserializer.h"
#include "CalcManager/NumberFormattingUtils.h"
using namespace CalculatorApp;
using namespace CalculatorApp::Common;
using namespace CalculatorApp::ViewModel::Common;
using namespace concurrency;
using namespace Graphing::Renderer;
using namespace Platform;
@ -168,18 +172,20 @@ void Utils::TrimBack(wstring& value)
}).base(), value.end());
}
String^ Utils::EscapeHtmlSpecialCharacters(String^ originalString, shared_ptr<vector<wchar_t>> specialCharacters)
bool operator==(const Color& color1, const Color& color2)
{
return equal_to<Color>()(color1, color2);
}
bool operator!=(const Color& color1, const Color& color2)
{
return !(color1 == color2);
}
String^ CalculatorApp::ViewModel::Common::Utilities::EscapeHtmlSpecialCharacters(String^ originalString)
{
// Construct a default special characters if not provided.
if (specialCharacters == nullptr)
{
specialCharacters = make_shared<vector<wchar_t>>();
specialCharacters->push_back(L'&');
specialCharacters->push_back(L'\"');
specialCharacters->push_back(L'\'');
specialCharacters->push_back(L'<');
specialCharacters->push_back(L'>');
}
const std::vector<wchar_t> specialCharacters {L'&', L'\"', L'\'', L'<', L'>'};
bool replaceCharacters = false;
const wchar_t* pCh;
@ -189,7 +195,7 @@ String^ Utils::EscapeHtmlSpecialCharacters(String^ originalString, shared_ptr<ve
// If there isn't any special character, we simply return the original string
for (pCh = originalString->Data(); *pCh; pCh++)
{
if (std::find(specialCharacters->begin(), specialCharacters->end(), *pCh) != specialCharacters->end())
if (std::find(specialCharacters.begin(), specialCharacters.end(), *pCh) != specialCharacters.end())
{
replaceCharacters = true;
break;
@ -233,20 +239,22 @@ String^ Utils::EscapeHtmlSpecialCharacters(String^ originalString, shared_ptr<ve
return replaceCharacters ? replacementString : originalString;
}
bool operator==(const Color& color1, const Color& color2)
Platform::String^ CalculatorApp::ViewModel::Common::Utilities::TrimTrailingZeros(Platform::String^ input)
{
return equal_to<Color>()(color1, color2);
std::wstring tmp(input->Data());
CalcManager::NumberFormattingUtils::TrimTrailingZeros(tmp);
return ref new Platform::String(tmp.c_str());
}
bool operator!=(const Color& color1, const Color& color2)
bool CalculatorApp::ViewModel::Common::Utilities::AreColorsEqual(Windows::UI::Color color1, Windows::UI::Color color2)
{
return !(color1 == color2);
return Utils::AreColorsEqual(color1, color2);
}
// 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 ^ Utils::GetContrastColor(Color backgroundColor)
SolidColorBrush ^ CalculatorApp::ViewModel::Common::Utilities::GetContrastColor(Color backgroundColor)
{
auto luminance = 0.2126 * backgroundColor.R + 0.7152 * backgroundColor.G + 0.0722 * backgroundColor.B;
@ -257,3 +265,21 @@ SolidColorBrush ^ Utils::GetContrastColor(Color backgroundColor)
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()
{
return WINEVENT_KEYWORD_RESPONSE_TIME;
}
bool CalculatorApp::ViewModel::Common::Utilities::GetIntegratedDisplaySize(double* size)
{
if (SUCCEEDED(::GetIntegratedDisplaySize(size)))
return true;
return false;
}

View file

@ -168,11 +168,22 @@ public:
// The variable member generated by this macro should not be used in the class code, use the
// property getter instead.
#define COMMAND_FOR_METHOD(p, m) \
property Windows::UI::Xaml::Input::ICommand^ p {\
Windows::UI::Xaml::Input::ICommand^ get() {\
if (!donotuse_##p) {\
donotuse_##p = CalculatorApp::Common::MakeDelegate(this, &m);\
} return donotuse_##p; }} private: Windows::UI::Xaml::Input::ICommand^ donotuse_##p; \
property Windows::UI::Xaml::Input::ICommand ^ p \
{ \
Windows::UI::Xaml::Input::ICommand ^ get() \
{ \
if (!donotuse_##p) \
{ \
donotuse_##p = ref new CalculatorApp::ViewModel::Common::DelegateCommand( \
CalculatorApp::ViewModel::Common::MakeDelegateCommandHandler(this, &m) \
); \
} \
return donotuse_##p; \
} \
} \
\
private: \
Windows::UI::Xaml::Input::ICommand ^ donotuse_##p; \
\
public:
@ -398,10 +409,6 @@ namespace Utils
void Trim(std::wstring& value);
void TrimFront(std::wstring& value);
void TrimBack(std::wstring& value);
Platform::String ^ EscapeHtmlSpecialCharacters(Platform::String ^ originalString, std::shared_ptr<std::vector<wchar_t>> specialCharacters = nullptr);
Windows::UI::Xaml::Media::SolidColorBrush ^ GetContrastColor(Windows::UI::Color backgroundColor);
}
// This goes into the header to define the property, in the public: section of the class
@ -697,6 +704,23 @@ namespace CalculatorApp
return to;
}
namespace ViewModel::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#
public ref class Utilities sealed
{
public:
static Platform::String ^ EscapeHtmlSpecialCharacters(Platform::String ^ originalString);
static Platform::String^ TrimTrailingZeros(Platform::String^ input);
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);
};
}
}
// There's no standard definition of equality for Windows::UI::Color structs.

View file

@ -11,11 +11,11 @@
#include "UnitConverterDataConstants.h"
using namespace CalculatorApp;
using namespace CalculatorApp::Common;
using namespace CalculatorApp::Common::LocalizationServiceProperties;
using namespace CalculatorApp::DataLoaders;
using namespace CalculatorApp::ViewModel::Common;
using namespace CalculatorApp::ViewModel::Common::LocalizationServiceProperties;
using namespace CalculatorApp::ViewModel::DataLoaders;
using namespace CalculatorApp::ViewModel;
using namespace CalculatorApp::ViewModel::CurrencyDataLoaderConstants;
using namespace CalculatorApp::ViewModel::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
namespace ViewModel::DataLoaders
{
namespace UnitConverterResourceKeys
{
@ -300,7 +300,7 @@ pair<wstring, wstring> CurrencyDataLoader::GetCurrencyRatioEquality(_In_ const U
double ratio = (iter2->second).ratio;
double rounded = RoundCurrencyRatio(ratio);
auto digit = LocalizationSettings::GetInstance().GetDigitSymbolFromEnUsDigit(L'1');
auto digit = LocalizationSettings::GetInstance()->GetDigitSymbolFromEnUsDigit(L'1');
auto digitSymbol = ref new String(&digit, 1);
auto roundedFormat = m_ratioFormatter->Format(rounded);

View file

@ -9,7 +9,7 @@
namespace CalculatorApp
{
namespace ViewModel
namespace ViewModel::DataLoaders
{
public
enum class CurrencyLoadStatus
@ -54,7 +54,9 @@ namespace CalculatorApp
class CurrencyDataLoader : public UCM::IConverterDataLoader, public UCM::ICurrencyConverterDataLoader
{
public:
CurrencyDataLoader(_In_ std::unique_ptr<CalculatorApp::DataLoaders::ICurrencyHttpClient> client, const wchar_t* overrideLanguage = nullptr);
CurrencyDataLoader(
_In_ std::unique_ptr<CalculatorApp::ViewModel::DataLoaders::ICurrencyHttpClient> client,
const wchar_t* overrideLanguage = nullptr);
~CurrencyDataLoader();
bool LoadFinished();
@ -82,7 +84,7 @@ namespace CalculatorApp
std::future<bool> TryLoadDataFromWebOverrideAsync() override;
// ICurrencyConverterDataLoader
void OnNetworkBehaviorChanged(CalculatorApp::NetworkAccessBehavior newBehavior);
void OnNetworkBehaviorChanged(CalculatorApp::ViewModel::Common::NetworkAccessBehavior newBehavior);
private:
void ResetLoadStatus();
@ -112,7 +114,7 @@ namespace CalculatorApp
private:
Platform::String ^ m_responseLanguage;
std::unique_ptr<CalculatorApp::DataLoaders::ICurrencyHttpClient> m_client;
std::unique_ptr<CalculatorApp::ViewModel::DataLoaders::ICurrencyHttpClient> m_client;
bool m_isRtlLanguage;
@ -130,8 +132,8 @@ namespace CalculatorApp
CurrencyLoadStatus m_loadStatus;
CalculatorApp::NetworkManager ^ m_networkManager;
CalculatorApp::NetworkAccessBehavior m_networkAccessBehavior;
CalculatorApp::ViewModel::Common::NetworkManager ^ m_networkManager;
CalculatorApp::ViewModel::Common::NetworkAccessBehavior m_networkAccessBehavior;
Windows::Foundation::EventRegistrationToken m_networkBehaviorToken;
bool m_meteredOverrideSet;
};

View file

@ -11,6 +11,7 @@
#endif
using namespace CalculatorApp::DataLoaders;
using namespace CalculatorApp::ViewModel::DataLoaders;
using namespace Platform;
using namespace std;
using namespace Windows::Foundation;

View file

@ -7,7 +7,7 @@
namespace CalculatorApp
{
namespace DataLoaders
namespace ViewModel::DataLoaders
{
class CurrencyHttpClient : public ICurrencyHttpClient
{

View file

@ -5,7 +5,7 @@
namespace CalculatorApp
{
namespace DataLoaders
namespace ViewModel::DataLoaders
{
class ICurrencyHttpClient
{

View file

@ -3,7 +3,7 @@
namespace CalculatorApp
{
namespace ViewModel
namespace ViewModel::Common
{
private
enum UnitConverterUnits

View file

@ -7,8 +7,8 @@
#include "UnitConverterDataConstants.h"
#include "CurrencyDataLoader.h"
using namespace CalculatorApp::Common;
using namespace CalculatorApp::DataLoaders;
using namespace CalculatorApp::ViewModel::Common;
using namespace CalculatorApp::ViewModel::DataLoaders;
using namespace CalculatorApp::ViewModel;
using namespace Platform;
using namespace std;

View file

@ -8,7 +8,7 @@
namespace CalculatorApp
{
namespace ViewModel
namespace ViewModel::Common
{
struct OrderedUnit : UnitConversionManager::Unit
{
@ -34,7 +34,7 @@ namespace CalculatorApp
struct UnitData
{
CalculatorApp::Common::ViewMode categoryId;
CalculatorApp::ViewModel::Common::ViewMode categoryId;
int unitId;
double factor;
};
@ -45,7 +45,7 @@ namespace CalculatorApp
{
}
ExplicitUnitConversionData(
CalculatorApp::Common::ViewMode categoryId,
CalculatorApp::ViewModel::Common::ViewMode categoryId,
int parentUnitId,
int unitId,
double ratio,
@ -58,7 +58,7 @@ namespace CalculatorApp
{
}
CalculatorApp::Common::ViewMode categoryId;
CalculatorApp::ViewModel::Common::ViewMode categoryId;
int parentUnitId;
int unitId;
};
@ -79,10 +79,9 @@ namespace CalculatorApp
// IConverterDataLoader
void GetCategories(_In_ std::shared_ptr<std::vector<UnitConversionManager::Category>> categoriesList);
void GetUnits(_In_ std::unordered_map<CalculatorApp::Common::ViewMode, std::vector<CalculatorApp::ViewModel::OrderedUnit>>& unitMap);
void GetConversionData(_In_ std::unordered_map<CalculatorApp::Common::ViewMode, std::unordered_map<int, double>>& categoryToUnitConversionMap);
void
GetExplicitConversionData(_In_ std::unordered_map<int, std::unordered_map<int, UnitConversionManager::ConversionData>>& unitToUnitConversionList);
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 GetExplicitConversionData(_In_ std::unordered_map<int, std::unordered_map<int, UnitConversionManager::ConversionData>>& unitToUnitConversionList);
std::wstring GetLocalizedStringName(_In_ Platform::String ^ stringId);

View file

@ -10,8 +10,8 @@
#include "Common/CopyPasteManager.h"
using namespace CalculatorApp;
using namespace CalculatorApp::Common;
using namespace CalculatorApp::Common::DateCalculation;
using namespace CalculatorApp::ViewModel::Common;
using namespace CalculatorApp::ViewModel::Common::DateCalculation;
using namespace CalculatorApp::ViewModel;
using namespace Platform;
using namespace Platform::Collections;
@ -45,13 +45,13 @@ DateCalculatorViewModel::DateCalculatorViewModel()
, m_StrDateResult(L"")
, m_StrDateResultAutomationName(L"")
{
const auto & localizationSettings = LocalizationSettings::GetInstance();
LocalizationSettings^ localizationSettings = LocalizationSettings::GetInstance();
// Initialize Date Output format instances
InitializeDateOutputFormats(localizationSettings.GetCalendarIdentifier());
InitializeDateOutputFormats(localizationSettings->GetCalendarIdentifier());
// Initialize Date Calc engine
m_dateCalcEngine = ref new DateCalculationEngine(localizationSettings.GetCalendarIdentifier());
m_dateCalcEngine = ref new DateCalculationEngine(localizationSettings->GetCalendarIdentifier());
// Initialize dates of DatePicker controls to today's date
auto calendar = ref new Calendar();
// We force the timezone to UTC, in order to avoid being affected by Daylight Saving Time
@ -68,7 +68,7 @@ DateCalculatorViewModel::DateCalculatorViewModel()
// Initialize the list separator delimiter appended with a space at the end, e.g. ", "
// This will be used for date difference formatting: Y years, M months, W weeks, D days
m_listSeparator = localizationSettings.GetListSeparator() + L" ";
m_listSeparator = localizationSettings->GetListSeparator() + L" ";
// Initialize the output results
UpdateDisplayResult();
@ -77,7 +77,7 @@ DateCalculatorViewModel::DateCalculatorViewModel()
for (int i = 0; i <= c_maxOffsetValue; i++)
{
wstring numberStr(to_wstring(i));
localizationSettings.LocalizeDisplayValue(&numberStr);
localizationSettings->LocalizeDisplayValue(&numberStr);
m_offsetValues->Append(ref new String(numberStr.c_str()));
}
@ -378,7 +378,7 @@ void DateCalculatorViewModel::OnCopyCommand(Platform::Object ^ parameter)
String ^ DateCalculatorViewModel::GetLocalizedNumberString(int value) const
{
wstring numberStr(to_wstring(value));
LocalizationSettings::GetInstance().LocalizeDisplayValue(&numberStr);
LocalizationSettings::GetInstance()->LocalizeDisplayValue(&numberStr);
return ref new String(numberStr.c_str());
}

View file

@ -125,26 +125,26 @@ namespace CalculatorApp
}
}
property CalculatorApp::Common::DateCalculation::DateDifference DateDiffResult
property CalculatorApp::ViewModel::Common::DateCalculation::DateDifference DateDiffResult
{
CalculatorApp::Common::DateCalculation::DateDifference get()
CalculatorApp::ViewModel::Common::DateCalculation::DateDifference get()
{
return m_dateDiffResult;
}
void set(CalculatorApp::Common::DateCalculation::DateDifference value)
void set(CalculatorApp::ViewModel::Common::DateCalculation::DateDifference value)
{
m_dateDiffResult = value;
UpdateDisplayResult();
}
}
property CalculatorApp::Common::DateCalculation::DateDifference DateDiffResultInDays
property CalculatorApp::ViewModel::Common::DateCalculation::DateDifference DateDiffResultInDays
{
CalculatorApp::Common::DateCalculation::DateDifference get()
CalculatorApp::ViewModel::Common::DateCalculation::DateDifference get()
{
return m_dateDiffResultInDays;
}
void set(CalculatorApp::Common::DateCalculation::DateDifference value)
void set(CalculatorApp::ViewModel::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::Common::DateCalculation::DateDifference m_dateDiffResult;
CalculatorApp::Common::DateCalculation::DateDifference m_dateDiffResultInDays;
CalculatorApp::ViewModel::Common::DateCalculation::DateDifference m_dateDiffResult;
CalculatorApp::ViewModel::Common::DateCalculation::DateDifference m_dateDiffResultInDays;
// Private members
CalculatorApp::Common::DateCalculation::DateCalculationEngine ^ m_dateCalcEngine;
CalculatorApp::Common::DateCalculation::DateUnit m_daysOutputFormat;
CalculatorApp::Common::DateCalculation::DateUnit m_allDateUnitsOutputFormat;
CalculatorApp::ViewModel::Common::DateCalculation::DateCalculationEngine ^ m_dateCalcEngine;
CalculatorApp::ViewModel::Common::DateCalculation::DateUnit m_daysOutputFormat;
CalculatorApp::ViewModel::Common::DateCalculation::DateUnit m_allDateUnitsOutputFormat;
Windows::Globalization::DateTimeFormatting::DateTimeFormatter ^ m_dateTimeFormatter;
std::wstring m_listSeparator;
};

View file

@ -6,7 +6,7 @@
#include "CalcViewModel\Common\LocalizationSettings.h"
#include "CalcViewModel\GraphingCalculatorEnums.h"
using namespace CalculatorApp::Common;
using namespace CalculatorApp::ViewModel::Common;
using namespace Graphing;
using namespace Platform;
using namespace Platform::Collections;
@ -245,7 +245,7 @@ namespace CalculatorApp::ViewModel
return;
}
Platform::String ^ separator = ref new String(LocalizationSettings::GetInstance().GetListSeparator().c_str());
Platform::String ^ separator = ref new String(LocalizationSettings::GetInstance()->GetListSeparator().c_str());
wstring error;
if ((graphEquation->TooComplexFeatures & KeyGraphFeaturesFlag::Domain) == KeyGraphFeaturesFlag::Domain)

View file

@ -6,6 +6,7 @@
#include <CalcManager\NumberFormattingUtils.h>
using namespace CalculatorApp::ViewModel;
using namespace CalculatorApp::ViewModel::Common;
using namespace CalcManager::NumberFormattingUtils;
using namespace GraphControl;
using namespace std;
@ -102,7 +103,7 @@ void GraphingSettingsViewModel::UpdateDisplayRange()
m_Graph->SetDisplayRanges(m_XMinValue, m_XMaxValue, m_YMinValue, m_YMaxValue);
TraceLogger::GetInstance()->LogGraphSettingsChanged(GraphSettingsType::Grid, L"");
CalculatorApp::ViewModel::Common::TraceLogger::GetInstance()->LogGraphSettingsChanged(GraphSettingsType::Grid, L"");
}
bool GraphingSettingsViewModel::HasError()

View file

@ -232,7 +232,7 @@ namespace CalculatorApp::ViewModel
RaisePropertyChanged(L"TrigModeDegrees");
RaisePropertyChanged(L"TrigModeGradians");
TraceLogger::GetInstance()->LogGraphSettingsChanged(GraphSettingsType::TrigUnits, L"Radians");
CalculatorApp::ViewModel::Common::TraceLogger::GetInstance()->LogGraphSettingsChanged(CalculatorApp::ViewModel::Common::GraphSettingsType::TrigUnits, L"Radians");
}
}
}
@ -253,7 +253,7 @@ namespace CalculatorApp::ViewModel
RaisePropertyChanged(L"TrigModeRadians");
RaisePropertyChanged(L"TrigModeGradians");
TraceLogger::GetInstance()->LogGraphSettingsChanged(GraphSettingsType::TrigUnits, L"Degrees");
CalculatorApp::ViewModel::Common::TraceLogger::GetInstance()->LogGraphSettingsChanged(CalculatorApp::ViewModel::Common::GraphSettingsType::TrigUnits, L"Degrees");
}
}
}
@ -274,7 +274,7 @@ namespace CalculatorApp::ViewModel
RaisePropertyChanged(L"TrigModeDegrees");
RaisePropertyChanged(L"TrigModeRadians");
TraceLogger::GetInstance()->LogGraphSettingsChanged(GraphSettingsType::TrigUnits, L"Gradians");
CalculatorApp::ViewModel::Common::TraceLogger::GetInstance()->LogGraphSettingsChanged(CalculatorApp::ViewModel::Common::GraphSettingsType::TrigUnits, L"Gradians");
}
}
}

View file

@ -127,8 +127,8 @@ public
{
Platform::String ^ get()
{
return CalculatorApp::Common::LocalizationStringUtil::GetLocalizedString(
CalculatorApp::AppResourceProvider::GetInstance()->GetResourceString(L"VariableListViewItem"), Name);
return CalculatorApp::ViewModel::Common::LocalizationStringUtil::GetLocalizedString(
CalculatorApp::ViewModel::Common::AppResourceProvider::GetInstance()->GetResourceString(L"VariableListViewItem"), Name);
}
}

View file

@ -5,7 +5,7 @@
#include "HistoryItemViewModel.h"
#include "Common/LocalizationService.h"
using namespace CalculatorApp::Common;
using namespace CalculatorApp::ViewModel::Common;
using namespace CalculatorApp::ViewModel;
using namespace std;
using namespace Platform;

View file

@ -9,8 +9,8 @@
#include "StandardCalculatorViewModel.h"
using namespace CalculatorApp;
using namespace CalculatorApp::Common;
using namespace CalculatorApp::Common::Automation;
using namespace CalculatorApp::ViewModel::Common;
using namespace CalculatorApp::ViewModel::Common::Automation;
using namespace CalculatorApp::ViewModel;
using namespace Platform;
using namespace std;
@ -57,15 +57,15 @@ void HistoryViewModel::ReloadHistory(_In_ ViewMode currentMode)
auto historyListModel = m_calculatorManager->GetHistoryItems(m_currentMode);
auto historyListVM = ref new Platform::Collections::Vector<HistoryItemViewModel ^>();
const auto& localizer = LocalizationSettings::GetInstance();
LocalizationSettings^ localizer = LocalizationSettings::GetInstance();
if (historyListModel.size() > 0)
{
for (auto ritr = historyListModel.rbegin(); ritr != historyListModel.rend(); ++ritr)
{
wstring expression = (*ritr)->historyItemVector.expression;
wstring result = (*ritr)->historyItemVector.result;
localizer.LocalizeDisplayValue(&expression);
localizer.LocalizeDisplayValue(&result);
localizer->LocalizeDisplayValue(&expression);
localizer->LocalizeDisplayValue(&result);
auto item = ref new HistoryItemViewModel(
ref new Platform::String(expression.c_str()),
@ -83,11 +83,11 @@ void HistoryViewModel::ReloadHistory(_In_ ViewMode currentMode)
void HistoryViewModel::OnHistoryItemAdded(_In_ unsigned int addedItemIndex)
{
auto newItem = m_calculatorManager->GetHistoryItem(addedItemIndex);
const auto& localizer = LocalizationSettings::GetInstance();
LocalizationSettings^ localizer = LocalizationSettings::GetInstance();
wstring expression = newItem->historyItemVector.expression;
wstring result = newItem->historyItemVector.result;
localizer.LocalizeDisplayValue(&expression);
localizer.LocalizeDisplayValue(&result);
localizer->LocalizeDisplayValue(&expression);
localizer->LocalizeDisplayValue(&result);
auto item = ref new HistoryItemViewModel(
ref new Platform::String(expression.c_str()),
ref new Platform::String(result.c_str()),
@ -133,7 +133,7 @@ void HistoryViewModel::DeleteItem(_In_ HistoryItemViewModel ^ e)
}
// Adding 1 to the history item index to provide 1-based numbering on announcements.
wstring localizedIndex = to_wstring(itemIndex + 1);
LocalizationSettings::GetInstance().LocalizeDisplayValue(&localizedIndex);
LocalizationSettings::GetInstance()->LocalizeDisplayValue(&localizedIndex);
m_localizedHistorySlotCleared = AppResourceProvider::GetInstance()->GetResourceString(HistoryResourceKeys::HistorySlotCleared);
String ^ announcement = LocalizationStringUtil::GetLocalizedString(m_localizedHistorySlotCleared, StringReference(localizedIndex.c_str()));
HistoryAnnouncement = CalculatorAnnouncement::GetHistorySlotClearedAnnouncement(announcement);

View file

@ -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::Common::Automation::NarratorAnnouncement ^, HistoryAnnouncement);
OBSERVABLE_PROPERTY_R(CalculatorApp::ViewModel::Common::Automation::NarratorAnnouncement ^, HistoryAnnouncement);
property unsigned int ItemsCount
{
unsigned int get()
@ -48,17 +48,17 @@ namespace CalculatorApp
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);
internal : HistoryViewModel(_In_ CalculationManager::CalculatorManager* calculatorManager);
void SetCalculatorDisplay(CalculatorDisplay& calculatorDisplay);
void ReloadHistory(_In_ CalculatorApp::Common::ViewMode currentMode);
void SetCalculatorDisplay(Common::CalculatorDisplay& calculatorDisplay);
unsigned int GetMaxItemSize();
void DeleteItem(_In_ CalculatorApp::ViewModel::HistoryItemViewModel ^ e);
private:
CalculationManager::CalculatorManager* const m_calculatorManager;
CalculatorDisplay m_calculatorDisplay;
Common::CalculatorDisplay m_calculatorDisplay;
CalculationManager::CalculatorMode m_currentMode;
Platform::String ^ m_localizedHistoryCleared;
Platform::String ^ m_localizedHistorySlotCleared;

View file

@ -6,8 +6,8 @@
#include "StandardCalculatorViewModel.h"
using namespace CalculatorApp;
using namespace CalculatorApp::Common;
using namespace CalculatorApp::Common::Automation;
using namespace CalculatorApp::ViewModel::Common;
using namespace CalculatorApp::ViewModel::Common::Automation;
using namespace CalculatorApp::ViewModel;
using namespace Platform;
using namespace std;

View file

@ -10,8 +10,8 @@
#include "Common/TraceLogger.h"
using namespace CalculatorApp;
using namespace CalculatorApp::Common;
using namespace CalculatorApp::Common::Automation;
using namespace CalculatorApp::ViewModel::Common;
using namespace CalculatorApp::ViewModel::Common::Automation;
using namespace CalculatorApp::ViewModel;
using namespace CalculationManager;
using namespace concurrency;
@ -25,7 +25,6 @@ using namespace Windows::UI::Core;
using namespace Windows::UI::Popups;
using namespace Windows::Storage::Streams;
using namespace Windows::Foundation::Collections;
using namespace Utils;
using namespace concurrency;
constexpr int StandardModePrecision = 16;
@ -118,7 +117,7 @@ StandardCalculatorViewModel::StandardCalculatorViewModel()
m_HistoryVM = ref new HistoryViewModel(&m_standardCalculatorManager);
m_HistoryVM->SetCalculatorDisplay(m_calculatorDisplay);
m_decimalSeparator = LocalizationSettings::GetInstance().GetDecimalSeparator();
m_decimalSeparator = LocalizationSettings::GetInstance()->GetDecimalSeparator();
if (CoreWindow::GetForCurrentThread() != nullptr)
{
@ -138,7 +137,7 @@ StandardCalculatorViewModel::StandardCalculatorViewModel()
String ^ StandardCalculatorViewModel::LocalizeDisplayValue(_In_ wstring const& displayValue)
{
wstring result(displayValue);
LocalizationSettings::GetInstance().LocalizeDisplayValue(&result);
LocalizationSettings::GetInstance()->LocalizeDisplayValue(&result);
return ref new Platform::String(result.c_str());
}
@ -170,13 +169,13 @@ String ^ StandardCalculatorViewModel::CalculateNarratorDisplayValue(_In_ wstring
String ^ StandardCalculatorViewModel::GetNarratorStringReadRawNumbers(_In_ String ^ localizedDisplayValue)
{
wstring ws;
const auto& locSettings = LocalizationSettings::GetInstance();
LocalizationSettings^ locSettings = LocalizationSettings::GetInstance();
// Insert a space after each digit in the string, to force Narrator to read them as separate numbers.
for (const wchar_t& c : localizedDisplayValue)
{
ws += c;
if (locSettings.IsLocalizedHexDigit(c))
if (locSettings->IsLocalizedHexDigit(c))
{
ws += L' ';
}
@ -230,7 +229,7 @@ void StandardCalculatorViewModel::SetParenthesisCount(_In_ unsigned int parenthe
void StandardCalculatorViewModel::SetOpenParenthesisCountNarratorAnnouncement()
{
wstring localizedParenthesisCount = to_wstring(m_OpenParenthesisCount).c_str();
LocalizationSettings::GetInstance().LocalizeDisplayValue(&localizedParenthesisCount);
LocalizationSettings::GetInstance()->LocalizeDisplayValue(&localizedParenthesisCount);
if (m_localizedOpenParenthesisCountChangedAutomationFormat == nullptr)
{
@ -329,7 +328,7 @@ void StandardCalculatorViewModel::SetTokens(_Inout_ shared_ptr<vector<pair<wstri
return;
}
const auto& localizer = LocalizationSettings::GetInstance();
LocalizationSettings^ localizer = LocalizationSettings::GetInstance();
const wstring separator = L" ";
for (unsigned int i = 0; i < nTokens; ++i)
@ -338,7 +337,7 @@ void StandardCalculatorViewModel::SetTokens(_Inout_ shared_ptr<vector<pair<wstri
Common::TokenType type;
bool isEditable = currentToken.second != -1;
localizer.LocalizeDisplayValue(&(currentToken.first));
localizer->LocalizeDisplayValue(&(currentToken.first));
if (!isEditable)
{
@ -392,7 +391,7 @@ String ^ StandardCalculatorViewModel::GetCalculatorExpressionAutomationName()
void StandardCalculatorViewModel::SetMemorizedNumbers(const vector<wstring>& newMemorizedNumbers)
{
const auto& localizer = LocalizationSettings::GetInstance();
LocalizationSettings^ localizer = LocalizationSettings::GetInstance();
if (newMemorizedNumbers.size() == 0) // Memory has been cleared
{
MemorizedNumbers->Clear();
@ -408,7 +407,7 @@ void StandardCalculatorViewModel::SetMemorizedNumbers(const vector<wstring>& new
MemoryItemViewModel ^ memorySlot = ref new MemoryItemViewModel(this);
memorySlot->Position = 0;
localizer.LocalizeDisplayValue(&stringValue);
localizer->LocalizeDisplayValue(&stringValue);
memorySlot->Value = ref new String(stringValue.c_str());
MemorizedNumbers->InsertAt(0, memorySlot);
@ -426,7 +425,7 @@ void StandardCalculatorViewModel::SetMemorizedNumbers(const vector<wstring>& new
for (unsigned int i = 0; i < MemorizedNumbers->Size; i++)
{
auto newStringValue = newMemorizedNumbers.at(i);
localizer.LocalizeDisplayValue(&newStringValue);
localizer->LocalizeDisplayValue(&newStringValue);
// If the value is different, update the value
if (MemorizedNumbers->GetAt(i)->Value != StringReference(newStringValue.c_str()))
@ -1001,10 +1000,10 @@ ButtonInfo StandardCalculatorViewModel::MapCharacterToButtonId(char16 ch)
if (result.buttonId == NumbersAndOperatorsEnum::None)
{
if (LocalizationSettings::GetInstance().IsLocalizedDigit(ch))
if (LocalizationSettings::GetInstance()->IsLocalizedDigit(ch))
{
result.buttonId =
NumbersAndOperatorsEnum::Zero + static_cast<NumbersAndOperatorsEnum>(ch - LocalizationSettings::GetInstance().GetDigitSymbolFromEnUsDigit('0'));
NumbersAndOperatorsEnum::Zero + static_cast<NumbersAndOperatorsEnum>(ch - LocalizationSettings::GetInstance()->GetDigitSymbolFromEnUsDigit('0'));
result.canSendNegate = true;
}
}
@ -1044,7 +1043,7 @@ void StandardCalculatorViewModel::OnMemoryItemChanged(unsigned int indexOfMemory
String ^ localizedValue = memSlot->Value;
wstring localizedIndex = to_wstring(indexOfMemory + 1);
LocalizationSettings::GetInstance().LocalizeDisplayValue(&localizedIndex);
LocalizationSettings::GetInstance()->LocalizeDisplayValue(&localizedIndex);
if (m_localizedMemoryItemChangedAutomationFormat == nullptr)
{
@ -1116,7 +1115,7 @@ void StandardCalculatorViewModel::OnMemoryClear(_In_ Object ^ memoryItemPosition
TraceLogger::GetInstance()->UpdateButtonUsage(NumbersAndOperatorsEnum::MemoryClear, GetCalculatorMode());
wstring localizedIndex = to_wstring(boxedPosition->Value + 1);
LocalizationSettings::GetInstance().LocalizeDisplayValue(&localizedIndex);
LocalizationSettings::GetInstance()->LocalizeDisplayValue(&localizedIndex);
if (m_localizedMemoryItemClearedAutomationFormat == nullptr)
{
@ -1216,7 +1215,7 @@ String ^ StandardCalculatorViewModel::GetRawDisplayValue()
}
else
{
return LocalizationSettings::GetInstance().RemoveGroupSeparators(DisplayValue);
return LocalizationSettings::GetInstance()->RemoveGroupSeparators(DisplayValue);
}
}
@ -1535,7 +1534,7 @@ size_t StandardCalculatorViewModel::LengthWithoutPadding(wstring str)
wstring StandardCalculatorViewModel::AddPadding(wstring binaryString)
{
if (LocalizationSettings::GetInstance().GetEnglishValueFromLocalizedDigits(StringReference(binaryString.c_str())) == L"0")
if (LocalizationSettings::GetInstance()->GetEnglishValueFromLocalizedDigits(StringReference(binaryString.c_str())) == L"0")
{
return binaryString;
}
@ -1571,13 +1570,13 @@ void StandardCalculatorViewModel::UpdateProgrammerPanelDisplay()
binaryDisplayString = m_standardCalculatorManager.GetResultForRadix(2, precision, true);
}
}
const auto& localizer = LocalizationSettings::GetInstance();
LocalizationSettings^ localizer = LocalizationSettings::GetInstance();
binaryDisplayString = AddPadding(binaryDisplayString);
localizer.LocalizeDisplayValue(&hexDisplayString);
localizer.LocalizeDisplayValue(&decimalDisplayString);
localizer.LocalizeDisplayValue(&octalDisplayString);
localizer.LocalizeDisplayValue(&binaryDisplayString);
localizer->LocalizeDisplayValue(&hexDisplayString);
localizer->LocalizeDisplayValue(&decimalDisplayString);
localizer->LocalizeDisplayValue(&octalDisplayString);
localizer->LocalizeDisplayValue(&binaryDisplayString);
HexDisplayValue = ref new Platform::String(hexDisplayString.c_str());
DecimalDisplayValue = ref new Platform::String(decimalDisplayString.c_str());
@ -1609,7 +1608,7 @@ void StandardCalculatorViewModel::UpdateOperand(int pos, String ^ text)
{
pair<wstring, int> p = m_tokens->at(pos);
String ^ englishString = LocalizationSettings::GetInstance().GetEnglishValueFromLocalizedDigits(text);
String ^ englishString = LocalizationSettings::GetInstance()->GetEnglishValueFromLocalizedDigits(text);
p.first = englishString->Data();
int commandPos = p.second;
@ -1719,7 +1718,7 @@ ViewMode StandardCalculatorViewModel::GetCalculatorMode()
return ViewMode::Programmer;
}
void StandardCalculatorViewModel::ValueBitLength::set(CalculatorApp::Common::BitLength value)
void StandardCalculatorViewModel::ValueBitLength::set(CalculatorApp::ViewModel::Common::BitLength value)
{
if (m_valueBitLength != value)
{

View file

@ -29,7 +29,7 @@ namespace CalculatorApp
public value struct ButtonInfo
{
NumbersAndOperatorsEnum buttonId;
CalculatorApp::ViewModel::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::Common::NumberBase, CurrentRadixType);
OBSERVABLE_PROPERTY_R(CalculatorApp::ViewModel::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::Common::Automation::NarratorAnnouncement ^, Announcement);
OBSERVABLE_PROPERTY_R(CalculatorApp::ViewModel::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::Common::BitLength ValueBitLength
property CalculatorApp::ViewModel::Common::BitLength ValueBitLength
{
CalculatorApp::Common::BitLength get()
CalculatorApp::ViewModel::Common::BitLength get()
{
return m_valueBitLength;
}
void set(CalculatorApp::Common::BitLength value);
void set(CalculatorApp::ViewModel::Common::BitLength value);
}
property bool IsStandard
@ -244,6 +244,21 @@ namespace CalculatorApp
void ResetCalcManager(bool clearMemory);
void SendCommandToCalcManager(int command);
public:
// Memory feature related methods.
void OnMemoryButtonPressed();
void OnMemoryItemPressed(Platform::Object ^ memoryItemPosition);
void OnMemoryAdd(Platform::Object ^ memoryItemPosition);
void OnMemorySubtract(Platform::Object ^ memoryItemPosition);
void OnMemoryClear(_In_ Platform::Object ^ memoryItemPosition);
void SelectHistoryItem(HistoryItemViewModel ^ item);
void SwitchProgrammerModeBase(CalculatorApp::ViewModel::Common::NumberBase calculatorBase);
void SetBitshiftRadioButtonCheckedAnnouncement(Platform::String ^ announcement);
void SetOpenParenthesisCountNarratorAnnouncement();
void SwitchAngleType(CalculatorApp::ViewModel::Common::NumbersAndOperatorsEnum num);
void FtoEButtonToggled();
internal:
void OnPaste(Platform::String ^ pastedString);
void OnCopyCommand(Platform::Object ^ parameter);
@ -251,35 +266,23 @@ namespace CalculatorApp
ButtonInfo MapCharacterToButtonId(char16 ch);
// Memory feature related methods. They are internal because they need to called from the MainPage code-behind
void OnMemoryButtonPressed();
void OnMemoryItemPressed(Platform::Object ^ memoryItemPosition);
void OnMemoryAdd(Platform::Object ^ memoryItemPosition);
void OnMemorySubtract(Platform::Object ^ memoryItemPosition);
void OnMemoryClear(_In_ Platform::Object ^ memoryItemPosition);
void OnInputChanged();
void DisplayPasteError();
void SetParenthesisCount(_In_ unsigned int parenthesisCount);
void SetOpenParenthesisCountNarratorAnnouncement();
void OnNoRightParenAdded();
void SetNoParenAddedNarratorAnnouncement();
void OnMaxDigitsReached();
void OnBinaryOperatorReceived();
void OnMemoryItemChanged(unsigned int indexOfMemory);
void SetBitshiftRadioButtonCheckedAnnouncement(Platform::String ^ announcement);
Platform::String ^ GetLocalizedStringFormat(Platform::String ^ format, Platform::String ^ displayValue);
void OnPropertyChanged(Platform::String ^ propertyname);
void SetCalculatorType(CalculatorApp::Common::ViewMode targetState);
void SetCalculatorType(CalculatorApp::ViewModel::Common::ViewMode targetState);
Platform::String ^ GetRawDisplayValue();
void Recalculate(bool fromHistory = false);
bool IsOperator(CalculationManager::Command cmdenum);
void FtoEButtonToggled();
void SwitchProgrammerModeBase(CalculatorApp::Common::NumberBase calculatorBase);
void SetMemorizedNumbersString();
void SwitchAngleType(NumbersAndOperatorsEnum num);
void SetMemorizedNumbersString();
void ResetDisplay();
void SetPrecision(int32_t precision);
@ -287,11 +290,11 @@ namespace CalculatorApp
{
m_standardCalculatorManager.UpdateMaxIntDigits();
}
NumbersAndOperatorsEnum GetCurrentAngleType()
CalculatorApp::ViewModel::Common::NumbersAndOperatorsEnum GetCurrentAngleType()
{
return m_CurrentAngleType;
}
void SelectHistoryItem(HistoryItemViewModel ^ item);
private:
void SetMemorizedNumbers(const std::vector<std::wstring>& memorizedNumbers);
void UpdateProgrammerPanelDisplay();
@ -304,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);
NumbersAndOperatorsEnum ConvertIntegerToNumbersAndOperatorsEnum(unsigned int parameter);
static RadixType GetRadixTypeFromNumberBase(CalculatorApp::Common::NumberBase base);
NumbersAndOperatorsEnum m_CurrentAngleType;
CalculatorApp::ViewModel::Common::NumbersAndOperatorsEnum ConvertIntegerToNumbersAndOperatorsEnum(unsigned int parameter);
static RadixType GetRadixTypeFromNumberBase(CalculatorApp::ViewModel::Common::NumberBase base);
CalculatorApp::ViewModel::Common::NumbersAndOperatorsEnum m_CurrentAngleType;
wchar_t m_decimalSeparator;
CalculatorDisplay m_calculatorDisplay;
CalculatorApp::EngineResourceProvider m_resourceProvider;
CalculatorApp::ViewModel::Common::CalculatorDisplay m_calculatorDisplay;
CalculatorApp::ViewModel::Common::EngineResourceProvider m_resourceProvider;
CalculationManager::CalculatorManager m_standardCalculatorManager;
Platform::String ^ m_expressionAutomationNameFormat;
Platform::String ^ m_localizedCalculationResultAutomationFormat;
@ -336,18 +339,18 @@ namespace CalculatorApp
bool m_isRtlLanguage;
bool m_operandUpdated;
bool m_isLastOperationHistoryLoad;
CalculatorApp::Common::BitLength m_valueBitLength;
CalculatorApp::ViewModel::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::Common::Automation::NarratorAnnouncement ^ GetDisplayUpdatedNarratorAnnouncement();
CalculatorApp::ViewModel::Common::Automation::NarratorAnnouncement ^ GetDisplayUpdatedNarratorAnnouncement();
Platform::String ^ GetCalculatorExpressionAutomationName();
Platform::String ^ GetNarratorStringReadRawNumbers(_In_ Platform::String ^ localizedDisplayValue);
CalculationManager::Command ConvertToOperatorsEnum(NumbersAndOperatorsEnum operation);
CalculationManager::Command ConvertToOperatorsEnum(CalculatorApp::ViewModel::Common::NumbersAndOperatorsEnum operation);
void DisableButtons(CalculationManager::CommandType selectedExpressionCommandType);
Platform::String ^ m_feedbackForButtonPress;
@ -368,9 +371,9 @@ namespace CalculatorApp
void SaveEditedCommand(_In_ unsigned int index, _In_ CalculationManager::Command command);
CalculatorApp::Common::ViewMode GetCalculatorMode();
CalculatorApp::ViewModel::Common::ViewMode GetCalculatorMode();
friend class CalculatorDisplay;
friend class CalculatorApp::ViewModel::Common::CalculatorDisplay;
friend class CalculatorUnitTests::MultiWindowUnitTests;
};
}

View file

@ -15,9 +15,10 @@
#include "DataLoaders/UnitConverterDataLoader.h"
using namespace CalculatorApp;
using namespace CalculatorApp::Common;
using namespace CalculatorApp::Common::Automation;
using namespace CalculatorApp::ViewModel;
using namespace CalculatorApp::ViewModel::Common;
using namespace CalculatorApp::ViewModel::Common::Automation;
using namespace CalculatorApp::ViewModel::DataLoaders;
using namespace concurrency;
using namespace Platform;
using namespace Platform::Collections;
@ -75,7 +76,7 @@ namespace
StringReference SupplementaryVisibilityPropertyName(L"SupplementaryVisibility");
}
namespace CalculatorApp::ViewModel::UnitConverterResourceKeys
namespace CalculatorApp::ViewModel::DataLoaders::UnitConverterResourceKeys
{
StringReference ValueFromFormat(L"Format_ValueFrom");
StringReference ValueFromDecimalFormat(L"Format_ValueFrom_Decimal");
@ -128,7 +129,7 @@ UnitConverterViewModel::UnitConverterViewModel(const shared_ptr<UCM::IUnitConver
m_decimalFormatter = localizationService->GetRegionalSettingsAwareDecimalFormatter();
m_decimalFormatter->FractionDigits = 0;
m_decimalFormatter->IsGrouped = true;
m_decimalSeparator = LocalizationSettings::GetInstance().GetDecimalSeparator();
m_decimalSeparator = LocalizationSettings::GetInstance()->GetDecimalSeparator();
m_currencyFormatter = localizationService->GetRegionalSettingsAwareCurrencyFormatter();
m_currencyFormatter->IsGrouped = true;
@ -922,10 +923,10 @@ NumbersAndOperatorsEnum UnitConverterViewModel::MapCharacterToButtonId(const wch
if (mappedValue == NumbersAndOperatorsEnum::None)
{
if (LocalizationSettings::GetInstance().IsLocalizedDigit(ch))
if (LocalizationSettings::GetInstance()->IsLocalizedDigit(ch))
{
mappedValue = NumbersAndOperatorsEnum::Zero
+ static_cast<NumbersAndOperatorsEnum>(ch - LocalizationSettings::GetInstance().GetDigitSymbolFromEnUsDigit(L'0'));
+ static_cast<NumbersAndOperatorsEnum>(ch - LocalizationSettings::GetInstance()->GetDigitSymbolFromEnUsDigit(L'0'));
canSendNegate = true;
}
}

View file

@ -35,6 +35,11 @@ namespace CalculatorApp
}
}
int GetModelCategoryId()
{
return GetModelCategory().id;
}
internal : const UnitConversionManager::Category& GetModelCategory() const
{
return m_original;
@ -70,38 +75,51 @@ namespace CalculatorApp
return AccessibleName;
}
internal : const UnitConversionManager::Unit& GetModelUnit() const
public:
bool IsModelUnitWhimsical()
{
return m_original;
return m_original.isWhimsical;
}
int ModelUnitID()
{
return m_original.id;
}
internal:
const UnitConversionManager::Unit& GetModelUnit() const
{
return m_original;
}
private:
const UnitConversionManager::Unit m_original;
};
[Windows::UI::Xaml::Data::Bindable] public ref class SupplementaryResult sealed : public Windows::UI::Xaml::Data::INotifyPropertyChanged
{
internal : SupplementaryResult(Platform::String ^ value, Unit ^ unit)
internal:
SupplementaryResult(Platform::String ^ value, Unit ^ unit)
: m_Value(value)
, m_Unit(unit)
{
}
bool IsWhimsical() const
public:
bool IsWhimsical()
{
return m_Unit->GetModelUnit().isWhimsical;
}
Platform::String ^ GetLocalizedAutomationName();
public:
OBSERVABLE_OBJECT();
OBSERVABLE_PROPERTY_R(Platform::String ^, Value);
OBSERVABLE_PROPERTY_R(CalculatorApp::ViewModel::Unit ^, Unit);
};
interface class IActivatable
public interface class IActivatable
{
virtual property bool IsActive;
};
@ -143,7 +161,7 @@ namespace CalculatorApp
OBSERVABLE_OBJECT_CALLBACK(OnPropertyChanged);
OBSERVABLE_PROPERTY_R(Windows::Foundation::Collections::IObservableVector<Category ^> ^, Categories);
OBSERVABLE_PROPERTY_RW(CalculatorApp::Common::ViewMode, Mode);
OBSERVABLE_PROPERTY_RW(CalculatorApp::ViewModel::Common::ViewMode, Mode);
OBSERVABLE_PROPERTY_R(Windows::Foundation::Collections::IObservableVector<Unit ^> ^, Units);
OBSERVABLE_PROPERTY_RW(Platform::String ^, CurrencySymbol1);
OBSERVABLE_PROPERTY_RW(Unit ^, Unit1);
@ -158,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::Common::Automation::NarratorAnnouncement ^, Announcement);
OBSERVABLE_PROPERTY_RW(CalculatorApp::ViewModel::Common::Automation::NarratorAnnouncement ^, Announcement);
OBSERVABLE_PROPERTY_RW(bool, IsDecimalEnabled);
OBSERVABLE_PROPERTY_RW(bool, IsDropDownOpen);
OBSERVABLE_PROPERTY_RW(bool, IsDropDownEnabled);
@ -167,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::NetworkAccessBehavior, NetworkBehavior);
OBSERVABLE_NAMED_PROPERTY_RW(CalculatorApp::ViewModel::Common::NetworkAccessBehavior, NetworkBehavior);
OBSERVABLE_NAMED_PROPERTY_RW(bool, CurrencyDataLoadFailed);
OBSERVABLE_NAMED_PROPERTY_RW(bool, CurrencyDataIsWeekOld);
@ -185,7 +203,7 @@ namespace CalculatorApp
if (value != nullptr)
{
auto currentCategory = value->GetModelCategory();
IsCurrencyCurrentCategory = currentCategory.id == CalculatorApp::Common::NavCategory::Serialize(CalculatorApp::Common::ViewMode::Currency);
IsCurrencyCurrentCategory = currentCategory.id == CalculatorApp::ViewModel::Common::NavCategory::Serialize(CalculatorApp::ViewModel::Common::ViewMode::Currency);
}
RaisePropertyChanged("CurrentCategory");
}
@ -217,12 +235,14 @@ namespace CalculatorApp
void AnnounceConversionResult();
void OnPaste(Platform::String ^ stringToPaste);
void RefreshCurrencyRatios();
void OnValueActivated(IActivatable ^ control);
internal : void ResetView();
void PopulateData();
NumbersAndOperatorsEnum MapCharacterToButtonId(const wchar_t ch, bool& canSendNegate);
CalculatorApp::ViewModel::Common::NumbersAndOperatorsEnum MapCharacterToButtonId(const wchar_t ch, bool& canSendNegate);
void DisplayPasteError();
void OnValueActivated(IActivatable ^ control);
void OnPaste(Platform::String ^ stringToPaste);
void OnCopyCommand(Platform::Object ^ parameter);
void OnPasteCommand(Platform::Object ^ parameter);
@ -255,8 +275,7 @@ namespace CalculatorApp
void OnCurrencyDataLoadFinished(bool didLoad);
void OnCurrencyTimestampUpdated(_In_ const std::wstring& timestamp, bool isWeekOld);
void RefreshCurrencyRatios();
void OnNetworkBehaviorChanged(_In_ CalculatorApp::NetworkAccessBehavior newBehavior);
void OnNetworkBehaviorChanged(_In_ CalculatorApp::ViewModel::Common::NetworkAccessBehavior newBehavior);
const std::wstring& GetValueFromUnlocalized() const
{
@ -282,7 +301,7 @@ namespace CalculatorApp
void OnCategoryChanged(Platform::Object ^ unused);
void OnUnitChanged(Platform::Object ^ unused);
void OnSwitchActive(Platform::Object ^ unused);
UnitConversionManager::Command CommandFromButtonId(CalculatorApp::NumbersAndOperatorsEnum button);
UnitConversionManager::Command CommandFromButtonId(CalculatorApp::ViewModel::Common::NumbersAndOperatorsEnum button);
void SupplementaryResultsTimerTick(Windows::System::Threading::ThreadPoolTimer ^ timer);
void SupplementaryResultsTimerCancel(Windows::System::Threading::ThreadPoolTimer ^ timer);
void RefreshSupplementaryResults();
@ -449,7 +468,7 @@ namespace CalculatorApp
void NetworkBehaviorChanged(_In_ int newBehavior) override
{
m_viewModel->OnNetworkBehaviorChanged(static_cast<CalculatorApp::NetworkAccessBehavior>(newBehavior));
m_viewModel->OnNetworkBehaviorChanged(static_cast<CalculatorApp::ViewModel::Common::NetworkAccessBehavior>(newBehavior));
}
private:

View file

@ -1,19 +0,0 @@
// 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);
}
}
}

View file

@ -1,15 +0,0 @@
// 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);
}
}

View file

@ -49,7 +49,7 @@
// Once the app switches to min version RS3, the namespaces can be removed.
// TODO - MSFT 12735088
namespace StandardPeers = Windows::UI::Xaml::Automation::Peers;
namespace CalculatorApp::Common::Automation
namespace CalculatorApp::ViewModel::Common::Automation
{
}
namespace CustomPeers = CalculatorApp::Common::Automation;
namespace CustomPeers = CalculatorApp::ViewModel::Common::Automation;

View file

@ -0,0 +1,414 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{cc9b4fa7-d746-4f52-9401-0ad1b4d6b16d}</ProjectGuid>
<Keyword>StaticLibrary</Keyword>
<RootNamespace>CalcViewModelCopyForUT</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<AppContainerApplication>true</AppContainerApplication>
<ApplicationType>Windows Store</ApplicationType>
<WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.17134.0</WindowsTargetPlatformMinVersion>
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<PropertyGroup>
<GenerateManifest>false</GenerateManifest>
<GenerateProjectSpecificOutputFolder>true</GenerateProjectSpecificOutputFolder>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;$(SolutionDir)CalcViewModel\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4453</DisableSpecificWarnings>
<AdditionalOptions>/bigobj /await /std:c++17 /utf-8 %(AdditionalOptions)</AdditionalOptions>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
</Link>
<Lib>
<AdditionalOptions>/ignore:4264 %(AdditionalOptions)</AdditionalOptions>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;$(SolutionDir)CalcViewModel\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4453</DisableSpecificWarnings>
<AdditionalOptions>/bigobj /await /std:c++17 /utf-8 %(AdditionalOptions)</AdditionalOptions>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
</Link>
<Lib>
<AdditionalOptions>/ignore:4264 %(AdditionalOptions)</AdditionalOptions>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|arm'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;$(SolutionDir)CalcViewModel\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4453</DisableSpecificWarnings>
<AdditionalOptions>/bigobj /await /std:c++17 /utf-8 %(AdditionalOptions)</AdditionalOptions>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
</Link>
<Lib>
<AdditionalOptions>/ignore:4264 %(AdditionalOptions)</AdditionalOptions>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|arm'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;$(SolutionDir)CalcViewModel\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4453</DisableSpecificWarnings>
<AdditionalOptions>/bigobj /await /std:c++17 /utf-8 %(AdditionalOptions)</AdditionalOptions>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
</Link>
<Lib>
<AdditionalOptions>/ignore:4264 %(AdditionalOptions)</AdditionalOptions>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(SolutionDir);$(SolutionDir)CalcViewModel\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4453</DisableSpecificWarnings>
<AdditionalOptions>/bigobj /await /std:c++17 /utf-8 %(AdditionalOptions)</AdditionalOptions>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
</Link>
<Lib>
<AdditionalOptions>/ignore:4264 %(AdditionalOptions)</AdditionalOptions>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;$(SolutionDir)CalcViewModel\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4453</DisableSpecificWarnings>
<AdditionalOptions>/bigobj /await /std:c++17 /utf-8 %(AdditionalOptions)</AdditionalOptions>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
</Link>
<Lib>
<AdditionalOptions>/ignore:4264 %(AdditionalOptions)</AdditionalOptions>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|arm64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;$(SolutionDir)CalcViewModel\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4453</DisableSpecificWarnings>
<AdditionalOptions>/bigobj /await /std:c++17 /utf-8 %(AdditionalOptions)</AdditionalOptions>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
</Link>
<Lib>
<AdditionalOptions>/ignore:4264 %(AdditionalOptions)</AdditionalOptions>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|arm64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<CompileAsWinRT>true</CompileAsWinRT>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;$(SolutionDir)CalcViewModel\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4453</DisableSpecificWarnings>
<AdditionalOptions>/bigobj /await /std:c++17 /utf-8 %(AdditionalOptions)</AdditionalOptions>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
</Link>
<Lib>
<AdditionalOptions>/ignore:4264 %(AdditionalOptions)</AdditionalOptions>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(IsStoreBuild)' == 'True'">
<ClCompile>
<AdditionalOptions>/DSEND_DIAGNOSTICS %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\CalcViewModel\ApplicationViewModel.h" />
<ClInclude Include="..\CalcViewModel\Common\AlwaysSelectedCollectionView.h" />
<ClInclude Include="..\CalcViewModel\Common\AppResourceProvider.h" />
<ClInclude Include="..\CalcViewModel\Common\Automation\NarratorAnnouncement.h" />
<ClInclude Include="..\CalcViewModel\Common\Automation\NarratorNotifier.h" />
<ClInclude Include="..\CalcViewModel\Common\BitLength.h" />
<ClInclude Include="..\CalcViewModel\Common\CalculatorButtonPressedEventArgs.h" />
<ClInclude Include="..\CalcViewModel\Common\CalculatorButtonUser.h" />
<ClInclude Include="..\CalcViewModel\Common\CalculatorDisplay.h" />
<ClInclude Include="..\CalcViewModel\Common\CopyPasteManager.h" />
<ClInclude Include="..\CalcViewModel\Common\DateCalculator.h" />
<ClInclude Include="..\CalcViewModel\Common\DelegateCommand.h" />
<ClInclude Include="..\CalcViewModel\Common\DisplayExpressionToken.h" />
<ClInclude Include="..\CalcViewModel\Common\EngineResourceProvider.h" />
<ClInclude Include="..\CalcViewModel\Common\ExpressionCommandDeserializer.h" />
<ClInclude Include="..\CalcViewModel\Common\ExpressionCommandSerializer.h" />
<ClInclude Include="..\CalcViewModel\Common\LocalizationService.h" />
<ClInclude Include="..\CalcViewModel\Common\LocalizationSettings.h" />
<ClInclude Include="..\CalcViewModel\Common\LocalizationStringUtil.h" />
<ClInclude Include="..\CalcViewModel\Common\MyVirtualKey.h" />
<ClInclude Include="..\CalcViewModel\Common\NavCategory.h" />
<ClInclude Include="..\CalcViewModel\Common\NetworkManager.h" />
<ClInclude Include="..\CalcViewModel\Common\NumberBase.h" />
<ClInclude Include="..\CalcViewModel\Common\RadixType.h" />
<ClInclude Include="..\CalcViewModel\Common\TraceLogger.h" />
<ClInclude Include="..\CalcViewModel\Common\Utils.h" />
<ClInclude Include="..\CalcViewModel\DataLoaders\CurrencyDataLoader.h" />
<ClInclude Include="..\CalcViewModel\DataLoaders\CurrencyHttpClient.h" />
<ClInclude Include="..\CalcViewModel\DataLoaders\ICurrencyHttpClient.h" />
<ClInclude Include="..\CalcViewModel\DataLoaders\UnitConverterDataConstants.h" />
<ClInclude Include="..\CalcViewModel\DataLoaders\UnitConverterDataLoader.h" />
<ClInclude Include="..\CalcViewModel\DateCalculatorViewModel.h" />
<ClInclude Include="..\CalcViewModel\GraphingCalculatorEnums.h" />
<ClInclude Include="..\CalcViewModel\GraphingCalculator\EquationViewModel.h" />
<ClInclude Include="..\CalcViewModel\GraphingCalculator\GraphingCalculatorViewModel.h" />
<ClInclude Include="..\CalcViewModel\GraphingCalculator\VariableViewModel.h" />
<ClInclude Include="..\CalcViewModel\GraphingCalculator\GraphingSettingsViewModel.h" />
<ClInclude Include="..\CalcViewModel\HistoryItemViewModel.h" />
<ClInclude Include="..\CalcViewModel\HistoryViewModel.h" />
<ClInclude Include="..\CalcViewModel\MemoryItemViewModel.h" />
<ClInclude Include="..\CalcViewModel\pch.h" />
<ClInclude Include="..\CalcViewModel\StandardCalculatorViewModel.h" />
<ClInclude Include="..\CalcViewModel\targetver.h" />
<ClInclude Include="..\CalcViewModel\UnitConverterViewModel.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\CalcViewModel\ApplicationViewModel.cpp" />
<ClCompile Include="..\CalcViewModel\Common\AppResourceProvider.cpp" />
<ClCompile Include="..\CalcViewModel\Common\Automation\NarratorAnnouncement.cpp" />
<ClCompile Include="..\CalcViewModel\Common\Automation\NarratorNotifier.cpp" />
<ClCompile Include="..\CalcViewModel\Common\CalculatorButtonPressedEventArgs.cpp" />
<ClCompile Include="..\CalcViewModel\Common\CalculatorDisplay.cpp" />
<ClCompile Include="..\CalcViewModel\Common\CopyPasteManager.cpp" />
<ClCompile Include="..\CalcViewModel\Common\DateCalculator.cpp" />
<ClCompile Include="..\CalcViewModel\Common\EngineResourceProvider.cpp" />
<ClCompile Include="..\CalcViewModel\Common\ExpressionCommandDeserializer.cpp" />
<ClCompile Include="..\CalcViewModel\Common\ExpressionCommandSerializer.cpp" />
<ClCompile Include="..\CalcViewModel\Common\LocalizationService.cpp" />
<ClCompile Include="..\CalcViewModel\Common\NavCategory.cpp" />
<ClCompile Include="..\CalcViewModel\Common\NetworkManager.cpp" />
<ClCompile Include="..\CalcViewModel\Common\RadixType.cpp" />
<ClCompile Include="..\CalcViewModel\Common\TraceLogger.cpp" />
<ClCompile Include="..\CalcViewModel\Common\Utils.cpp" />
<ClCompile Include="..\CalcViewModel\DataLoaders\CurrencyDataLoader.cpp" />
<ClCompile Include="..\CalcViewModel\DataLoaders\CurrencyHttpClient.cpp" />
<ClCompile Include="..\CalcViewModel\DataLoaders\UnitConverterDataLoader.cpp" />
<ClCompile Include="..\CalcViewModel\DateCalculatorViewModel.cpp" />
<ClCompile Include="..\CalcViewModel\GraphingCalculator\EquationViewModel.cpp" />
<ClCompile Include="..\CalcViewModel\GraphingCalculator\GraphingCalculatorViewModel.cpp" />
<ClCompile Include="..\CalcViewModel\GraphingCalculator\GraphingSettingsViewModel.cpp" />
<ClCompile Include="..\CalcViewModel\HistoryItemViewModel.cpp" />
<ClCompile Include="..\CalcViewModel\HistoryViewModel.cpp" />
<ClCompile Include="..\CalcViewModel\MemoryItemViewModel.cpp" />
<ClCompile Include="..\CalcViewModel\pch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\CalcViewModel\StandardCalculatorViewModel.cpp" />
<ClCompile Include="..\CalcViewModel\UnitConverterViewModel.cpp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CalcManager\CalcManager.vcxproj">
<Project>{311e866d-8b93-4609-a691-265941fee101}</Project>
</ProjectReference>
<ProjectReference Include="..\GraphControl\GraphControl.vcxproj">
<Project>{e727a92b-f149-492c-8117-c039a298719b}</Project>
</ProjectReference>
<ProjectReference Include="..\TraceLogging\TraceLogging.vcxproj">
<Project>{fc81ff41-02cd-4cd9-9bc5-45a1e39ac6ed}</Project>
</ProjectReference>
</ItemGroup>
<ItemDefinitionGroup Condition="!Exists('..\CalcViewModel\DataLoaders\DataLoaderConstants.h')">
<ClCompile>
<AdditionalOptions>/DUSE_MOCK_DATA %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
</ItemDefinitionGroup>
<Choose>
<When Condition="Exists('..\CalcViewModel\DataLoaders\DataLoaderConstants.h')">
<ItemGroup>
<ClInclude Include="..\CalcViewModel\DataLoaders\DataLoaderConstants.h" />
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<ClInclude Include="..\CalcViewModel\DataLoaders\DataLoaderMockConstants.h" />
</ItemGroup>
</Otherwise>
</Choose>
<ItemGroup>
<None Include="..\CalcViewModel\DataLoaders\DefaultFromToCurrency.json" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets" />
</Project>

View file

@ -0,0 +1,213 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Common">
<UniqueIdentifier>{2c2762e9-7673-4c4e-bf31-9513125dfc00}</UniqueIdentifier>
</Filter>
<Filter Include="Common\Automation">
<UniqueIdentifier>{8f48b19f-14df-421f-bcc6-ef908f9dcff0}</UniqueIdentifier>
</Filter>
<Filter Include="DataLoaders">
<UniqueIdentifier>{6811c769-d698-4add-b477-794316d39c66}</UniqueIdentifier>
</Filter>
<Filter Include="GraphingCalculator">
<UniqueIdentifier>{da163ad4-d001-45eb-b4b3-6e9e17d22077}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\CalcViewModel\Common\AppResourceProvider.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="..\CalcViewModel\Common\Automation\NarratorAnnouncement.cpp">
<Filter>Common\Automation</Filter>
</ClCompile>
<ClCompile Include="..\CalcViewModel\Common\Automation\NarratorNotifier.cpp">
<Filter>Common\Automation</Filter>
</ClCompile>
<ClCompile Include="..\CalcViewModel\ApplicationViewModel.cpp" />
<ClCompile Include="..\CalcViewModel\DateCalculatorViewModel.cpp" />
<ClCompile Include="..\CalcViewModel\HistoryItemViewModel.cpp" />
<ClCompile Include="..\CalcViewModel\HistoryViewModel.cpp" />
<ClCompile Include="..\CalcViewModel\MemoryItemViewModel.cpp" />
<ClCompile Include="..\CalcViewModel\pch.cpp" />
<ClCompile Include="..\CalcViewModel\StandardCalculatorViewModel.cpp" />
<ClCompile Include="..\CalcViewModel\UnitConverterViewModel.cpp" />
<ClCompile Include="..\CalcViewModel\Common\Utils.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="..\CalcViewModel\Common\CalculatorButtonPressedEventArgs.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="..\CalcViewModel\Common\CalculatorDisplay.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="..\CalcViewModel\Common\CopyPasteManager.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="..\CalcViewModel\Common\DateCalculator.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="..\CalcViewModel\Common\EngineResourceProvider.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="..\CalcViewModel\Common\ExpressionCommandDeserializer.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="..\CalcViewModel\Common\ExpressionCommandSerializer.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="..\CalcViewModel\Common\LocalizationService.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="..\CalcViewModel\Common\NavCategory.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="..\CalcViewModel\Common\NetworkManager.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="..\CalcViewModel\Common\TraceLogger.cpp">
<Filter>Common</Filter>
</ClCompile>
<ClCompile Include="..\CalcViewModel\DataLoaders\CurrencyDataLoader.cpp">
<Filter>DataLoaders</Filter>
</ClCompile>
<ClCompile Include="..\CalcViewModel\DataLoaders\CurrencyHttpClient.cpp">
<Filter>DataLoaders</Filter>
</ClCompile>
<ClCompile Include="..\CalcViewModel\DataLoaders\UnitConverterDataLoader.cpp">
<Filter>DataLoaders</Filter>
</ClCompile>
<ClCompile Include="..\CalcViewModel\GraphingCalculator\EquationViewModel.cpp">
<Filter>GraphingCalculator</Filter>
</ClCompile>
<ClCompile Include="..\CalcViewModel\GraphingCalculator\GraphingCalculatorViewModel.cpp">
<Filter>GraphingCalculator</Filter>
</ClCompile>
<ClCompile Include="..\CalcViewModel\GraphingCalculator\GraphingSettingsViewModel.cpp">
<Filter>GraphingCalculator</Filter>
</ClCompile>
<ClCompile Include="..\CalcViewModel\Common\RadixType.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\CalcViewModel\Common\AppResourceProvider.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\Common\Automation\NarratorAnnouncement.h">
<Filter>Common\Automation</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\Common\Automation\NarratorNotifier.h">
<Filter>Common\Automation</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\ApplicationViewModel.h" />
<ClInclude Include="..\CalcViewModel\DateCalculatorViewModel.h" />
<ClInclude Include="..\CalcViewModel\HistoryItemViewModel.h" />
<ClInclude Include="..\CalcViewModel\HistoryViewModel.h" />
<ClInclude Include="..\CalcViewModel\MemoryItemViewModel.h" />
<ClInclude Include="..\CalcViewModel\pch.h" />
<ClInclude Include="..\CalcViewModel\StandardCalculatorViewModel.h" />
<ClInclude Include="..\CalcViewModel\targetver.h" />
<ClInclude Include="..\CalcViewModel\UnitConverterViewModel.h" />
<ClInclude Include="..\CalcViewModel\Common\Utils.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\Common\BitLength.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\Common\CalculatorButtonPressedEventArgs.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\Common\CalculatorButtonUser.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\Common\CalculatorDisplay.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\Common\CopyPasteManager.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\Common\DateCalculator.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\Common\DelegateCommand.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\Common\DisplayExpressionToken.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\Common\EngineResourceProvider.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\Common\ExpressionCommandDeserializer.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\Common\ExpressionCommandSerializer.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\GraphingCalculatorEnums.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\Common\LocalizationService.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\Common\LocalizationSettings.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\Common\LocalizationStringUtil.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\Common\MyVirtualKey.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\Common\NavCategory.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\Common\NetworkManager.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\Common\NumberBase.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\Common\TraceLogger.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\DataLoaders\CurrencyDataLoader.h">
<Filter>DataLoaders</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\DataLoaders\CurrencyHttpClient.h">
<Filter>DataLoaders</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\DataLoaders\DataLoaderMockConstants.h">
<Filter>DataLoaders</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\DataLoaders\ICurrencyHttpClient.h">
<Filter>DataLoaders</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\DataLoaders\UnitConverterDataConstants.h">
<Filter>DataLoaders</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\DataLoaders\UnitConverterDataLoader.h">
<Filter>DataLoaders</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\GraphingCalculator\EquationViewModel.h">
<Filter>GraphingCalculator</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\GraphingCalculator\GraphingCalculatorViewModel.h">
<Filter>GraphingCalculator</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\GraphingCalculator\GraphingSettingsViewModel.h">
<Filter>GraphingCalculator</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\GraphingCalculator\VariableViewModel.h">
<Filter>GraphingCalculator</Filter>
</ClInclude>
<ClInclude Include="..\CalcViewModel\Common\RadixType.h" />
<ClInclude Include="..\CalcViewModel\Common\AlwaysSelectedCollectionView.h">
<Filter>Common</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\CalcViewModel\DataLoaders\DefaultFromToCurrency.json">
<Filter>DataLoaders</Filter>
</None>
</ItemGroup>
</Project>

View file

@ -9,11 +9,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
nuget.config = nuget.config
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Calculator", "Calculator\Calculator.vcxproj", "{9447424A-0E05-4911-BEB8-E0354405F39A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CalcManager", "CalcManager\CalcManager.vcxproj", "{311E866D-8B93-4609-A691-265941FEE101}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CalcViewModel", "CalcViewModel\CalcViewModel.vcxproj", "{90E9761D-9262-4773-942D-CAEAE75D7140}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CalcViewModel", "CalcViewModel\CalcViewModel.vcxproj", "{812D1A7B-B8AC-49E4-8E6D-AF5D59500D56}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CalculatorUnitTests", "CalculatorUnitTests\CalculatorUnitTests.vcxproj", "{D3BAED2C-4B07-4E1D-8807-9D6499450349}"
EndProject
@ -27,6 +25,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GraphControl", "GraphContro
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TraceLogging", "TraceLogging\TraceLogging.vcxproj", "{FC81FF41-02CD-4CD9-9BC5-45A1E39AC6ED}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Calculator", "Calculator\Calculator.csproj", "{3B773403-B0D6-4F9A-948E-512A7A5FB315}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CalcViewModelCopyForUT", "CalcViewModelCopyForUT\CalcViewModelCopyForUT.vcxproj", "{CC9B4FA7-D746-4F52-9401-0AD1B4D6B16D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM
@ -39,30 +41,6 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9447424A-0E05-4911-BEB8-E0354405F39A}.Debug|ARM.ActiveCfg = Debug|ARM
{9447424A-0E05-4911-BEB8-E0354405F39A}.Debug|ARM.Build.0 = Debug|ARM
{9447424A-0E05-4911-BEB8-E0354405F39A}.Debug|ARM.Deploy.0 = Debug|ARM
{9447424A-0E05-4911-BEB8-E0354405F39A}.Debug|ARM64.ActiveCfg = Debug|ARM64
{9447424A-0E05-4911-BEB8-E0354405F39A}.Debug|ARM64.Build.0 = Debug|ARM64
{9447424A-0E05-4911-BEB8-E0354405F39A}.Debug|ARM64.Deploy.0 = Debug|ARM64
{9447424A-0E05-4911-BEB8-E0354405F39A}.Debug|x64.ActiveCfg = Debug|x64
{9447424A-0E05-4911-BEB8-E0354405F39A}.Debug|x64.Build.0 = Debug|x64
{9447424A-0E05-4911-BEB8-E0354405F39A}.Debug|x64.Deploy.0 = Debug|x64
{9447424A-0E05-4911-BEB8-E0354405F39A}.Debug|x86.ActiveCfg = Debug|Win32
{9447424A-0E05-4911-BEB8-E0354405F39A}.Debug|x86.Build.0 = Debug|Win32
{9447424A-0E05-4911-BEB8-E0354405F39A}.Debug|x86.Deploy.0 = Debug|Win32
{9447424A-0E05-4911-BEB8-E0354405F39A}.Release|ARM.ActiveCfg = Release|ARM
{9447424A-0E05-4911-BEB8-E0354405F39A}.Release|ARM.Build.0 = Release|ARM
{9447424A-0E05-4911-BEB8-E0354405F39A}.Release|ARM.Deploy.0 = Release|ARM
{9447424A-0E05-4911-BEB8-E0354405F39A}.Release|ARM64.ActiveCfg = Release|ARM64
{9447424A-0E05-4911-BEB8-E0354405F39A}.Release|ARM64.Build.0 = Release|ARM64
{9447424A-0E05-4911-BEB8-E0354405F39A}.Release|ARM64.Deploy.0 = Release|ARM64
{9447424A-0E05-4911-BEB8-E0354405F39A}.Release|x64.ActiveCfg = Release|x64
{9447424A-0E05-4911-BEB8-E0354405F39A}.Release|x64.Build.0 = Release|x64
{9447424A-0E05-4911-BEB8-E0354405F39A}.Release|x64.Deploy.0 = Release|x64
{9447424A-0E05-4911-BEB8-E0354405F39A}.Release|x86.ActiveCfg = Release|Win32
{9447424A-0E05-4911-BEB8-E0354405F39A}.Release|x86.Build.0 = Release|Win32
{9447424A-0E05-4911-BEB8-E0354405F39A}.Release|x86.Deploy.0 = Release|Win32
{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
@ -79,22 +57,22 @@ Global
{311E866D-8B93-4609-A691-265941FEE101}.Release|x64.Build.0 = Release|x64
{311E866D-8B93-4609-A691-265941FEE101}.Release|x86.ActiveCfg = Release|Win32
{311E866D-8B93-4609-A691-265941FEE101}.Release|x86.Build.0 = Release|Win32
{90E9761D-9262-4773-942D-CAEAE75D7140}.Debug|ARM.ActiveCfg = Debug|ARM
{90E9761D-9262-4773-942D-CAEAE75D7140}.Debug|ARM.Build.0 = Debug|ARM
{90E9761D-9262-4773-942D-CAEAE75D7140}.Debug|ARM64.ActiveCfg = Debug|ARM64
{90E9761D-9262-4773-942D-CAEAE75D7140}.Debug|ARM64.Build.0 = Debug|ARM64
{90E9761D-9262-4773-942D-CAEAE75D7140}.Debug|x64.ActiveCfg = Debug|x64
{90E9761D-9262-4773-942D-CAEAE75D7140}.Debug|x64.Build.0 = Debug|x64
{90E9761D-9262-4773-942D-CAEAE75D7140}.Debug|x86.ActiveCfg = Debug|Win32
{90E9761D-9262-4773-942D-CAEAE75D7140}.Debug|x86.Build.0 = Debug|Win32
{90E9761D-9262-4773-942D-CAEAE75D7140}.Release|ARM.ActiveCfg = Release|ARM
{90E9761D-9262-4773-942D-CAEAE75D7140}.Release|ARM.Build.0 = Release|ARM
{90E9761D-9262-4773-942D-CAEAE75D7140}.Release|ARM64.ActiveCfg = Release|ARM64
{90E9761D-9262-4773-942D-CAEAE75D7140}.Release|ARM64.Build.0 = Release|ARM64
{90E9761D-9262-4773-942D-CAEAE75D7140}.Release|x64.ActiveCfg = Release|x64
{90E9761D-9262-4773-942D-CAEAE75D7140}.Release|x64.Build.0 = Release|x64
{90E9761D-9262-4773-942D-CAEAE75D7140}.Release|x86.ActiveCfg = Release|Win32
{90E9761D-9262-4773-942D-CAEAE75D7140}.Release|x86.Build.0 = Release|Win32
{812D1A7B-B8AC-49E4-8E6D-AF5D59500D56}.Debug|ARM.ActiveCfg = Debug|ARM
{812D1A7B-B8AC-49E4-8E6D-AF5D59500D56}.Debug|ARM.Build.0 = Debug|ARM
{812D1A7B-B8AC-49E4-8E6D-AF5D59500D56}.Debug|ARM64.ActiveCfg = Debug|ARM64
{812D1A7B-B8AC-49E4-8E6D-AF5D59500D56}.Debug|ARM64.Build.0 = Debug|ARM64
{812D1A7B-B8AC-49E4-8E6D-AF5D59500D56}.Debug|x64.ActiveCfg = Debug|x64
{812D1A7B-B8AC-49E4-8E6D-AF5D59500D56}.Debug|x64.Build.0 = Debug|x64
{812D1A7B-B8AC-49E4-8E6D-AF5D59500D56}.Debug|x86.ActiveCfg = Debug|Win32
{812D1A7B-B8AC-49E4-8E6D-AF5D59500D56}.Debug|x86.Build.0 = Debug|Win32
{812D1A7B-B8AC-49E4-8E6D-AF5D59500D56}.Release|ARM.ActiveCfg = Release|ARM
{812D1A7B-B8AC-49E4-8E6D-AF5D59500D56}.Release|ARM.Build.0 = Release|ARM
{812D1A7B-B8AC-49E4-8E6D-AF5D59500D56}.Release|ARM64.ActiveCfg = Release|ARM64
{812D1A7B-B8AC-49E4-8E6D-AF5D59500D56}.Release|ARM64.Build.0 = Release|ARM64
{812D1A7B-B8AC-49E4-8E6D-AF5D59500D56}.Release|x64.ActiveCfg = Release|x64
{812D1A7B-B8AC-49E4-8E6D-AF5D59500D56}.Release|x64.Build.0 = Release|x64
{812D1A7B-B8AC-49E4-8E6D-AF5D59500D56}.Release|x86.ActiveCfg = Release|Win32
{812D1A7B-B8AC-49E4-8E6D-AF5D59500D56}.Release|x86.Build.0 = Release|Win32
{D3BAED2C-4B07-4E1D-8807-9D6499450349}.Debug|ARM.ActiveCfg = Debug|ARM
{D3BAED2C-4B07-4E1D-8807-9D6499450349}.Debug|ARM64.ActiveCfg = Debug|ARM64
{D3BAED2C-4B07-4E1D-8807-9D6499450349}.Debug|x64.ActiveCfg = Debug|x64
@ -191,6 +169,44 @@ 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
{CC9B4FA7-D746-4F52-9401-0AD1B4D6B16D}.Debug|x64.ActiveCfg = Debug|x64
{CC9B4FA7-D746-4F52-9401-0AD1B4D6B16D}.Debug|x64.Build.0 = Debug|x64
{CC9B4FA7-D746-4F52-9401-0AD1B4D6B16D}.Debug|x86.ActiveCfg = Debug|Win32
{CC9B4FA7-D746-4F52-9401-0AD1B4D6B16D}.Debug|x86.Build.0 = Debug|Win32
{CC9B4FA7-D746-4F52-9401-0AD1B4D6B16D}.Release|ARM.ActiveCfg = Release|ARM
{CC9B4FA7-D746-4F52-9401-0AD1B4D6B16D}.Release|ARM.Build.0 = Release|ARM
{CC9B4FA7-D746-4F52-9401-0AD1B4D6B16D}.Release|ARM64.ActiveCfg = Release|ARM64
{CC9B4FA7-D746-4F52-9401-0AD1B4D6B16D}.Release|x64.ActiveCfg = Release|x64
{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
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View file

@ -82,11 +82,13 @@
FontSize="{ThemeResource BodyFontSize}"
TextWrapping="Wrap">
<Paragraph>
<Run x:Name="ContributeRunBeforeLink"/><Hyperlink NavigateUri="https://go.microsoft.com/fwlink/?linkid=2099939"
<Run x:Name="ContributeRunBeforeLink"/>
<Hyperlink NavigateUri="https://go.microsoft.com/fwlink/?linkid=2099939"
TextDecorations="None"
ToolTipService.ToolTip="https://go.microsoft.com/fwlink/?linkid=2099939">
<Run x:Name="ContributeRunLink"/>
</Hyperlink><Run x:Name="ContributeRunAfterLink"/>
</Hyperlink>
<Run x:Name="ContributeRunAfterLink"/>
</Paragraph>
</RichTextBlock>
</Grid>

View file

@ -1,92 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "pch.h"
#include "AboutFlyout.xaml.h"
#include "CalcViewModel/Common/AppResourceProvider.h"
#include "CalcViewModel/Common/LocalizationService.h"
#include "CalcViewModel/Common/LocalizationStringUtil.h"
#include "CalcViewModel/Common/TraceLogger.h"
using namespace std;
using namespace CalculatorApp;
using namespace CalculatorApp::Common;
using namespace Platform;
using namespace Windows::ApplicationModel;
using namespace Windows::Foundation;
using namespace Windows::System;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::UI::Xaml::Controls::Primitives;
using namespace Windows::UI::Xaml::Data;
#ifndef BUILD_YEAR
#define BUILD_YEAR 2021
#endif
AboutFlyout::AboutFlyout()
{
auto locService = LocalizationService::GetInstance();
auto resourceLoader = AppResourceProvider::GetInstance();
InitializeComponent();
Language = locService->GetLanguage();
this->SetVersionString();
Header->Text = resourceLoader->GetResourceString("AboutButton/Content");
auto copyrightText =
LocalizationStringUtil::GetLocalizedString(resourceLoader->GetResourceString("AboutControlCopyright"), StringReference(to_wstring(BUILD_YEAR).c_str()));
AboutControlCopyrightRun->Text = copyrightText;
InitializeContributeTextBlock();
}
void AboutFlyout::FeedbackButton_Click(_In_ Object ^ sender, _In_ RoutedEventArgs ^ e)
{
PackageVersion version = Package::Current->Id->Version;
String ^ versionNumber = ref new String(L"Version ");
versionNumber = versionNumber + version.Major + "." + version.Minor + "." + version.Build + "." + version.Revision;
Launcher::LaunchUriAsync(ref new Uri("windows-feedback:?contextid=130&metadata=%7B%22Metadata%22:[%7B%22AppBuild%22:%22" + versionNumber + "%22%7D]%7D"));
}
void AboutFlyout::SetVersionString()
{
PackageVersion version = Package::Current->Id->Version;
String ^ appName = AppResourceProvider::GetInstance()->GetResourceString(L"AppName");
AboutFlyoutVersion->Text = appName + L" " + version.Major + L"." + version.Minor + L"." + version.Build + L"." + version.Revision;
}
void AboutFlyout::SetDefaultFocus()
{
AboutFlyoutEULA->Focus(::FocusState::Programmatic);
}
void AboutFlyout::InitializeContributeTextBlock()
{
auto resProvider = AppResourceProvider::GetInstance();
std::wstring contributeHyperlinkText = resProvider->GetResourceString(L"AboutFlyoutContribute")->Data();
// The resource string has the 'GitHub' hyperlink wrapped with '%HL%'.
// Break the string and assign pieces appropriately.
static const std::wstring delimiter{ L"%HL%" };
static const size_t delimiterLength{ delimiter.length() };
// Find the delimiters.
size_t firstSplitPosition = contributeHyperlinkText.find(delimiter, 0);
assert(firstSplitPosition != std::wstring::npos);
size_t secondSplitPosition = contributeHyperlinkText.find(delimiter, firstSplitPosition + 1);
assert(secondSplitPosition != std::wstring::npos);
size_t hyperlinkTextLength = secondSplitPosition - (firstSplitPosition + delimiterLength);
// Assign pieces.
auto contributeTextBeforeHyperlink = ref new String(contributeHyperlinkText.substr(0, firstSplitPosition).c_str());
auto contributeTextLink = ref new String(contributeHyperlinkText.substr(firstSplitPosition + delimiterLength, hyperlinkTextLength).c_str());
auto contributeTextAfterHyperlink = ref new String(contributeHyperlinkText.substr(secondSplitPosition + delimiterLength).c_str());
ContributeRunBeforeLink->Text = contributeTextBeforeHyperlink;
ContributeRunLink->Text = contributeTextLink;
ContributeRunAfterLink->Text = contributeTextAfterHyperlink;
}

View file

@ -0,0 +1,86 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using CalculatorApp.ViewModel.Common;
using System;
using System.Diagnostics;
using Windows.ApplicationModel;
using Windows.System;
using Windows.UI.Xaml;
namespace CalculatorApp
{
public sealed partial class AboutFlyout
{
// CSHARP_MIGRATION: TODO:
// BUILD_YEAR was a C++/CX macro and may update the value from the pipeline
private const string BUILD_YEAR = "2021";
public AboutFlyout()
{
var locService = LocalizationService.GetInstance();
var resourceLoader = AppResourceProvider.GetInstance();
InitializeComponent();
Language = locService.GetLanguage();
SetVersionString();
Header.Text = resourceLoader.GetResourceString("AboutButton/Content");
var copyrightText =
LocalizationStringUtil.GetLocalizedString(resourceLoader.GetResourceString("AboutControlCopyright"), BUILD_YEAR);
AboutControlCopyrightRun.Text = copyrightText;
InitializeContributeTextBlock();
}
public void SetDefaultFocus()
{
AboutFlyoutEULA.Focus(FocusState.Programmatic);
}
private void FeedbackButton_Click(object sender, RoutedEventArgs e)
{
PackageVersion version = Package.Current.Id.Version;
string versionNumber = "Version ";
versionNumber = versionNumber + version.Major + "." + version.Minor + "." + version.Build + "." + version.Revision;
_ = Launcher.LaunchUriAsync(new Uri("windows-feedback:?contextid=130&metadata=%7B%22Metadata%22:[%7B%22AppBuild%22:%22" + versionNumber + "%22%7D]%7D"));
}
private void SetVersionString()
{
PackageVersion version = Package.Current.Id.Version;
string appName = AppResourceProvider.GetInstance().GetResourceString("AppName");
AboutFlyoutVersion.Text = appName + " " + version.Major + "." + version.Minor + "." + version.Build + "." + version.Revision;
}
private void InitializeContributeTextBlock()
{
var resProvider = AppResourceProvider.GetInstance();
string contributeHyperlinkText = resProvider.GetResourceString("AboutFlyoutContribute");
// The resource string has the 'GitHub' hyperlink wrapped with '%HL%'.
// Break the string and assign pieces appropriately.
string delimiter = "%HL%";
int delimiterLength = delimiter.Length;
// Find the delimiters.
int firstSplitPosition = contributeHyperlinkText.IndexOf(delimiter, 0);
Debug.Assert(firstSplitPosition != -1);
int secondSplitPosition = contributeHyperlinkText.IndexOf(delimiter, firstSplitPosition + 1);
Debug.Assert(secondSplitPosition != -1);
int hyperlinkTextLength = secondSplitPosition - (firstSplitPosition + delimiterLength);
// Assign pieces.
var contributeTextBeforeHyperlink = contributeHyperlinkText.Substring(0, firstSplitPosition);
var contributeTextLink = contributeHyperlinkText.Substring(firstSplitPosition + delimiterLength, hyperlinkTextLength);
var contributeTextAfterHyperlink = contributeHyperlinkText.Substring(secondSplitPosition + delimiterLength);
ContributeRunBeforeLink.Text = contributeTextBeforeHyperlink;
ContributeRunLink.Text = contributeTextLink;
ContributeRunAfterLink.Text = contributeTextAfterHyperlink;
}
}
}

View file

@ -1,23 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once
#include "AboutFlyout.g.h"
namespace CalculatorApp
{
public
ref class AboutFlyout sealed
{
public:
AboutFlyout();
void SetDefaultFocus();
private:
void FeedbackButton_Click(_In_ Platform::Object ^ sender, _In_ Windows::UI::Xaml::RoutedEventArgs ^ e);
void SetVersionString();
void InitializeContributeTextBlock();
};
} /* namespace CalculatorApp */

View file

@ -1,439 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//
// App.xaml.cpp
// Implementation of the App class.
//
#include "pch.h"
#include "App.xaml.h"
#include "CalcViewModel/Common/TraceLogger.h"
#include "CalcViewModel/Common/Automation/NarratorNotifier.h"
#include "CalcViewModel/Common/AppResourceProvider.h"
#include "CalcViewModel/Common/LocalizationSettings.h"
#include "Views/MainPage.xaml.h"
using namespace CalculatorApp;
using namespace CalculatorApp::Common;
using namespace CalculatorApp::Common::Automation;
using namespace Concurrency;
using namespace Microsoft::WRL;
using namespace Platform;
using namespace Windows::ApplicationModel;
using namespace Windows::ApplicationModel::Activation;
using namespace Windows::ApplicationModel::Core;
using namespace Windows::ApplicationModel::Resources;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
using namespace Windows::Storage;
using namespace Windows::System;
using namespace Windows::UI::Core;
using namespace Windows::UI::Popups;
using namespace Windows::UI::StartScreen;
using namespace Windows::UI::ViewManagement;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::UI::Xaml::Controls::Primitives;
using namespace Windows::UI::Xaml::Data;
using namespace Windows::UI::Xaml::Input;
using namespace Windows::UI::Xaml::Interop;
using namespace Windows::UI::Xaml::Media;
using namespace Windows::UI::Xaml::Media::Animation;
using namespace Windows::UI::Xaml::Navigation;
using namespace Windows::ApplicationModel::Activation;
namespace CalculatorApp
{
namespace ApplicationResourceKeys
{
StringReference AppMinWindowHeight(L"AppMinWindowHeight");
StringReference AppMinWindowWidth(L"AppMinWindowWidth");
}
}
/// <summary>
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
/// </summary>
App::App()
{
InitializeComponent();
m_preLaunched = false;
RegisterDependencyProperties();
// TODO: MSFT 14645325: Set this directly from XAML.
// Currently this is bugged so the property is only respected from code-behind.
this->HighContrastAdjustment = ApplicationHighContrastAdjustment::None;
this->Suspending += ref new SuspendingEventHandler(this, &App::OnSuspending);
#if _DEBUG
this->DebugSettings->IsBindingTracingEnabled = true;
this->DebugSettings->BindingFailed += ref new BindingFailedEventHandler([](_In_ Object ^ /*sender*/, _In_ BindingFailedEventArgs ^ e) {
if (IsDebuggerPresent())
{
::Platform::String ^ errorMessage = e->Message;
__debugbreak();
}
});
#endif
}
void App::AddWindowToMap(_In_ WindowFrameService ^ frameService)
{
reader_writer_lock::scoped_lock lock(m_windowsMapLock);
m_secondaryWindows[frameService->GetViewId()] = frameService;
TraceLogger::GetInstance()->UpdateWindowCount(m_secondaryWindows.size());
}
WindowFrameService ^ App::GetWindowFromMap(int viewId)
{
reader_writer_lock::scoped_lock_read lock(m_windowsMapLock);
auto windowMapEntry = m_secondaryWindows.find(viewId);
if (windowMapEntry != m_secondaryWindows.end())
{
return windowMapEntry->second;
}
return nullptr;
}
void App::RemoveWindowFromMap(int viewId)
{
reader_writer_lock::scoped_lock lock(m_windowsMapLock);
auto iter = m_secondaryWindows.find(viewId);
assert(iter != m_secondaryWindows.end() && "Window does not exist in the list");
m_secondaryWindows.erase(viewId);
}
void App::RemoveWindow(_In_ WindowFrameService ^ frameService)
{
// Shell does not allow killing the main window.
if (m_mainViewId != frameService->GetViewId())
{
HandleViewReleaseAndRemoveWindowFromMap(frameService);
}
}
task<void> App::HandleViewReleaseAndRemoveWindowFromMap(_In_ WindowFrameService ^ frameService)
{
WeakReference weak(this);
// Unregister the event handler of the Main Page
auto frame = safe_cast<Frame ^>(Window::Current->Content);
auto mainPage = safe_cast<MainPage ^>(frame->Content);
mainPage->UnregisterEventHandlers();
return frameService->HandleViewRelease().then(
[weak, frameService]() {
auto that = weak.Resolve<App>();
that->RemoveWindowFromMap(frameService->GetViewId());
},
task_continuation_context::use_arbitrary());
}
#pragma optimize("", off) // Turn off optimizations to work around coroutine optimization bug
task<void> App::SetupJumpList()
{
try
{
auto calculatorOptions = NavCategoryGroup::CreateCalculatorCategory();
auto jumpList = co_await JumpList::LoadCurrentAsync();
jumpList->SystemGroupKind = JumpListSystemGroupKind::None;
jumpList->Items->Clear();
for (NavCategory ^ option : calculatorOptions->Categories)
{
if (!option->IsEnabled)
{
continue;
}
ViewMode mode = option->Mode;
auto item = JumpListItem::CreateWithArguments(((int)mode).ToString(), L"ms-resource:///Resources/" + NavCategory::GetNameResourceKey(mode));
item->Description = L"ms-resource:///Resources/" + NavCategory::GetNameResourceKey(mode);
item->Logo = ref new Uri("ms-appx:///Assets/" + mode.ToString() + ".png");
jumpList->Items->Append(item);
}
co_await jumpList->SaveAsync();
}
catch (...)
{
}
};
#pragma optimize("", on)
void App::RemoveSecondaryWindow(_In_ WindowFrameService ^ frameService)
{
// Shell does not allow killing the main window.
if (m_mainViewId != frameService->GetViewId())
{
RemoveWindowFromMap(frameService->GetViewId());
}
}
Frame ^ App::CreateFrame()
{
auto frame = ref new Frame();
frame->FlowDirection = LocalizationService::GetInstance()->GetFlowDirection();
return frame;
}
/// <summary>
/// Invoked when the application is launched normally by the end user. Other entry points
/// will be used when the application is launched to open a specific file, to display
/// search results, and so forth.
/// </summary>
/// <param name="e">Details about the launch request and process.</param>
void App::OnLaunched(LaunchActivatedEventArgs ^ args)
{
if (args->PrelaunchActivated)
{
// If the app got pre-launch activated, then save that state in a flag
m_preLaunched = true;
}
NavCategory::InitializeCategoryManifest(args->User);
OnAppLaunch(args, args->Arguments);
}
void App::OnAppLaunch(IActivatedEventArgs ^ args, String ^ argument)
{
// Uncomment the following lines to display frame-rate and per-frame CPU usage info.
//#if _DEBUG
// if (IsDebuggerPresent())
// {
// DebugSettings->EnableFrameRateCounter = true;
// }
//#endif
args->SplashScreen->Dismissed += ref new TypedEventHandler<SplashScreen ^, Object ^>(this, &App::DismissedEventHandler);
auto rootFrame = dynamic_cast<Frame ^>(Window::Current->Content);
WeakReference weak(this);
float minWindowWidth = static_cast<float>(static_cast<double>(this->Resources->Lookup(ApplicationResourceKeys::AppMinWindowWidth)));
float minWindowHeight = static_cast<float>(static_cast<double>(this->Resources->Lookup(ApplicationResourceKeys::AppMinWindowHeight)));
Size minWindowSize = SizeHelper::FromDimensions(minWindowWidth, minWindowHeight);
ApplicationView ^ appView = ApplicationView::GetForCurrentView();
ApplicationDataContainer ^ localSettings = ApplicationData::Current->LocalSettings;
// For very first launch, set the size of the calc as size of the default standard mode
if (!localSettings->Values->HasKey(L"VeryFirstLaunch"))
{
localSettings->Values->Insert(ref new String(L"VeryFirstLaunch"), false);
appView->SetPreferredMinSize(minWindowSize);
appView->TryResizeView(minWindowSize);
}
else
{
appView->PreferredLaunchWindowingMode = ApplicationViewWindowingMode::Auto;
}
// Do not repeat app initialization when the Window already has content,
// just ensure that the window is active
if (rootFrame == nullptr)
{
if (!Windows::Foundation::Metadata::ApiInformation::IsTypePresent("Windows.Phone.UI.Input.HardwareButtons")) // PC Family
{
// Disable the system view activation policy during the first launch of the app
// only for PC family devices and not for phone family devices
try
{
ApplicationViewSwitcher::DisableSystemViewActivationPolicy();
}
catch (Exception ^ e)
{
// Log that DisableSystemViewActionPolicy didn't work
}
}
// Create a Frame to act as the navigation context
rootFrame = App::CreateFrame();
// When the navigation stack isn't restored navigate to the first page,
// configuring the new page by passing required information as a navigation
// parameter
if (!rootFrame->Navigate(MainPage::typeid, argument))
{
// We couldn't navigate to the main page, kill the app so we have a good
// stack to debug
throw std::bad_exception();
}
SetMinWindowSizeAndActivate(rootFrame, minWindowSize);
m_mainViewId = ApplicationView::GetForCurrentView()->Id;
AddWindowToMap(WindowFrameService::CreateNewWindowFrameService(rootFrame, false, weak));
}
else
{
// For first launch, LaunchStart is logged in constructor, this is for subsequent launches.
// !Phone check is required because even in continuum mode user interaction mode is Mouse not Touch
if ((UIViewSettings::GetForCurrentView()->UserInteractionMode == UserInteractionMode::Mouse)
&& (!Windows::Foundation::Metadata::ApiInformation::IsTypePresent("Windows.Phone.UI.Input.HardwareButtons")))
{
// If the pre-launch hasn't happened then allow for the new window/view creation
if (!m_preLaunched)
{
auto newCoreAppView = CoreApplication::CreateNewView();
newCoreAppView->Dispatcher->RunAsync(
CoreDispatcherPriority::Normal, ref new DispatchedHandler([args, argument, minWindowSize, weak]() {
auto that = weak.Resolve<App>();
if (that != nullptr)
{
auto rootFrame = App::CreateFrame();
SetMinWindowSizeAndActivate(rootFrame, minWindowSize);
if (!rootFrame->Navigate(MainPage::typeid, argument))
{
// We couldn't navigate to the main page, kill the app so we have a good
// stack to debug
throw std::bad_exception();
}
auto frameService = WindowFrameService::CreateNewWindowFrameService(rootFrame, true, weak);
that->AddWindowToMap(frameService);
auto dispatcher = CoreWindow::GetForCurrentThread()->Dispatcher;
auto safeFrameServiceCreation = std::make_shared<SafeFrameWindowCreation>(frameService, that);
int newWindowId = ApplicationView::GetApplicationViewIdForWindow(CoreWindow::GetForCurrentThread());
ActivationViewSwitcher ^ activationViewSwitcher;
auto activateEventArgs = dynamic_cast<IViewSwitcherProvider ^>(args);
if (activateEventArgs != nullptr)
{
activationViewSwitcher = activateEventArgs->ViewSwitcher;
}
if (activationViewSwitcher != nullptr)
{
activationViewSwitcher->ShowAsStandaloneAsync(newWindowId, ViewSizePreference::Default);
safeFrameServiceCreation->SetOperationSuccess(true);
}
else
{
auto activatedEventArgs = dynamic_cast<IApplicationViewActivatedEventArgs ^>(args);
if ((activatedEventArgs != nullptr) && (activatedEventArgs->CurrentlyShownApplicationViewId != 0))
{
create_task(ApplicationViewSwitcher::TryShowAsStandaloneAsync(
frameService->GetViewId(),
ViewSizePreference::Default,
activatedEventArgs->CurrentlyShownApplicationViewId,
ViewSizePreference::Default))
.then(
[safeFrameServiceCreation](bool viewShown) {
// SafeFrameServiceCreation is used to automatically remove the frame
// from the list of frames if something goes bad.
safeFrameServiceCreation->SetOperationSuccess(viewShown);
},
task_continuation_context::use_current());
}
}
}
}));
}
else
{
ActivationViewSwitcher ^ activationViewSwitcher;
auto activateEventArgs = dynamic_cast<IViewSwitcherProvider ^>(args);
if (activateEventArgs != nullptr)
{
activationViewSwitcher = activateEventArgs->ViewSwitcher;
}
if (activationViewSwitcher != nullptr)
{
activationViewSwitcher->ShowAsStandaloneAsync(
ApplicationView::GetApplicationViewIdForWindow(CoreWindow::GetForCurrentThread()), ViewSizePreference::Default);
}
else
{
TraceLogger::GetInstance()->LogError(ViewMode::None, L"App::OnAppLaunch", L"Null_ActivationViewSwitcher");
}
}
// Set the preLaunched flag to false
m_preLaunched = false;
}
else // for touch devices
{
if (rootFrame->Content == nullptr)
{
// When the navigation stack isn't restored navigate to the first page,
// configuring the new page by passing required information as a navigation
// parameter
if (!rootFrame->Navigate(MainPage::typeid, argument))
{
// We couldn't navigate to the main page,
// kill the app so we have a good stack to debug
throw std::bad_exception();
}
}
if (ApplicationView::GetForCurrentView()->ViewMode != ApplicationViewMode::CompactOverlay)
{
if (!Windows::Foundation::Metadata::ApiInformation::IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
{
// for tablet mode: since system view activation policy is disabled so do ShowAsStandaloneAsync if activationViewSwitcher exists in
// activationArgs
ActivationViewSwitcher ^ activationViewSwitcher;
auto activateEventArgs = dynamic_cast<IViewSwitcherProvider ^>(args);
if (activateEventArgs != nullptr)
{
activationViewSwitcher = activateEventArgs->ViewSwitcher;
}
if (activationViewSwitcher != nullptr)
{
auto viewId = safe_cast<IApplicationViewActivatedEventArgs ^>(args)->CurrentlyShownApplicationViewId;
if (viewId != 0)
{
activationViewSwitcher->ShowAsStandaloneAsync(viewId);
}
}
}
// Ensure the current window is active
Window::Current->Activate();
}
}
}
}
void App::SetMinWindowSizeAndActivate(Frame ^ rootFrame, Size minWindowSize)
{
// SetPreferredMinSize should always be called before Window::Activate
ApplicationView ^ appView = ApplicationView::GetForCurrentView();
appView->SetPreferredMinSize(minWindowSize);
// Place the frame in the current Window
Window::Current->Content = rootFrame;
Window::Current->Activate();
}
void App::RegisterDependencyProperties()
{
NarratorNotifier::RegisterDependencyProperties();
}
void App::OnActivated(IActivatedEventArgs ^ args)
{
if (args->Kind == ActivationKind::Protocol)
{
// We currently don't pass the uri as an argument,
// and handle any protocol launch as a normal app launch.
OnAppLaunch(args, nullptr);
}
}
void CalculatorApp::App::OnSuspending(Object ^ sender, SuspendingEventArgs ^ args)
{
TraceLogger::GetInstance()->LogButtonUsage();
}
void App::DismissedEventHandler(SplashScreen ^ sender, Object ^ e)
{
SetupJumpList();
}

504
src/Calculator/App.xaml.cs Normal file
View file

@ -0,0 +1,504 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//
// App.xaml.h
// Declaration of the App class.
//
using CalculatorApp.ViewModel.Common;
using CalculatorApp.ViewModel.Common.Automation;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.ApplicationModel.Core;
using Windows.Foundation;
using Windows.Storage;
using Windows.UI.Core;
using Windows.UI.StartScreen;
using Windows.UI.ViewManagement;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
namespace CalculatorApp
{
namespace ApplicationResourceKeys
{
static public partial class Globals
{
public static readonly string AppMinWindowHeight = "AppMinWindowHeight";
public static readonly string AppMinWindowWidth = "AppMinWindowWidth";
}
}
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
sealed partial class App
{
/// <summary>
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
/// </summary>
public App()
{
InitializeComponent();
m_preLaunched = false;
RegisterDependencyProperties();
// TODO: MSFT 14645325: Set this directly from XAML.
// Currently this is bugged so the property is only respected from code-behind.
HighContrastAdjustment = ApplicationHighContrastAdjustment.None;
Suspending += OnSuspending;
#if DEBUG
DebugSettings.IsBindingTracingEnabled = true;
DebugSettings.BindingFailed += (sender, args) =>
{
if (Debugger.IsAttached)
{
string errorMessage = args.Message;
Debugger.Break();
}
};
#endif
}
/// <summary>
/// Invoked when the application is launched normally by the end user. Other entry points
/// will be used when the application is launched to open a specific file, to display
/// search results, and so forth.
/// </summary>
/// <param name="e">Details about the launch request and process.</param>
protected override void OnLaunched(LaunchActivatedEventArgs args)
{
if (args.PrelaunchActivated)
{
// If the app got pre-launch activated, then save that state in a flag
m_preLaunched = true;
}
NavCategory.InitializeCategoryManifest(args.User);
OnAppLaunch(args, args.Arguments);
}
protected override void OnActivated(IActivatedEventArgs args)
{
if (args.Kind == ActivationKind.Protocol)
{
// We currently don't pass the uri as an argument,
// and handle any protocol launch as a normal app launch.
OnAppLaunch(args, null);
}
}
internal void RemoveWindow(WindowFrameService frameService)
{
// Shell does not allow killing the main window.
if (m_mainViewId != frameService.GetViewId())
{
_ = HandleViewReleaseAndRemoveWindowFromMap(frameService);
}
}
internal void RemoveSecondaryWindow(WindowFrameService frameService)
{
// Shell does not allow killing the main window.
if (m_mainViewId != frameService.GetViewId())
{
RemoveWindowFromMap(frameService.GetViewId());
}
}
private static Frame CreateFrame()
{
var frame = new Frame();
frame.FlowDirection = LocalizationService.GetInstance().GetFlowDirection();
return frame;
}
private static void SetMinWindowSizeAndActivate(Frame rootFrame, Size minWindowSize)
{
// SetPreferredMinSize should always be called before Window.Activate
ApplicationView appView = ApplicationView.GetForCurrentView();
appView.SetPreferredMinSize(minWindowSize);
// Place the frame in the current Window
Window.Current.Content = rootFrame;
Window.Current.Activate();
}
private void OnAppLaunch(IActivatedEventArgs args, string argument)
{
// Uncomment the following lines to display frame-rate and per-frame CPU usage info.
//#if _DEBUG
// if (IsDebuggerPresent())
// {
// DebugSettings->EnableFrameRateCounter = true;
// }
//#endif
args.SplashScreen.Dismissed += DismissedEventHandler;
var rootFrame = (Window.Current.Content as Frame);
WeakReference weak = new WeakReference(this);
float minWindowWidth = (float)((double)Resources[ApplicationResourceKeys.Globals.AppMinWindowWidth]);
float minWindowHeight = (float)((double)Resources[ApplicationResourceKeys.Globals.AppMinWindowHeight]);
Size minWindowSize = SizeHelper.FromDimensions(minWindowWidth, minWindowHeight);
ApplicationView appView = ApplicationView.GetForCurrentView();
ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings;
// For very first launch, set the size of the calc as size of the default standard mode
if (!localSettings.Values.ContainsKey("VeryFirstLaunch"))
{
localSettings.Values["VeryFirstLaunch"] = false;
appView.SetPreferredMinSize(minWindowSize);
appView.TryResizeView(minWindowSize);
}
else
{
ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.Auto;
}
// Do not repeat app initialization when the Window already has content,
// just ensure that the window is active
if (rootFrame == null)
{
if (!Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons")) // PC Family
{
// Disable the system view activation policy during the first launch of the app
// only for PC family devices and not for phone family devices
try
{
ApplicationViewSwitcher.DisableSystemViewActivationPolicy();
}
catch (Exception)
{
// Log that DisableSystemViewActionPolicy didn't work
}
}
// Create a Frame to act as the navigation context
rootFrame = App.CreateFrame();
// When the navigation stack isn't restored navigate to the first page,
// configuring the new page by passing required information as a navigation
// parameter
if (!rootFrame.Navigate(typeof(MainPage), argument))
{
// We couldn't navigate to the main page, kill the app so we have a good
// stack to debug
throw new SystemException();
}
SetMinWindowSizeAndActivate(rootFrame, minWindowSize);
m_mainViewId = ApplicationView.GetForCurrentView().Id;
AddWindowToMap(WindowFrameService.CreateNewWindowFrameService(rootFrame, false, weak));
}
else
{
// For first launch, LaunchStart is logged in constructor, this is for subsequent launches.
// !Phone check is required because even in continuum mode user interaction mode is Mouse not Touch
if ((UIViewSettings.GetForCurrentView().UserInteractionMode == UserInteractionMode.Mouse)
&& (!Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons")))
{
// If the pre-launch hasn't happened then allow for the new window/view creation
if (!m_preLaunched)
{
var newCoreAppView = CoreApplication.CreateNewView();
_ = newCoreAppView.Dispatcher.RunAsync(
CoreDispatcherPriority.Normal, async () =>
{
var that = weak.Target as App;
if (that != null)
{
var newRootFrame = App.CreateFrame();
SetMinWindowSizeAndActivate(newRootFrame, minWindowSize);
if (!newRootFrame.Navigate(typeof(MainPage), argument))
{
// We couldn't navigate to the main page, kill the app so we have a good
// stack to debug
throw new SystemException();
}
var frameService = WindowFrameService.CreateNewWindowFrameService(newRootFrame, true, weak);
that.AddWindowToMap(frameService);
var dispatcher = CoreWindow.GetForCurrentThread().Dispatcher;
// CSHARP_MIGRATION_ANNOTATION:
// class SafeFrameWindowCreation is being interpreted into a IDisposable class
// in order to enhance its RAII capability that was written in C++/CX
using (var safeFrameServiceCreation = new SafeFrameWindowCreation(frameService, that))
{
int newWindowId = ApplicationView.GetApplicationViewIdForWindow(CoreWindow.GetForCurrentThread());
ActivationViewSwitcher activationViewSwitcher = null;
var activateEventArgs = (args as IViewSwitcherProvider);
if (activateEventArgs != null)
{
activationViewSwitcher = activateEventArgs.ViewSwitcher;
}
if (activationViewSwitcher != null)
{
_ = activationViewSwitcher.ShowAsStandaloneAsync(newWindowId, ViewSizePreference.Default);
safeFrameServiceCreation.SetOperationSuccess(true);
}
else
{
var activatedEventArgs = (args as IApplicationViewActivatedEventArgs);
if ((activatedEventArgs != null) && (activatedEventArgs.CurrentlyShownApplicationViewId != 0))
{
// CSHARP_MIGRATION_ANNOTATION:
// here we don't use ContinueWith() to interpret origin code because we would like to
// pursue the design of class SafeFrameWindowCreate whichi was using RAII to ensure
// some states get handled properly when its instance is being destructed.
//
// To achieve that, SafeFrameWindowCreate has been reinterpreted using IDisposable
// pattern, which forces we use below way to keep async works being controlled within
// a same code block.
var viewShown = await ApplicationViewSwitcher.TryShowAsStandaloneAsync(
frameService.GetViewId(),
ViewSizePreference.Default,
activatedEventArgs.CurrentlyShownApplicationViewId,
ViewSizePreference.Default);
// SafeFrameServiceCreation is used to automatically remove the frame
// from the list of frames if something goes bad.
safeFrameServiceCreation.SetOperationSuccess(viewShown);
}
}
}
}
});
}
else
{
ActivationViewSwitcher activationViewSwitcher = null;
var activateEventArgs = (args as IViewSwitcherProvider);
if (activateEventArgs != null)
{
activationViewSwitcher = activateEventArgs.ViewSwitcher;
}
if (activationViewSwitcher != null)
{
_ = activationViewSwitcher.ShowAsStandaloneAsync(
ApplicationView.GetApplicationViewIdForWindow(CoreWindow.GetForCurrentThread()), ViewSizePreference.Default);
}
else
{
TraceLogger.GetInstance().LogError(ViewMode.None, "App.OnAppLaunch", "Null_ActivationViewSwitcher");
}
}
// Set the preLaunched flag to false
m_preLaunched = false;
}
else // for touch devices
{
if (rootFrame.Content == null)
{
// When the navigation stack isn't restored navigate to the first page,
// configuring the new page by passing required information as a navigation
// parameter
if (!rootFrame.Navigate(typeof(MainPage), argument))
{
// We couldn't navigate to the main page,
// kill the app so we have a good stack to debug
throw new SystemException();
}
}
if (ApplicationView.GetForCurrentView().ViewMode != ApplicationViewMode.CompactOverlay)
{
if (!Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
{
// for tablet mode: since system view activation policy is disabled so do ShowAsStandaloneAsync if activationViewSwitcher exists in
// activationArgs
ActivationViewSwitcher activationViewSwitcher = null;
var activateEventArgs = (args as IViewSwitcherProvider);
if (activateEventArgs != null)
{
activationViewSwitcher = activateEventArgs.ViewSwitcher;
}
if (activationViewSwitcher != null)
{
var viewId = (args as IApplicationViewActivatedEventArgs).CurrentlyShownApplicationViewId;
if (viewId != 0)
{
_ = activationViewSwitcher.ShowAsStandaloneAsync(viewId);
}
}
}
// Ensure the current window is active
Window.Current.Activate();
}
}
}
}
private void DismissedEventHandler(SplashScreen sender, object e)
{
_ = SetupJumpList();
}
private void RegisterDependencyProperties()
{
NarratorNotifier.RegisterDependencyProperties();
}
private void OnSuspending(object sender, SuspendingEventArgs args)
{
TraceLogger.GetInstance().LogButtonUsage();
}
private sealed class SafeFrameWindowCreation : IDisposable
{
public SafeFrameWindowCreation(WindowFrameService frameService, App parent)
{
m_frameService = frameService;
m_frameOpenedInWindow = false;
m_parent = parent;
}
public void SetOperationSuccess(bool success)
{
m_frameOpenedInWindow = success;
}
public void Dispose()
{
if (!m_frameOpenedInWindow)
{
// Close the window as the navigation to the window didn't succeed
// and this is not visible to the user.
m_parent.RemoveWindowFromMap(m_frameService.GetViewId());
}
GC.SuppressFinalize(this);
}
~SafeFrameWindowCreation()
{
Dispose();
}
private WindowFrameService m_frameService;
private bool m_frameOpenedInWindow;
private App m_parent;
};
private async Task SetupJumpList()
{
try
{
var calculatorOptions = NavCategoryGroup.CreateCalculatorCategory();
var jumpList = await JumpList.LoadCurrentAsync();
jumpList.SystemGroupKind = JumpListSystemGroupKind.None;
jumpList.Items.Clear();
foreach (NavCategory option in calculatorOptions.Categories)
{
if (!option.IsEnabled)
{
continue;
}
ViewMode mode = option.Mode;
var item = JumpListItem.CreateWithArguments(((int)mode).ToString(), "ms-resource:///Resources/" + NavCategory.GetNameResourceKey(mode));
item.Description = "ms-resource:///Resources/" + NavCategory.GetNameResourceKey(mode);
item.Logo = new Uri("ms-appx:///Assets/" + mode.ToString() + ".png");
jumpList.Items.Add(item);
}
await jumpList.SaveAsync();
}
catch
{
}
}
private async Task HandleViewReleaseAndRemoveWindowFromMap(WindowFrameService frameService)
{
WeakReference weak = new WeakReference(this);
// Unregister the event handler of the Main Page
var frame = (Window.Current.Content as Frame);
var mainPage = (frame.Content as MainPage);
mainPage.UnregisterEventHandlers();
await frameService.HandleViewRelease();
await Task.Run(() =>
{
var that = weak.Target as App;
that.RemoveWindowFromMap(frameService.GetViewId());
}).ConfigureAwait(false /* task_continuation_context::use_arbitrary() */);
}
private void AddWindowToMap(WindowFrameService frameService)
{
m_windowsMapLock.EnterWriteLock();
try
{
m_secondaryWindows[frameService.GetViewId()] = frameService;
TraceLogger.GetInstance().UpdateWindowCount(Convert.ToUInt64(m_secondaryWindows.Count));
}
finally
{
m_windowsMapLock.ExitWriteLock();
}
}
private WindowFrameService GetWindowFromMap(int viewId)
{
m_windowsMapLock.EnterReadLock();
try
{
if (m_secondaryWindows.TryGetValue(viewId, out var windowMapEntry))
{
return windowMapEntry;
}
else
{
return null;
}
}
finally
{
m_windowsMapLock.ExitReadLock();
}
}
private void RemoveWindowFromMap(int viewId)
{
m_windowsMapLock.EnterWriteLock();
try
{
bool removed = m_secondaryWindows.Remove(viewId);
Debug.Assert(removed != false, "Window does not exist in the list");
}
finally
{
m_windowsMapLock.ExitWriteLock();
}
}
private readonly ReaderWriterLockSlim m_windowsMapLock = new ReaderWriterLockSlim();
private Dictionary<int, WindowFrameService> m_secondaryWindows = new Dictionary<int, WindowFrameService>();
private int m_mainViewId;
private bool m_preLaunched;
}
}

View file

@ -1,91 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//
// App.xaml.h
// Declaration of the App class.
//
#pragma once
#include "App.g.h"
#include "WindowFrameService.h"
namespace CalculatorApp
{
namespace ApplicationResourceKeys
{
extern Platform::StringReference AppMinWindowHeight;
extern Platform::StringReference AppMinWindowWidth;
}
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
ref class App sealed
{
public:
App();
virtual void OnLaunched(Windows::ApplicationModel::Activation::LaunchActivatedEventArgs ^ args) override;
virtual void OnActivated(Windows::ApplicationModel::Activation::IActivatedEventArgs ^ args) override;
internal:
void RemoveWindow(_In_ WindowFrameService ^ frameService);
void RemoveSecondaryWindow(_In_ WindowFrameService ^ frameService);
private:
static Windows::UI::Xaml::Controls::Frame ^ CreateFrame();
static void SetMinWindowSizeAndActivate(Windows::UI::Xaml::Controls::Frame ^ rootFrame, Windows::Foundation::Size minWindowSize);
void OnAppLaunch(Windows::ApplicationModel::Activation::IActivatedEventArgs ^ args, Platform::String ^ argument);
void DismissedEventHandler(Windows::ApplicationModel::Activation::SplashScreen ^ sender, Platform::Object ^ e);
void RegisterDependencyProperties();
void OnSuspending(Platform::Object ^ sender, Windows::ApplicationModel::SuspendingEventArgs ^ args);
class SafeFrameWindowCreation final
{
public:
SafeFrameWindowCreation(_In_ WindowFrameService ^ frameService, App ^ parent)
: m_frameService(frameService)
, m_frameOpenedInWindow(false)
, m_parent(parent)
{
}
void SetOperationSuccess(bool success)
{
m_frameOpenedInWindow = success;
}
~SafeFrameWindowCreation()
{
if (!m_frameOpenedInWindow)
{
// Close the window as the navigation to the window didn't succeed
// and this is not visible to the user.
m_parent->RemoveWindowFromMap(m_frameService->GetViewId());
}
}
private:
WindowFrameService ^ m_frameService;
bool m_frameOpenedInWindow;
App ^ m_parent;
};
private:
concurrency::reader_writer_lock m_windowsMapLock;
std::unordered_map<int, WindowFrameService ^> m_secondaryWindows;
concurrency::task<void> SetupJumpList();
concurrency::task<void> HandleViewReleaseAndRemoveWindowFromMap(_In_ WindowFrameService ^ frameService);
void AddWindowToMap(_In_ WindowFrameService ^ frameService);
WindowFrameService ^ GetWindowFromMap(int viewId);
void RemoveWindowFromMap(int viewId);
int m_mainViewId;
bool m_preLaunched;
Windows::UI::Xaml::Controls::Primitives::Popup ^ m_aboutPopup;
};
}

View file

@ -0,0 +1,837 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProjectGuid>{3B773403-B0D6-4F9A-948E-512A7A5FB315}</ProjectGuid>
<OutputType>AppContainerExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>CalculatorApp</RootNamespace>
<AssemblyName>CalculatorApp</AssemblyName>
<ApplicationType>Windows Store</ApplicationType>
<AppContainerApplication>true</AppContainerApplication>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.19041.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.17134.0</TargetPlatformMinVersion>
<!-- We want to manually control the MinVersion/MaxVersionTested in the manifest so turn of the replacement. -->
<AppxOSMinVersionReplaceManifestVersion>false</AppxOSMinVersionReplaceManifestVersion>
<AppxOSMaxVersionTestedReplaceManifestVersion>false</AppxOSMaxVersionTestedReplaceManifestVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
<AppxDefaultResourceQualifierUAP_Contrast>black</AppxDefaultResourceQualifierUAP_Contrast>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WindowsXamlEnableOverview>true</WindowsXamlEnableOverview>
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
<PackageCertificateKeyFile>WindowsDev_TemporaryKey.pfx</PackageCertificateKeyFile>
<AppxSymbolPackageEnabled>False</AppxSymbolPackageEnabled>
<AppxBundle>Always</AppxBundle>
<GenerateProjectSpecificOutputFolder>true</GenerateProjectSpecificOutputFolder>
<GenerateAppInstallerFile>False</GenerateAppInstallerFile>
<AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
<GenerateTestArtifacts>True</GenerateTestArtifacts>
<AppxBundlePlatforms>$(Platform)</AppxBundlePlatforms>
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
</PropertyGroup>
<!-- This has to be exactly in this place for this to work -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\x86\Debug\Calculator\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>..\x86\Release\Calculator\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\ARM\Debug\Calculator\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
<OutputPath>..\ARM\Release\Calculator\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\ARM64\Debug\Calculator\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>ARM64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM64'">
<OutputPath>..\ARM64\Release\Calculator\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>ARM64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\x64\Debug\Calculator\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>..\x64\Release\Calculator\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(IsStoreBuild)' == 'True'">
<DefineConstants>$(DefineConstants);SEND_DIAGNOSTICS;IS_STORE_BUILD</DefineConstants>
</PropertyGroup>
<PropertyGroup>
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
</PropertyGroup>
<ItemGroup>
<Compile Include="AboutFlyout.xaml.cs">
<DependentUpon>AboutFlyout.xaml</DependentUpon>
</Compile>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
</Compile>
<Compile Include="Common\AlwaysSelectedCollectionView.cs" />
<Compile Include="Common\AppLifecycleLogger.cs" />
<Compile Include="Common\KeyboardShortcuManager.cs" />
<Compile Include="Common\ValidatingConverters.cs" />
<Compile Include="Common\ViewState.cs" />
<Compile Include="Controls\CalculationResult.cs" />
<Compile Include="Controls\CalculationResultAutomationPeer.cs" />
<Compile Include="Controls\CalculatorButton.cs" />
<Compile Include="Controls\OperatorPanelButton.cs" />
<Compile Include="Controls\OperatorPanelListView.cs" />
<Compile Include="Controls\OverflowTextBlock.cs" />
<Compile Include="Controls\OverflowTextBlockAutomationPeer.cs" />
<Compile Include="Controls\EquationTextBox.cs" />
<Compile Include="Controls\FlipButtons.cs" />
<Compile Include="Controls\HorizontalNoOverflowStackPanel.cs" />
<Compile Include="Controls\MathRichEditBox.cs" />
<Compile Include="Controls\RadixButton.cs" />
<Compile Include="Controls\SupplementaryItemsControl.cs" />
<Compile Include="Converters\BooleanNegationConverter.cs" />
<Compile Include="Converters\BooleanToVisibilityConverter.cs" />
<Compile Include="Converters\ExpressionItemTemplateSelector.cs" />
<Compile Include="Converters\ItemSizeToVisibilityConverter.cs" />
<Compile Include="Converters\RadixToStringConverter.cs" />
<Compile Include="Converters\VisibilityNegationConverter.cs" />
<Compile Include="EquationStylePanelControl.xaml.cs">
<DependentUpon>EquationStylePanelControl.xaml</DependentUpon>
</Compile>
<Compile Include="KeyGraphFeaturesTemplateSelector.cs" />
<Compile Include="Utils\DelegateCommandUtils.cs" />
<Compile Include="Views\Calculator.xaml.cs">
<DependentUpon>Calculator.xaml</DependentUpon>
</Compile>
<Compile Include="Views\CalculatorProgrammerBitFlipPanel.xaml.cs">
<DependentUpon>CalculatorProgrammerBitFlipPanel.xaml</DependentUpon>
</Compile>
<Compile Include="Views\CalculatorProgrammerOperators.xaml.cs">
<DependentUpon>CalculatorProgrammerOperators.xaml</DependentUpon>
</Compile>
<Compile Include="Views\CalculatorProgrammerRadixOperators.xaml.cs">
<DependentUpon>CalculatorProgrammerRadixOperators.xaml</DependentUpon>
</Compile>
<Compile Include="Views\CalculatorScientificAngleButtons.xaml.cs">
<DependentUpon>CalculatorScientificAngleButtons.xaml</DependentUpon>
</Compile>
<Compile Include="Views\CalculatorScientificOperators.xaml.cs">
<DependentUpon>CalculatorScientificOperators.xaml</DependentUpon>
</Compile>
<Compile Include="Views\CalculatorStandardOperators.xaml.cs">
<DependentUpon>CalculatorStandardOperators.xaml</DependentUpon>
</Compile>
<Compile Include="Views\DateCalculator.xaml.cs">
<DependentUpon>DateCalculator.xaml</DependentUpon>
</Compile>
<Compile Include="Views\GraphingCalculator\EquationInputArea.xaml.cs">
<DependentUpon>EquationInputArea.xaml</DependentUpon>
</Compile>
<Compile Include="Views\GraphingCalculator\GraphingCalculator.xaml.cs">
<DependentUpon>GraphingCalculator.xaml</DependentUpon>
</Compile>
<Compile Include="Views\GraphingCalculator\GraphingNumPad.xaml.cs">
<DependentUpon>GraphingNumPad.xaml</DependentUpon>
</Compile>
<Compile Include="Views\GraphingCalculator\GraphingSettings.xaml.cs">
<DependentUpon>GraphingSettings.xaml</DependentUpon>
</Compile>
<Compile Include="Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml.cs">
<DependentUpon>KeyGraphFeaturesPanel.xaml</DependentUpon>
</Compile>
<Compile Include="Views\HistoryList.xaml.cs">
<DependentUpon>HistoryList.xaml</DependentUpon>
</Compile>
<Compile Include="Views\MainPage.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Utils\DispatcherTimerDelayer.cs" />
<Compile Include="Utils\VisualTree.cs" />
<Compile Include="Views\Memory.xaml.cs">
<DependentUpon>Memory.xaml</DependentUpon>
</Compile>
<Compile Include="Views\MemoryListItem.xaml.cs">
<DependentUpon>MemoryListItem.xaml</DependentUpon>
</Compile>
<Compile Include="Views\NumberPad.xaml.cs">
<DependentUpon>NumberPad.xaml</DependentUpon>
</Compile>
<Compile Include="Views\OperatorsPanel.xaml.cs">
<DependentUpon>OperatorsPanel.xaml</DependentUpon>
</Compile>
<Compile Include="Views\StateTriggers\AspectRatioTrigger.cs" />
<Compile Include="Views\StateTriggers\CalculatorProgrammerDisplayPanel.xaml.cs">
<DependentUpon>CalculatorProgrammerDisplayPanel.xaml</DependentUpon>
</Compile>
<Compile Include="Views\StateTriggers\ControlSizeTrigger.cs" />
<Compile Include="Views\SupplementaryResults.xaml.cs">
<DependentUpon>SupplementaryResults.xaml</DependentUpon>
</Compile>
<Compile Include="Views\TitleBar.xaml.cs">
<DependentUpon>TitleBar.xaml</DependentUpon>
</Compile>
<Compile Include="Views\UnitConverter.xaml.cs">
<DependentUpon>UnitConverter.xaml</DependentUpon>
</Compile>
<Compile Include="WindowFrameService.cs" />
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
</ItemGroup>
<ItemGroup Condition="'$(IsStoreBuild)' == 'True'">
<Content Include="Assets\CalculatorAppList.scale-100.png" />
<Content Include="Assets\CalculatorAppList.scale-125.png" />
<Content Include="Assets\CalculatorAppList.scale-150.png" />
<Content Include="Assets\CalculatorAppList.scale-200.png" />
<Content Include="Assets\CalculatorAppList.scale-400.png" />
<Content Include="Assets\CalculatorAppList.targetsize-16_altform-lightunplated_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-16_altform-lightunplated_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-20_altform-lightunplated_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-20_altform-lightunplated_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-24_altform-lightunplated_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-24_altform-lightunplated_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-256_altform-lightunplated_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-256_altform-lightunplated_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-30_altform-lightunplated_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-30_altform-lightunplated_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-32_altform-lightunplated_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-32_altform-lightunplated_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-36_altform-lightunplated_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-36_altform-lightunplated_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-40_altform-lightunplated_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-40_altform-lightunplated_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-48_altform-lightunplated_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-48_altform-lightunplated_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-60_altform-lightunplated_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-60_altform-lightunplated_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-64_altform-lightunplated_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-64_altform-lightunplated_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-72_altform-lightunplated_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-72_altform-lightunplated_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-80_altform-lightunplated_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-80_altform-lightunplated_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-96_altform-lightunplated_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-96_altform-lightunplated_contrast-white.png" />
<Content Include="Assets\CalculatorLargeTile.scale-100.png" />
<Content Include="Assets\CalculatorLargeTile.scale-125.png" />
<Content Include="Assets\CalculatorLargeTile.scale-150.png" />
<Content Include="Assets\CalculatorLargeTile.scale-200.png" />
<Content Include="Assets\CalculatorLargeTile.scale-400.png" />
<Content Include="Assets\CalculatorMedTile.scale-100.png" />
<Content Include="Assets\CalculatorMedTile.scale-125.png" />
<Content Include="Assets\CalculatorMedTile.scale-150.png" />
<Content Include="Assets\CalculatorMedTile.scale-200.png" />
<Content Include="Assets\CalculatorMedTile.scale-400.png" />
<Content Include="Assets\CalculatorSmallTile.scale-100.png" />
<Content Include="Assets\CalculatorSmallTile.scale-125.png" />
<Content Include="Assets\CalculatorSmallTile.scale-150.png" />
<Content Include="Assets\CalculatorSmallTile.scale-200.png" />
<Content Include="Assets\CalculatorSmallTile.scale-400.png" />
<Content Include="Assets\CalculatorSplashScreen.scale-100.png" />
<Content Include="Assets\CalculatorSplashScreen.scale-125.png" />
<Content Include="Assets\CalculatorSplashScreen.scale-150.png" />
<Content Include="Assets\CalculatorSplashScreen.scale-200.png" />
<Content Include="Assets\CalculatorSplashScreen.scale-400.png" />
<Content Include="Assets\CalculatorStoreLogo.scale-100.png" />
<Content Include="Assets\CalculatorStoreLogo.scale-125.png" />
<Content Include="Assets\CalculatorStoreLogo.scale-125_contrast-black.png" />
<Content Include="Assets\CalculatorStoreLogo.scale-125_contrast-white.png" />
<Content Include="Assets\CalculatorStoreLogo.scale-150.png" />
<Content Include="Assets\CalculatorStoreLogo.scale-150_contrast-black.png" />
<Content Include="Assets\CalculatorStoreLogo.scale-150_contrast-white.png" />
<Content Include="Assets\CalculatorStoreLogo.scale-200.png" />
<Content Include="Assets\CalculatorStoreLogo.scale-400.png" />
<Content Include="Assets\CalculatorStoreLogo.scale-400_contrast-black.png" />
<Content Include="Assets\CalculatorStoreLogo.scale-400_contrast-white.png" />
<Content Include="Assets\CalculatorWideTile.scale-100.png" />
<Content Include="Assets\CalculatorWideTile.scale-125.png" />
<Content Include="Assets\CalculatorWideTile.scale-150.png" />
<Content Include="Assets\CalculatorWideTile.scale-200.png" />
<Content Include="Assets\CalculatorWideTile.scale-400.png" />
</ItemGroup>
<ItemGroup>
<Content Include="Assets\CalculatorAppList.scale-100_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.scale-100_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.scale-125_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.scale-125_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.scale-150_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.scale-150_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.scale-200_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.scale-200_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.scale-400_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.scale-400_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-16.png" />
<Content Include="Assets\CalculatorAppList.targetsize-16_altform-lightunplated.png" />
<Content Include="Assets\CalculatorAppList.targetsize-16_altform-unplated.png" />
<Content Include="Assets\CalculatorAppList.targetsize-16_altform-unplated_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-16_altform-unplated_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-16_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-16_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-20.png" />
<Content Include="Assets\CalculatorAppList.targetsize-20_altform-lightunplated.png" />
<Content Include="Assets\CalculatorAppList.targetsize-20_altform-unplated.png" />
<Content Include="Assets\CalculatorAppList.targetsize-20_altform-unplated_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-20_altform-unplated_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-20_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-20_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-24.png" />
<Content Include="Assets\CalculatorAppList.targetsize-24_altform-lightunplated.png" />
<Content Include="Assets\CalculatorAppList.targetsize-24_altform-unplated.png" />
<Content Include="Assets\CalculatorAppList.targetsize-24_altform-unplated_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-24_altform-unplated_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-24_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-24_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-256.png" />
<Content Include="Assets\CalculatorAppList.targetsize-256_altform-lightunplated.png" />
<Content Include="Assets\CalculatorAppList.targetsize-256_altform-unplated.png" />
<Content Include="Assets\CalculatorAppList.targetsize-256_altform-unplated_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-256_altform-unplated_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-256_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-256_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-30.png" />
<Content Include="Assets\CalculatorAppList.targetsize-30_altform-lightunplated.png" />
<Content Include="Assets\CalculatorAppList.targetsize-30_altform-unplated.png" />
<Content Include="Assets\CalculatorAppList.targetsize-30_altform-unplated_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-30_altform-unplated_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-30_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-30_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-32.png" />
<Content Include="Assets\CalculatorAppList.targetsize-32_altform-lightunplated.png" />
<Content Include="Assets\CalculatorAppList.targetsize-32_altform-unplated.png" />
<Content Include="Assets\CalculatorAppList.targetsize-32_altform-unplated_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-32_altform-unplated_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-32_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-32_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-36.png" />
<Content Include="Assets\CalculatorAppList.targetsize-36_altform-lightunplated.png" />
<Content Include="Assets\CalculatorAppList.targetsize-36_altform-unplated.png" />
<Content Include="Assets\CalculatorAppList.targetsize-36_altform-unplated_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-36_altform-unplated_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-36_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-36_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-40.png" />
<Content Include="Assets\CalculatorAppList.targetsize-40_altform-lightunplated.png" />
<Content Include="Assets\CalculatorAppList.targetsize-40_altform-unplated.png" />
<Content Include="Assets\CalculatorAppList.targetsize-40_altform-unplated_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-40_altform-unplated_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-40_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-40_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-48.png" />
<Content Include="Assets\CalculatorAppList.targetsize-48_altform-lightunplated.png" />
<Content Include="Assets\CalculatorAppList.targetsize-48_altform-unplated.png" />
<Content Include="Assets\CalculatorAppList.targetsize-48_altform-unplated_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-48_altform-unplated_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-48_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-48_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-60.png" />
<Content Include="Assets\CalculatorAppList.targetsize-60_altform-lightunplated.png" />
<Content Include="Assets\CalculatorAppList.targetsize-60_altform-unplated.png" />
<Content Include="Assets\CalculatorAppList.targetsize-60_altform-unplated_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-60_altform-unplated_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-60_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-60_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-64.png" />
<Content Include="Assets\CalculatorAppList.targetsize-64_altform-lightunplated.png" />
<Content Include="Assets\CalculatorAppList.targetsize-64_altform-unplated.png" />
<Content Include="Assets\CalculatorAppList.targetsize-64_altform-unplated_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-64_altform-unplated_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-64_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-64_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-72.png" />
<Content Include="Assets\CalculatorAppList.targetsize-72_altform-lightunplated.png" />
<Content Include="Assets\CalculatorAppList.targetsize-72_altform-unplated.png" />
<Content Include="Assets\CalculatorAppList.targetsize-72_altform-unplated_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-72_altform-unplated_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-72_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-72_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-80.png" />
<Content Include="Assets\CalculatorAppList.targetsize-80_altform-lightunplated.png" />
<Content Include="Assets\CalculatorAppList.targetsize-80_altform-unplated.png" />
<Content Include="Assets\CalculatorAppList.targetsize-80_altform-unplated_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-80_altform-unplated_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-80_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-80_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-96.png" />
<Content Include="Assets\CalculatorAppList.targetsize-96_altform-lightunplated.png" />
<Content Include="Assets\CalculatorAppList.targetsize-96_altform-unplated.png" />
<Content Include="Assets\CalculatorAppList.targetsize-96_altform-unplated_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-96_altform-unplated_contrast-white.png" />
<Content Include="Assets\CalculatorAppList.targetsize-96_contrast-black.png" />
<Content Include="Assets\CalculatorAppList.targetsize-96_contrast-white.png" />
<Content Include="Assets\CalculatorLargeTile.scale-100_contrast-black.png" />
<Content Include="Assets\CalculatorLargeTile.scale-100_contrast-white.png" />
<Content Include="Assets\CalculatorLargeTile.scale-125_contrast-black.png" />
<Content Include="Assets\CalculatorLargeTile.scale-125_contrast-white.png" />
<Content Include="Assets\CalculatorLargeTile.scale-150_contrast-black.png" />
<Content Include="Assets\CalculatorLargeTile.scale-150_contrast-white.png" />
<Content Include="Assets\CalculatorLargeTile.scale-200_contrast-black.png" />
<Content Include="Assets\CalculatorLargeTile.scale-200_contrast-white.png" />
<Content Include="Assets\CalculatorLargeTile.scale-400_contrast-black.png" />
<Content Include="Assets\CalculatorLargeTile.scale-400_contrast-white.png" />
<Content Include="Assets\CalculatorMedTile.scale-100_contrast-black.png" />
<Content Include="Assets\CalculatorMedTile.scale-100_contrast-white.png" />
<Content Include="Assets\CalculatorMedTile.scale-125_contrast-black.png" />
<Content Include="Assets\CalculatorMedTile.scale-125_contrast-white.png" />
<Content Include="Assets\CalculatorMedTile.scale-150_contrast-black.png" />
<Content Include="Assets\CalculatorMedTile.scale-150_contrast-white.png" />
<Content Include="Assets\CalculatorMedTile.scale-200_contrast-black.png" />
<Content Include="Assets\CalculatorMedTile.scale-200_contrast-white.png" />
<Content Include="Assets\CalculatorMedTile.scale-400_contrast-black.png" />
<Content Include="Assets\CalculatorMedTile.scale-400_contrast-white.png" />
<Content Include="Assets\CalculatorSmallTile.scale-100_contrast-black.png" />
<Content Include="Assets\CalculatorSmallTile.scale-100_contrast-white.png" />
<Content Include="Assets\CalculatorSmallTile.scale-125_contrast-black.png" />
<Content Include="Assets\CalculatorSmallTile.scale-125_contrast-white.png" />
<Content Include="Assets\CalculatorSmallTile.scale-150_contrast-black.png" />
<Content Include="Assets\CalculatorSmallTile.scale-150_contrast-white.png" />
<Content Include="Assets\CalculatorSmallTile.scale-200_contrast-black.png" />
<Content Include="Assets\CalculatorSmallTile.scale-200_contrast-white.png" />
<Content Include="Assets\CalculatorSmallTile.scale-400_contrast-black.png" />
<Content Include="Assets\CalculatorSmallTile.scale-400_contrast-white.png" />
<Content Include="Assets\CalculatorSplashScreen.scale-100_altform-colorful.png" />
<Content Include="Assets\CalculatorSplashScreen.scale-100_contrast-black.png" />
<Content Include="Assets\CalculatorSplashScreen.scale-100_contrast-white.png" />
<Content Include="Assets\CalculatorSplashScreen.scale-125_altform-colorful.png" />
<Content Include="Assets\CalculatorSplashScreen.scale-125_contrast-black.png" />
<Content Include="Assets\CalculatorSplashScreen.scale-125_contrast-white.png" />
<Content Include="Assets\CalculatorSplashScreen.scale-150_altform-colorful.png" />
<Content Include="Assets\CalculatorSplashScreen.scale-150_contrast-black.png" />
<Content Include="Assets\CalculatorSplashScreen.scale-150_contrast-white.png" />
<Content Include="Assets\CalculatorSplashScreen.scale-200_altform-colorful.png" />
<Content Include="Assets\CalculatorSplashScreen.scale-200_contrast-black.png" />
<Content Include="Assets\CalculatorSplashScreen.scale-200_contrast-white.png" />
<Content Include="Assets\CalculatorSplashScreen.scale-400_altform-colorful.png" />
<Content Include="Assets\CalculatorSplashScreen.scale-400_contrast-black.png" />
<Content Include="Assets\CalculatorSplashScreen.scale-400_contrast-white.png" />
<Content Include="Assets\CalculatorStoreLogo.scale-100_contrast-black.png" />
<Content Include="Assets\CalculatorStoreLogo.scale-100_contrast-white.png" />
<Content Include="Assets\CalculatorStoreLogo.scale-200_contrast-black.png" />
<Content Include="Assets\CalculatorStoreLogo.scale-200_contrast-white.png" />
<Content Include="Assets\CalculatorWideTile.scale-100_contrast-black.png" />
<Content Include="Assets\CalculatorWideTile.scale-100_contrast-white.png" />
<Content Include="Assets\CalculatorWideTile.scale-125_contrast-black.png" />
<Content Include="Assets\CalculatorWideTile.scale-125_contrast-white.png" />
<Content Include="Assets\CalculatorWideTile.scale-150_contrast-black.png" />
<Content Include="Assets\CalculatorWideTile.scale-150_contrast-white.png" />
<Content Include="Assets\CalculatorWideTile.scale-200_contrast-black.png" />
<Content Include="Assets\CalculatorWideTile.scale-200_contrast-white.png" />
<Content Include="Assets\CalculatorWideTile.scale-400_contrast-black.png" />
<Content Include="Assets\CalculatorWideTile.scale-400_contrast-white.png" />
<Content Include="Assets\Date.targetsize-16_contrast-black.png" />
<Content Include="Assets\Date.targetsize-16_contrast-white.png" />
<Content Include="Assets\Date.targetsize-20_contrast-black.png" />
<Content Include="Assets\Date.targetsize-20_contrast-white.png" />
<Content Include="Assets\Date.targetsize-24_contrast-black.png" />
<Content Include="Assets\Date.targetsize-24_contrast-white.png" />
<Content Include="Assets\Date.targetsize-32_contrast-black.png" />
<Content Include="Assets\Date.targetsize-32_contrast-white.png" />
<Content Include="Assets\Date.targetsize-64_contrast-black.png" />
<Content Include="Assets\Date.targetsize-64_contrast-white.png" />
<Content Include="Assets\Graphing.targetsize-16.png" />
<Content Include="Assets\Graphing.targetsize-16_contrast-black.png" />
<Content Include="Assets\Graphing.targetsize-16_contrast-white.png" />
<Content Include="Assets\Graphing.targetsize-20.png" />
<Content Include="Assets\Graphing.targetsize-20_contrast-black.png" />
<Content Include="Assets\Graphing.targetsize-20_contrast-white.png" />
<Content Include="Assets\Graphing.targetsize-24.png" />
<Content Include="Assets\Graphing.targetsize-24_contrast-black.png" />
<Content Include="Assets\Graphing.targetsize-24_contrast-white.png" />
<Content Include="Assets\Graphing.targetsize-32.png" />
<Content Include="Assets\Graphing.targetsize-32_contrast-black.png" />
<Content Include="Assets\Graphing.targetsize-32_contrast-white.png" />
<Content Include="Assets\Graphing.targetsize-64.png" />
<Content Include="Assets\Graphing.targetsize-64_contrast-black.png" />
<Content Include="Assets\Graphing.targetsize-64_contrast-white.png" />
<Content Include="Assets\Programmer.targetsize-16_contrast-black.png" />
<Content Include="Assets\Programmer.targetsize-16_contrast-white.png" />
<Content Include="Assets\Programmer.targetsize-20_contrast-black.png" />
<Content Include="Assets\Programmer.targetsize-20_contrast-white.png" />
<Content Include="Assets\Programmer.targetsize-24_contrast-black.png" />
<Content Include="Assets\Programmer.targetsize-24_contrast-white.png" />
<Content Include="Assets\Programmer.targetsize-32_contrast-black.png" />
<Content Include="Assets\Programmer.targetsize-32_contrast-white.png" />
<Content Include="Assets\Programmer.targetsize-64_contrast-black.png" />
<Content Include="Assets\Programmer.targetsize-64_contrast-white.png" />
<Content Include="Assets\Scientific.targetsize-16_contrast-black.png" />
<Content Include="Assets\Scientific.targetsize-16_contrast-white.png" />
<Content Include="Assets\Scientific.targetsize-20_contrast-black.png" />
<Content Include="Assets\Scientific.targetsize-20_contrast-white.png" />
<Content Include="Assets\Scientific.targetsize-24_contrast-black.png" />
<Content Include="Assets\Scientific.targetsize-24_contrast-white.png" />
<Content Include="Assets\Scientific.targetsize-32_contrast-black.png" />
<Content Include="Assets\Scientific.targetsize-32_contrast-white.png" />
<Content Include="Assets\Scientific.targetsize-64_contrast-black.png" />
<Content Include="Assets\Scientific.targetsize-64_contrast-white.png" />
<Content Include="Assets\Standard.targetsize-16_contrast-black.png" />
<Content Include="Assets\Standard.targetsize-16_contrast-white.png" />
<Content Include="Assets\Standard.targetsize-20_contrast-black.png" />
<Content Include="Assets\Standard.targetsize-20_contrast-white.png" />
<Content Include="Assets\Standard.targetsize-24_contrast-black.png" />
<Content Include="Assets\Standard.targetsize-24_contrast-white.png" />
<Content Include="Assets\Standard.targetsize-32_contrast-black.png" />
<Content Include="Assets\Standard.targetsize-32_contrast-white.png" />
<Content Include="Assets\Standard.targetsize-64_contrast-black.png" />
<Content Include="Assets\Standard.targetsize-64_contrast-white.png" />
<Content Include="Properties\Default.rd.xml" />
</ItemGroup>
<ItemGroup>
<PRIResource Include="Resources\af-ZA\CEngineStrings.resw" />
<PRIResource Include="Resources\af-ZA\Resources.resw" />
<PRIResource Include="Resources\am-et\CEngineStrings.resw" />
<PRIResource Include="Resources\am-et\Resources.resw" />
<PRIResource Include="Resources\ar-sa\CEngineStrings.resw" />
<PRIResource Include="Resources\ar-sa\Resources.resw" />
<PRIResource Include="Resources\az-Latn-AZ\CEngineStrings.resw" />
<PRIResource Include="Resources\az-Latn-AZ\Resources.resw" />
<PRIResource Include="Resources\bg-BG\CEngineStrings.resw" />
<PRIResource Include="Resources\bg-BG\Resources.resw" />
<PRIResource Include="Resources\ca-es\CEngineStrings.resw" />
<PRIResource Include="Resources\ca-es\Resources.resw" />
<PRIResource Include="Resources\cs-cz\CEngineStrings.resw" />
<PRIResource Include="Resources\cs-cz\Resources.resw" />
<PRIResource Include="Resources\da-DK\CEngineStrings.resw" />
<PRIResource Include="Resources\da-DK\Resources.resw" />
<PRIResource Include="Resources\de-de\CEngineStrings.resw" />
<PRIResource Include="Resources\de-de\Resources.resw" />
<PRIResource Include="Resources\el-GR\CEngineStrings.resw" />
<PRIResource Include="Resources\el-GR\Resources.resw" />
<PRIResource Include="Resources\en-gb\CEngineStrings.resw" />
<PRIResource Include="Resources\en-gb\Resources.resw" />
<PRIResource Include="Resources\en-US\CEngineStrings.resw" />
<PRIResource Include="Resources\en-US\Resources.resw">
<SubType>Designer</SubType>
</PRIResource>
<PRIResource Include="Resources\es-es\CEngineStrings.resw" />
<PRIResource Include="Resources\es-es\Resources.resw" />
<PRIResource Include="Resources\es-mx\CEngineStrings.resw" />
<PRIResource Include="Resources\es-mx\resources.resw" />
<PRIResource Include="Resources\et-EE\CEngineStrings.resw" />
<PRIResource Include="Resources\et-EE\Resources.resw" />
<PRIResource Include="Resources\eu-ES\CEngineStrings.resw" />
<PRIResource Include="Resources\eu-ES\Resources.resw" />
<PRIResource Include="Resources\fa-IR\CEngineStrings.resw" />
<PRIResource Include="Resources\fa-IR\Resources.resw" />
<PRIResource Include="Resources\fi-fi\CEngineStrings.resw" />
<PRIResource Include="Resources\fi-fi\Resources.resw" />
<PRIResource Include="Resources\fil-PH\CEngineStrings.resw" />
<PRIResource Include="Resources\fil-PH\Resources.resw" />
<PRIResource Include="Resources\fr-ca\CEngineStrings.resw" />
<PRIResource Include="Resources\fr-ca\resources.resw" />
<PRIResource Include="Resources\fr-fr\CEngineStrings.resw" />
<PRIResource Include="Resources\fr-fr\Resources.resw" />
<PRIResource Include="Resources\gl-ES\CEngineStrings.resw" />
<PRIResource Include="Resources\gl-ES\Resources.resw" />
<PRIResource Include="Resources\he-IL\CEngineStrings.resw" />
<PRIResource Include="Resources\he-IL\Resources.resw" />
<PRIResource Include="Resources\hi-in\CEngineStrings.resw" />
<PRIResource Include="Resources\hi-in\Resources.resw" />
<PRIResource Include="Resources\hr-HR\CEngineStrings.resw" />
<PRIResource Include="Resources\hr-HR\Resources.resw" />
<PRIResource Include="Resources\hu-HU\CEngineStrings.resw" />
<PRIResource Include="Resources\hu-HU\Resources.resw" />
<PRIResource Include="Resources\id-ID\CEngineStrings.resw" />
<PRIResource Include="Resources\id-ID\Resources.resw" />
<PRIResource Include="Resources\is-IS\CEngineStrings.resw" />
<PRIResource Include="Resources\is-IS\Resources.resw" />
<PRIResource Include="Resources\it-it\CEngineStrings.resw" />
<PRIResource Include="Resources\it-it\Resources.resw" />
<PRIResource Include="Resources\ja-jp\CEngineStrings.resw" />
<PRIResource Include="Resources\ja-jp\Resources.resw" />
<PRIResource Include="Resources\kk-KZ\CEngineStrings.resw" />
<PRIResource Include="Resources\kk-KZ\Resources.resw" />
<PRIResource Include="Resources\km-KH\CEngineStrings.resw" />
<PRIResource Include="Resources\km-KH\Resources.resw" />
<PRIResource Include="Resources\kn-IN\CEngineStrings.resw" />
<PRIResource Include="Resources\kn-IN\Resources.resw" />
<PRIResource Include="Resources\ko-kr\CEngineStrings.resw" />
<PRIResource Include="Resources\ko-kr\Resources.resw" />
<PRIResource Include="Resources\lo-LA\CEngineStrings.resw" />
<PRIResource Include="Resources\lo-LA\Resources.resw" />
<PRIResource Include="Resources\lt-LT\CEngineStrings.resw" />
<PRIResource Include="Resources\lt-LT\Resources.resw" />
<PRIResource Include="Resources\lv-LV\CEngineStrings.resw" />
<PRIResource Include="Resources\lv-LV\Resources.resw" />
<PRIResource Include="Resources\mk-MK\CEngineStrings.resw" />
<PRIResource Include="Resources\mk-MK\Resources.resw" />
<PRIResource Include="Resources\ml-IN\CEngineStrings.resw" />
<PRIResource Include="Resources\ml-IN\Resources.resw" />
<PRIResource Include="Resources\ms-MY\CEngineStrings.resw" />
<PRIResource Include="Resources\ms-MY\Resources.resw" />
<PRIResource Include="Resources\nb-NO\CEngineStrings.resw" />
<PRIResource Include="Resources\nb-NO\Resources.resw" />
<PRIResource Include="Resources\nl-nl\CEngineStrings.resw" />
<PRIResource Include="Resources\nl-nl\Resources.resw" />
<PRIResource Include="Resources\pl-pl\CEngineStrings.resw" />
<PRIResource Include="Resources\pl-pl\Resources.resw" />
<PRIResource Include="Resources\pt-br\CEngineStrings.resw" />
<PRIResource Include="Resources\pt-br\Resources.resw" />
<PRIResource Include="Resources\pt-PT\CEngineStrings.resw" />
<PRIResource Include="Resources\pt-PT\Resources.resw" />
<PRIResource Include="Resources\ro-RO\CEngineStrings.resw" />
<PRIResource Include="Resources\ro-RO\Resources.resw" />
<PRIResource Include="Resources\ru-ru\CEngineStrings.resw" />
<PRIResource Include="Resources\ru-ru\Resources.resw" />
<PRIResource Include="Resources\sk-SK\CEngineStrings.resw" />
<PRIResource Include="Resources\sk-SK\Resources.resw" />
<PRIResource Include="Resources\sl-SI\CEngineStrings.resw" />
<PRIResource Include="Resources\sl-SI\Resources.resw" />
<PRIResource Include="Resources\sq-AL\CEngineStrings.resw" />
<PRIResource Include="Resources\sq-AL\Resources.resw" />
<PRIResource Include="Resources\sr-Latn-RS\CEngineStrings.resw" />
<PRIResource Include="Resources\sr-Latn-RS\Resources.resw" />
<PRIResource Include="Resources\sv-se\CEngineStrings.resw" />
<PRIResource Include="Resources\sv-se\Resources.resw" />
<PRIResource Include="Resources\ta-IN\CEngineStrings.resw" />
<PRIResource Include="Resources\ta-IN\Resources.resw" />
<PRIResource Include="Resources\te-IN\CEngineStrings.resw" />
<PRIResource Include="Resources\te-IN\Resources.resw" />
<PRIResource Include="Resources\th-th\CEngineStrings.resw" />
<PRIResource Include="Resources\th-th\Resources.resw" />
<PRIResource Include="Resources\tr-tr\CEngineStrings.resw" />
<PRIResource Include="Resources\tr-tr\Resources.resw" />
<PRIResource Include="Resources\uk-UA\CEngineStrings.resw" />
<PRIResource Include="Resources\uk-UA\Resources.resw" />
<PRIResource Include="Resources\vi-vn\CEngineStrings.resw" />
<PRIResource Include="Resources\vi-vn\Resources.resw" />
<PRIResource Include="Resources\zh-cn\CEngineStrings.resw" />
<PRIResource Include="Resources\zh-cn\Resources.resw" />
<PRIResource Include="Resources\zh-tw\CEngineStrings.resw" />
<PRIResource Include="Resources\zh-tw\Resources.resw" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="EquationStylePanelControl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="AboutFlyout.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\Calculator.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\CalculatorProgrammerBitFlipPanel.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\CalculatorProgrammerOperators.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\CalculatorProgrammerRadixOperators.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\CalculatorScientificAngleButtons.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\CalculatorScientificOperators.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\CalculatorStandardOperators.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\DateCalculator.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\DelighterUnitStyles.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\GraphingCalculator\EquationInputArea.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\GraphingCalculator\GraphingCalculator.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\GraphingCalculator\GraphingNumPad.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\GraphingCalculator\GraphingSettings.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\HistoryList.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\MainPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\Memory.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\MemoryListItem.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\NumberPad.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\OperatorsPanel.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\StateTriggers\CalculatorProgrammerDisplayPanel.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\SupplementaryResults.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\TitleBar.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\UnitConverter.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.2.10</Version>
</PackageReference>
<PackageReference Include="Microsoft.UI.Xaml" Version="2.4.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CalcViewModel\CalcViewModel.vcxproj">
<Project>{812d1a7b-b8ac-49e4-8e6d-af5d59500d56}</Project>
<Name>CalcViewModel</Name>
</ProjectReference>
<ProjectReference Include="..\GraphControl\GraphControl.vcxproj">
<Project>{e727a92b-f149-492c-8117-c039a298719b}</Project>
<Name>GraphControl</Name>
</ProjectReference>
<ProjectReference Include="..\TraceLogging\TraceLogging.vcxproj">
<Project>{fc81ff41-02cd-4cd9-9bc5-45a1e39ac6ed}</Project>
<Name>TraceLogging</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="Assets\CalcMDL2.ttf" />
<None Include="WindowsDev_TemporaryKey.pfx" />
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
<!-- Override MSBuild target to workaround VS bug with building using framework packages -->
<Target Name="_GenerateAdditionalFrameworkSDKReference">
<ItemGroup>
<_IntermediateFrameworkSdkReference Include="@(AppxPackageRegistration)" Condition="'@(AppxPackageRegistration)' != ''&#xD;&#xA; AND ('$(Configuration)' == '%(AppxPackageRegistration.Configuration)' OR '%(AppxPackageRegistration.Configuration)' == '')&#xD;&#xA; AND ('$(PlatformTarget)' == '%(AppxPackageRegistration.Architecture)' OR '%(AppxPackageRegistration.Configuration)' == '')">
<SDKName Condition="%(AppxPackageRegistration.Name) != ''">%(AppxPackageRegistration.Name)</SDKName>
<SDKName Condition="%(AppxPackageRegistration.Name) == ''">%(AppxPackageRegistration.Filename)</SDKName>
<TargetedSDKConfiguration>%(AppxPackageRegistration.Configuration)</TargetedSDKConfiguration>
<TargetedSDKArchitecture>%(AppxPackageRegistration.Architecture)</TargetedSDKArchitecture>
<AppxLocation>%(AppxPackageRegistration.Identity)</AppxLocation>
</_IntermediateFrameworkSdkReference>
<FrameworkSdkReference Include="@(_IntermediateFrameworkSdkReference)">
<FrameworkIdentity>Name = %(_IntermediateFrameworkSdkReference.SDKName), MinVersion = %(_IntermediateFrameworkSdkReference.Version), Publisher = %(_IntermediateFrameworkSdkReference.Publisher)</FrameworkIdentity>
</FrameworkSdkReference>
</ItemGroup>
</Target>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<Import Project="$(SolutionDir)build\Calculator.StampAssemblyInfo.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View file

@ -1,969 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>{9447424a-0e05-4911-beb8-e0354405f39a}</ProjectGuid>
<RootNamespace>CalculatorApp</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
<AppContainerApplication>true</AppContainerApplication>
<ApplicationType>Windows Store</ApplicationType>
<WindowsTargetPlatformVersion Condition="'$(WindowsTargetPlatformVersion)' == ''">10.0.18362.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.17134.0</WindowsTargetPlatformMinVersion>
<!-- We want to manually control the MinVersion/MaxVersionTested in the manifest so turn of the replacement. -->
<AppxOSMinVersionReplaceManifestVersion>false</AppxOSMinVersionReplaceManifestVersion>
<AppxOSMaxVersionTestedReplaceManifestVersion>false</AppxOSMaxVersionTestedReplaceManifestVersion>
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
<AppxDefaultResourceQualifierUAP_Contrast>black</AppxDefaultResourceQualifierUAP_Contrast>
<AppxBundle>Always</AppxBundle>
<PackageCertificateKeyFile>WindowsDev_TemporaryKey.pfx</PackageCertificateKeyFile>
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
<AppxSymbolPackageEnabled>False</AppxSymbolPackageEnabled>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<!-- This has to be exactly in this place for this to work -->
<PropertyGroup>
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup>
<Import Project="$(SolutionDir)\GraphControl\GraphingImplOverrides.props" Condition="Exists('$(SolutionDir)\GraphControl\GraphingImplOverrides.props')" />
</ImportGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<ClCompile>
<AdditionalOptions>/bigobj /await /std:c++17 /utf-8 %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<ClCompile>
<AdditionalOptions>/bigobj /await /std:c++17 /utf-8 %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<ClCompile>
<AdditionalOptions>/bigobj /await /std:c++17 /utf-8 %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
<Link>
<AdditionalDependencies>WindowsApp.lib;$(VC_ReferencesPath_VC_ARM)\pgort.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<ClCompile>
<AdditionalOptions>/bigobj /await /std:c++17 /utf-8 %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
<Link>
<AdditionalDependencies>WindowsApp.lib;$(VC_ReferencesPath_VC_ARM)\pgort.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<AdditionalOptions>/bigobj /await /std:c++17 /utf-8 %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalOptions>/bigobj /await /std:c++17 /utf-8 %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
<Link>
<AdditionalDependencies>WindowsApp.lib;$(VC_ReferencesPath_VC_x86)\pgort.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<AdditionalOptions>/bigobj /await /std:c++17 /utf-8 %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<AdditionalOptions>/bigobj /await /std:c++17 /utf-8 %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
<AdditionalIncludeDirectories>$(SolutionDir)..\src\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
</ClCompile>
<Link>
<AdditionalDependencies>WindowsApp.lib;$(VC_ReferencesPath_VC_x64)\pgort.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(IsStoreBuild)' == 'True'">
<ClCompile>
<AdditionalOptions>/DSEND_DIAGNOSTICS /DIS_STORE_BUILD %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<AppVersion Condition="'$(AppVersion)' == ''">0.0.0.0</AppVersion>
</PropertyGroup>
<PropertyGroup>
<GenerateProjectSpecificOutputFolder>true</GenerateProjectSpecificOutputFolder>
</PropertyGroup>
<ItemGroup>
<ResourceCompile Include="Calculator.rc" PreprocessorDefinitions="%(PreprocessorDefinitions);APP_VERSION_MAJOR=$(AppVersion.Split(`.`)[0]);APP_VERSION_MINOR=$(AppVersion.Split(`.`)[1]);APP_VERSION_BUILD=$(AppVersion.Split(`.`)[2]);APP_VERSION_REVISION=$(AppVersion.Split(`.`)[3])" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="AboutFlyout.xaml.h">
<DependentUpon>AboutFlyout.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="Common\AppLifecycleLogger.h" />
<ClInclude Include="Common\KeyboardShortcutManager.h" />
<ClInclude Include="Common\ValidatingConverters.h" />
<ClInclude Include="Common\ViewState.h" />
<ClInclude Include="Controls\CalculationResultAutomationPeer.h" />
<ClInclude Include="Controls\MathRichEditBox.h" />
<ClInclude Include="Controls\OverflowTextBlockAutomationPeer.h" />
<ClInclude Include="Common\AlwaysSelectedCollectionView.h" />
<ClInclude Include="Controls\CalculationResult.h" />
<ClInclude Include="Controls\CalculatorButton.h" />
<ClInclude Include="Controls\FlipButtons.h" />
<ClInclude Include="Controls\OverflowTextBlock.h" />
<ClInclude Include="Controls\RadixButton.h" />
<ClInclude Include="Controls\SupplementaryItemsControl.h" />
<ClInclude Include="Converters\BooleanNegationConverter.h" />
<ClInclude Include="Converters\BooleanToVisibilityConverter.h" />
<ClInclude Include="Converters\ExpressionItemTemplateSelector.h" />
<ClInclude Include="Converters\ItemSizeToVisibilityConverter.h" />
<ClInclude Include="Converters\RadixToStringConverter.h" />
<ClInclude Include="Converters\VisibilityNegationConverter.h" />
<ClInclude Include="Controls\HorizontalNoOverflowStackPanel.h" />
<ClInclude Include="Controls\OperatorPanelListView.h" />
<ClInclude Include="Controls\OperatorPanelButton.h" />
<ClInclude Include="Controls\EquationTextBox.h" />
<ClInclude Include="Utils\DispatcherTimerDelayer.h" />
<ClInclude Include="pch.h" />
<ClInclude Include="App.xaml.h">
<DependentUpon>App.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="EquationStylePanelControl.xaml.h">
<DependentUpon>EquationStylePanelControl.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="TemplateSelectors\KeyGraphFeaturesTemplateSelector.h" />
<ClInclude Include="Utils\VisualTree.h" />
<ClInclude Include="Views\Calculator.xaml.h">
<DependentUpon>Views\Calculator.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="Views\CalculatorProgrammerBitFlipPanel.xaml.h">
<DependentUpon>Views\CalculatorProgrammerBitFlipPanel.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="Views\CalculatorProgrammerDisplayPanel.xaml.h">
<DependentUpon>Views\CalculatorProgrammerDisplayPanel.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="Views\CalculatorProgrammerOperators.xaml.h">
<DependentUpon>Views\CalculatorProgrammerOperators.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="Views\CalculatorProgrammerRadixOperators.xaml.h">
<DependentUpon>Views\CalculatorProgrammerRadixOperators.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="Views\CalculatorScientificAngleButtons.xaml.h">
<DependentUpon>Views\CalculatorScientificAngleButtons.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="Views\CalculatorScientificOperators.xaml.h">
<DependentUpon>Views\CalculatorScientificOperators.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="Views\CalculatorStandardOperators.xaml.h">
<DependentUpon>Views\CalculatorStandardOperators.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="Views\GraphingCalculator\EquationInputArea.xaml.h">
<DependentUpon>Views\GraphingCalculator\EquationInputArea.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="Views\GraphingCalculator\GraphingCalculator.xaml.h">
<DependentUpon>Views\GraphingCalculator\GraphingCalculator.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="Views\GraphingCalculator\GraphingSettings.xaml.h">
<DependentUpon>Views\GraphingCalculator\GraphingSettings.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml.h">
<DependentUpon>Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="Views\GraphingCalculator\GraphingNumPad.xaml.h">
<DependentUpon>Views\GraphingCalculator\GraphingNumPad.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="Views\HistoryList.xaml.h">
<DependentUpon>Views\HistoryList.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="Views\MainPage.xaml.h">
<DependentUpon>Views\MainPage.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="Views\Memory.xaml.h">
<DependentUpon>Views\Memory.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="Views\MemoryListItem.xaml.h">
<DependentUpon>Views\MemoryListItem.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="Views\NumberPad.xaml.h">
<DependentUpon>Views\NumberPad.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="Views\OperatorsPanel.xaml.h">
<DependentUpon>Views\OperatorsPanel.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="Views\StateTriggers\AspectRatioTrigger.h" />
<ClInclude Include="Views\StateTriggers\ControlSizeTrigger.h" />
<ClInclude Include="Views\SupplementaryResults.xaml.h">
<DependentUpon>Views\SupplementaryResults.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="Views\DateCalculator.xaml.h">
<DependentUpon>Views\DateCalculator.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="Views\TitleBar.xaml.h">
<DependentUpon>Views\TitleBar.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="Views\UnitConverter.xaml.h">
<DependentUpon>Views\UnitConverter.xaml</DependentUpon>
</ClInclude>
<ClInclude Include="WindowFrameService.h" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="AboutFlyout.xaml" />
<Page Include="EquationStylePanelControl.xaml">
<SubType>Designer</SubType>
</Page>
<Page Include="Views\Calculator.xaml">
<SubType>Designer</SubType>
</Page>
<Page Include="Views\CalculatorProgrammerBitFlipPanel.xaml">
<SubType>Designer</SubType>
</Page>
<Page Include="Views\CalculatorProgrammerDisplayPanel.xaml" />
<Page Include="Views\CalculatorProgrammerOperators.xaml" />
<Page Include="Views\CalculatorProgrammerRadixOperators.xaml">
<SubType>Designer</SubType>
</Page>
<Page Include="Views\CalculatorScientificAngleButtons.xaml" />
<Page Include="Views\CalculatorScientificOperators.xaml">
<SubType>Designer</SubType>
</Page>
<Page Include="Views\CalculatorStandardOperators.xaml" />
<Page Include="Views\DelighterUnitStyles.xaml" />
<Page Include="Views\GraphingCalculator\EquationInputArea.xaml" />
<Page Include="Views\GraphingCalculator\GraphingCalculator.xaml" />
<Page Include="Views\GraphingCalculator\GraphingSettings.xaml" />
<Page Include="Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml" />
<Page Include="Views\GraphingCalculator\GraphingNumPad.xaml" />
<Page Include="Views\HistoryList.xaml" />
<Page Include="Views\MainPage.xaml" />
<Page Include="Views\Memory.xaml" />
<Page Include="Views\MemoryListItem.xaml" />
<Page Include="Views\NumberPad.xaml" />
<Page Include="Views\OperatorsPanel.xaml" />
<Page Include="Views\SupplementaryResults.xaml" />
<Page Include="Views\DateCalculator.xaml" />
<Page Include="Views\TitleBar.xaml" />
<Page Include="Views\UnitConverter.xaml" />
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
<None Include="WindowsDev_TemporaryKey.pfx" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="AboutFlyout.xaml.cpp">
<DependentUpon>AboutFlyout.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="App.xaml.cpp">
<DependentUpon>App.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="Common\AppLifecycleLogger.cpp" />
<ClCompile Include="Common\KeyboardShortcutManager.cpp" />
<ClCompile Include="Common\ViewState.cpp" />
<ClCompile Include="Controls\CalculationResultAutomationPeer.cpp" />
<ClCompile Include="Controls\MathRichEditBox.cpp" />
<ClCompile Include="Controls\OverflowTextBlockAutomationPeer.cpp" />
<ClCompile Include="Controls\CalculationResult.cpp" />
<ClCompile Include="Controls\CalculatorButton.cpp" />
<ClCompile Include="Controls\FlipButtons.cpp" />
<ClCompile Include="Controls\OverflowTextBlock.cpp" />
<ClCompile Include="Controls\RadixButton.cpp" />
<ClCompile Include="Controls\SupplementaryItemsControl.cpp" />
<ClCompile Include="Converters\BooleanNegationConverter.cpp" />
<ClCompile Include="Converters\BooleanToVisibilityConverter.cpp" />
<ClCompile Include="Converters\ExpressionItemTemplateSelector.cpp" />
<ClCompile Include="Converters\ItemSizeToVisibilityConverter.cpp" />
<ClCompile Include="Converters\RadixToStringConverter.cpp" />
<ClCompile Include="Converters\VisibilityNegationConverter.cpp" />
<ClCompile Include="Controls\HorizontalNoOverflowStackPanel.cpp" />
<ClCompile Include="Controls\OperatorPanelListView.cpp" />
<ClCompile Include="Controls\OperatorPanelButton.cpp" />
<ClCompile Include="Controls\EquationTextBox.cpp" />
<ClCompile Include="Utils\DispatcherTimerDelayer.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="EquationStylePanelControl.xaml.cpp">
<DependentUpon>EquationStylePanelControl.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="TemplateSelectors\KeyGraphFeaturesTemplateSelector.cpp" />
<ClCompile Include="Utils\VisualTree.cpp" />
<ClCompile Include="Views\Calculator.xaml.cpp">
<DependentUpon>Views\Calculator.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="Views\CalculatorProgrammerBitFlipPanel.xaml.cpp">
<DependentUpon>Views\CalculatorProgrammerBitFlipPanel.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="Views\CalculatorProgrammerDisplayPanel.xaml.cpp">
<DependentUpon>Views\CalculatorProgrammerDisplayPanel.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="Views\CalculatorProgrammerOperators.xaml.cpp">
<DependentUpon>Views\CalculatorProgrammerOperators.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="Views\CalculatorProgrammerRadixOperators.xaml.cpp">
<DependentUpon>Views\CalculatorProgrammerRadixOperators.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="Views\CalculatorScientificAngleButtons.xaml.cpp">
<DependentUpon>Views\CalculatorScientificAngleButtons.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="Views\CalculatorScientificOperators.xaml.cpp">
<DependentUpon>Views\CalculatorScientificOperators.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="Views\CalculatorStandardOperators.xaml.cpp">
<DependentUpon>Views\CalculatorStandardOperators.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="Views\GraphingCalculator\EquationInputArea.xaml.cpp">
<DependentUpon>Views\GraphingCalculator\EquationInputArea.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="Views\GraphingCalculator\GraphingCalculator.xaml.cpp">
<DependentUpon>Views\GraphingCalculator\GraphingCalculator.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="Views\GraphingCalculator\GraphingSettings.xaml.cpp">
<DependentUpon>Views\GraphingCalculator\GraphingSettings.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml.cpp">
<DependentUpon>Views\GraphingCalculator\KeyGraphFeaturesPanel.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="Views\GraphingCalculator\GraphingNumPad.xaml.cpp">
<DependentUpon>Views\GraphingCalculator\GraphingNumPad.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="Views\HistoryList.xaml.cpp">
<DependentUpon>Views\HistoryList.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="Views\MainPage.xaml.cpp">
<DependentUpon>Views\MainPage.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="Views\Memory.xaml.cpp">
<DependentUpon>Views\Memory.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="Views\MemoryListItem.xaml.cpp">
<DependentUpon>Views\MemoryListItem.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="Views\NumberPad.xaml.cpp">
<DependentUpon>Views\NumberPad.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="Views\OperatorsPanel.xaml.cpp">
<DependentUpon>Views\OperatorsPanel.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="Views\StateTriggers\AspectRatioTrigger.cpp" />
<ClCompile Include="Views\StateTriggers\ControlSizeTrigger.cpp" />
<ClCompile Include="Views\SupplementaryResults.xaml.cpp">
<DependentUpon>Views\SupplementaryResults.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="Views\DateCalculator.xaml.cpp">
<DependentUpon>Views\DateCalculator.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="Views\TitleBar.xaml.cpp">
<DependentUpon>Views\TitleBar.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="Views\UnitConverter.xaml.cpp">
<DependentUpon>Views\UnitConverter.xaml</DependentUpon>
</ClCompile>
<ClCompile Include="WindowFrameService.cpp" />
</ItemGroup>
<ItemGroup>
<PRIResource Include="Resources\af-ZA\CEngineStrings.resw" />
<PRIResource Include="Resources\af-ZA\Resources.resw" />
<PRIResource Include="Resources\am-et\CEngineStrings.resw" />
<PRIResource Include="Resources\am-et\Resources.resw" />
<PRIResource Include="Resources\ar-sa\CEngineStrings.resw" />
<PRIResource Include="Resources\ar-sa\Resources.resw" />
<PRIResource Include="Resources\az-Latn-AZ\CEngineStrings.resw" />
<PRIResource Include="Resources\az-Latn-AZ\Resources.resw" />
<PRIResource Include="Resources\bg-BG\CEngineStrings.resw" />
<PRIResource Include="Resources\bg-BG\Resources.resw" />
<PRIResource Include="Resources\ca-es\CEngineStrings.resw" />
<PRIResource Include="Resources\ca-es\Resources.resw" />
<PRIResource Include="Resources\cs-cz\CEngineStrings.resw" />
<PRIResource Include="Resources\cs-cz\Resources.resw" />
<PRIResource Include="Resources\da-DK\CEngineStrings.resw" />
<PRIResource Include="Resources\da-DK\Resources.resw" />
<PRIResource Include="Resources\de-de\CEngineStrings.resw" />
<PRIResource Include="Resources\de-de\Resources.resw" />
<PRIResource Include="Resources\el-GR\CEngineStrings.resw" />
<PRIResource Include="Resources\el-GR\Resources.resw" />
<PRIResource Include="Resources\en-gb\CEngineStrings.resw" />
<PRIResource Include="Resources\en-gb\Resources.resw" />
<PRIResource Include="Resources\en-US\CEngineStrings.resw" />
<PRIResource Include="Resources\en-US\Resources.resw">
<SubType>Designer</SubType>
</PRIResource>
<PRIResource Include="Resources\es-es\CEngineStrings.resw" />
<PRIResource Include="Resources\es-es\Resources.resw" />
<PRIResource Include="Resources\es-mx\CEngineStrings.resw" />
<PRIResource Include="Resources\es-mx\resources.resw" />
<PRIResource Include="Resources\et-EE\CEngineStrings.resw" />
<PRIResource Include="Resources\et-EE\Resources.resw" />
<PRIResource Include="Resources\eu-ES\CEngineStrings.resw" />
<PRIResource Include="Resources\eu-ES\Resources.resw" />
<PRIResource Include="Resources\fa-IR\CEngineStrings.resw" />
<PRIResource Include="Resources\fa-IR\Resources.resw" />
<PRIResource Include="Resources\fi-fi\CEngineStrings.resw" />
<PRIResource Include="Resources\fi-fi\Resources.resw" />
<PRIResource Include="Resources\fil-PH\CEngineStrings.resw" />
<PRIResource Include="Resources\fil-PH\Resources.resw" />
<PRIResource Include="Resources\fr-ca\CEngineStrings.resw" />
<PRIResource Include="Resources\fr-ca\resources.resw" />
<PRIResource Include="Resources\fr-fr\CEngineStrings.resw" />
<PRIResource Include="Resources\fr-fr\Resources.resw" />
<PRIResource Include="Resources\gl-ES\CEngineStrings.resw" />
<PRIResource Include="Resources\gl-ES\Resources.resw" />
<PRIResource Include="Resources\he-IL\CEngineStrings.resw" />
<PRIResource Include="Resources\he-IL\Resources.resw" />
<PRIResource Include="Resources\hi-in\CEngineStrings.resw" />
<PRIResource Include="Resources\hi-in\Resources.resw" />
<PRIResource Include="Resources\hr-HR\CEngineStrings.resw" />
<PRIResource Include="Resources\hr-HR\Resources.resw" />
<PRIResource Include="Resources\hu-HU\CEngineStrings.resw" />
<PRIResource Include="Resources\hu-HU\Resources.resw" />
<PRIResource Include="Resources\id-ID\CEngineStrings.resw" />
<PRIResource Include="Resources\id-ID\Resources.resw" />
<PRIResource Include="Resources\is-IS\CEngineStrings.resw" />
<PRIResource Include="Resources\is-IS\Resources.resw" />
<PRIResource Include="Resources\it-it\CEngineStrings.resw" />
<PRIResource Include="Resources\it-it\Resources.resw" />
<PRIResource Include="Resources\ja-jp\CEngineStrings.resw" />
<PRIResource Include="Resources\ja-jp\Resources.resw" />
<PRIResource Include="Resources\kk-KZ\CEngineStrings.resw" />
<PRIResource Include="Resources\kk-KZ\Resources.resw" />
<PRIResource Include="Resources\km-KH\CEngineStrings.resw" />
<PRIResource Include="Resources\km-KH\Resources.resw" />
<PRIResource Include="Resources\kn-IN\CEngineStrings.resw" />
<PRIResource Include="Resources\kn-IN\Resources.resw" />
<PRIResource Include="Resources\ko-kr\CEngineStrings.resw" />
<PRIResource Include="Resources\ko-kr\Resources.resw" />
<PRIResource Include="Resources\lo-LA\CEngineStrings.resw" />
<PRIResource Include="Resources\lo-LA\Resources.resw" />
<PRIResource Include="Resources\lt-LT\CEngineStrings.resw" />
<PRIResource Include="Resources\lt-LT\Resources.resw" />
<PRIResource Include="Resources\lv-LV\CEngineStrings.resw" />
<PRIResource Include="Resources\lv-LV\Resources.resw" />
<PRIResource Include="Resources\mk-MK\CEngineStrings.resw" />
<PRIResource Include="Resources\mk-MK\Resources.resw" />
<PRIResource Include="Resources\ml-IN\CEngineStrings.resw" />
<PRIResource Include="Resources\ml-IN\Resources.resw" />
<PRIResource Include="Resources\ms-MY\CEngineStrings.resw" />
<PRIResource Include="Resources\ms-MY\Resources.resw" />
<PRIResource Include="Resources\nb-NO\CEngineStrings.resw" />
<PRIResource Include="Resources\nb-NO\Resources.resw" />
<PRIResource Include="Resources\nl-nl\CEngineStrings.resw" />
<PRIResource Include="Resources\nl-nl\Resources.resw" />
<PRIResource Include="Resources\pl-pl\CEngineStrings.resw" />
<PRIResource Include="Resources\pl-pl\Resources.resw" />
<PRIResource Include="Resources\pt-br\CEngineStrings.resw" />
<PRIResource Include="Resources\pt-br\Resources.resw" />
<PRIResource Include="Resources\pt-PT\CEngineStrings.resw" />
<PRIResource Include="Resources\pt-PT\Resources.resw" />
<PRIResource Include="Resources\ro-RO\CEngineStrings.resw" />
<PRIResource Include="Resources\ro-RO\Resources.resw" />
<PRIResource Include="Resources\ru-ru\CEngineStrings.resw" />
<PRIResource Include="Resources\ru-ru\Resources.resw" />
<PRIResource Include="Resources\sk-SK\CEngineStrings.resw" />
<PRIResource Include="Resources\sk-SK\Resources.resw" />
<PRIResource Include="Resources\sl-SI\CEngineStrings.resw" />
<PRIResource Include="Resources\sl-SI\Resources.resw" />
<PRIResource Include="Resources\sq-AL\CEngineStrings.resw" />
<PRIResource Include="Resources\sq-AL\Resources.resw" />
<PRIResource Include="Resources\sr-Latn-RS\CEngineStrings.resw" />
<PRIResource Include="Resources\sr-Latn-RS\Resources.resw" />
<PRIResource Include="Resources\sv-se\CEngineStrings.resw" />
<PRIResource Include="Resources\sv-se\Resources.resw" />
<PRIResource Include="Resources\ta-IN\CEngineStrings.resw" />
<PRIResource Include="Resources\ta-IN\Resources.resw" />
<PRIResource Include="Resources\te-IN\CEngineStrings.resw" />
<PRIResource Include="Resources\te-IN\Resources.resw" />
<PRIResource Include="Resources\th-th\CEngineStrings.resw" />
<PRIResource Include="Resources\th-th\Resources.resw" />
<PRIResource Include="Resources\tr-tr\CEngineStrings.resw" />
<PRIResource Include="Resources\tr-tr\Resources.resw" />
<PRIResource Include="Resources\uk-UA\CEngineStrings.resw" />
<PRIResource Include="Resources\uk-UA\Resources.resw" />
<PRIResource Include="Resources\vi-vn\CEngineStrings.resw" />
<PRIResource Include="Resources\vi-vn\Resources.resw" />
<PRIResource Include="Resources\zh-cn\CEngineStrings.resw" />
<PRIResource Include="Resources\zh-cn\Resources.resw" />
<PRIResource Include="Resources\zh-tw\CEngineStrings.resw" />
<PRIResource Include="Resources\zh-tw\Resources.resw" />
</ItemGroup>
<ItemGroup Condition="'$(IsStoreBuild)' == 'True'">
<Image Include="Assets\CalculatorAppList.scale-100.png" />
<Image Include="Assets\CalculatorAppList.scale-125.png" />
<Image Include="Assets\CalculatorAppList.scale-150.png" />
<Image Include="Assets\CalculatorAppList.scale-200.png" />
<Image Include="Assets\CalculatorAppList.scale-400.png" />
<Image Include="Assets\CalculatorAppList.targetsize-16_altform-lightunplated_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-16_altform-lightunplated_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-20_altform-lightunplated_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-20_altform-lightunplated_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-24_altform-lightunplated_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-24_altform-lightunplated_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-256_altform-lightunplated_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-256_altform-lightunplated_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-30_altform-lightunplated_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-30_altform-lightunplated_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-32_altform-lightunplated_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-32_altform-lightunplated_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-36_altform-lightunplated_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-36_altform-lightunplated_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-40_altform-lightunplated_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-40_altform-lightunplated_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-48_altform-lightunplated_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-48_altform-lightunplated_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-60_altform-lightunplated_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-60_altform-lightunplated_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-64_altform-lightunplated_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-64_altform-lightunplated_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-72_altform-lightunplated_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-72_altform-lightunplated_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-80_altform-lightunplated_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-80_altform-lightunplated_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-96_altform-lightunplated_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-96_altform-lightunplated_contrast-white.png" />
<Image Include="Assets\CalculatorLargeTile.scale-100.png" />
<Image Include="Assets\CalculatorLargeTile.scale-125.png" />
<Image Include="Assets\CalculatorLargeTile.scale-150.png" />
<Image Include="Assets\CalculatorLargeTile.scale-200.png" />
<Image Include="Assets\CalculatorLargeTile.scale-400.png" />
<Image Include="Assets\CalculatorMedTile.scale-100.png" />
<Image Include="Assets\CalculatorMedTile.scale-125.png" />
<Image Include="Assets\CalculatorMedTile.scale-150.png" />
<Image Include="Assets\CalculatorMedTile.scale-200.png" />
<Image Include="Assets\CalculatorMedTile.scale-400.png" />
<Image Include="Assets\CalculatorSmallTile.scale-100.png" />
<Image Include="Assets\CalculatorSmallTile.scale-125.png" />
<Image Include="Assets\CalculatorSmallTile.scale-150.png" />
<Image Include="Assets\CalculatorSmallTile.scale-200.png" />
<Image Include="Assets\CalculatorSmallTile.scale-400.png" />
<Image Include="Assets\CalculatorSplashScreen.scale-100.png" />
<Image Include="Assets\CalculatorSplashScreen.scale-125.png" />
<Image Include="Assets\CalculatorSplashScreen.scale-150.png" />
<Image Include="Assets\CalculatorSplashScreen.scale-200.png" />
<Image Include="Assets\CalculatorSplashScreen.scale-400.png" />
<Image Include="Assets\CalculatorStoreLogo.scale-100.png" />
<Image Include="Assets\CalculatorStoreLogo.scale-125.png" />
<Image Include="Assets\CalculatorStoreLogo.scale-125_contrast-black.png" />
<Image Include="Assets\CalculatorStoreLogo.scale-125_contrast-white.png" />
<Image Include="Assets\CalculatorStoreLogo.scale-150.png" />
<Image Include="Assets\CalculatorStoreLogo.scale-150_contrast-black.png" />
<Image Include="Assets\CalculatorStoreLogo.scale-150_contrast-white.png" />
<Image Include="Assets\CalculatorStoreLogo.scale-200.png" />
<Image Include="Assets\CalculatorStoreLogo.scale-400.png" />
<Image Include="Assets\CalculatorStoreLogo.scale-400_contrast-black.png" />
<Image Include="Assets\CalculatorStoreLogo.scale-400_contrast-white.png" />
<Image Include="Assets\CalculatorWideTile.scale-100.png" />
<Image Include="Assets\CalculatorWideTile.scale-125.png" />
<Image Include="Assets\CalculatorWideTile.scale-150.png" />
<Image Include="Assets\CalculatorWideTile.scale-200.png" />
<Image Include="Assets\CalculatorWideTile.scale-400.png" />
</ItemGroup>
<ItemGroup>
<Image Include="Assets\CalculatorAppList.scale-100_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.scale-100_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.scale-125_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.scale-125_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.scale-150_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.scale-150_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.scale-200_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.scale-200_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.scale-400_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.scale-400_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-16.png" />
<Image Include="Assets\CalculatorAppList.targetsize-16_altform-lightunplated.png" />
<Image Include="Assets\CalculatorAppList.targetsize-16_altform-unplated.png" />
<Image Include="Assets\CalculatorAppList.targetsize-16_altform-unplated_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-16_altform-unplated_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-16_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-16_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-20.png" />
<Image Include="Assets\CalculatorAppList.targetsize-20_altform-lightunplated.png" />
<Image Include="Assets\CalculatorAppList.targetsize-20_altform-unplated.png" />
<Image Include="Assets\CalculatorAppList.targetsize-20_altform-unplated_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-20_altform-unplated_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-20_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-20_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-24.png" />
<Image Include="Assets\CalculatorAppList.targetsize-24_altform-lightunplated.png" />
<Image Include="Assets\CalculatorAppList.targetsize-24_altform-unplated.png" />
<Image Include="Assets\CalculatorAppList.targetsize-24_altform-unplated_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-24_altform-unplated_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-24_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-24_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-256.png" />
<Image Include="Assets\CalculatorAppList.targetsize-256_altform-lightunplated.png" />
<Image Include="Assets\CalculatorAppList.targetsize-256_altform-unplated.png" />
<Image Include="Assets\CalculatorAppList.targetsize-256_altform-unplated_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-256_altform-unplated_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-256_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-256_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-30.png" />
<Image Include="Assets\CalculatorAppList.targetsize-30_altform-lightunplated.png" />
<Image Include="Assets\CalculatorAppList.targetsize-30_altform-unplated.png" />
<Image Include="Assets\CalculatorAppList.targetsize-30_altform-unplated_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-30_altform-unplated_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-30_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-30_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-32.png" />
<Image Include="Assets\CalculatorAppList.targetsize-32_altform-lightunplated.png" />
<Image Include="Assets\CalculatorAppList.targetsize-32_altform-unplated.png" />
<Image Include="Assets\CalculatorAppList.targetsize-32_altform-unplated_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-32_altform-unplated_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-32_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-32_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-36.png" />
<Image Include="Assets\CalculatorAppList.targetsize-36_altform-lightunplated.png" />
<Image Include="Assets\CalculatorAppList.targetsize-36_altform-unplated.png" />
<Image Include="Assets\CalculatorAppList.targetsize-36_altform-unplated_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-36_altform-unplated_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-36_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-36_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-40.png" />
<Image Include="Assets\CalculatorAppList.targetsize-40_altform-lightunplated.png" />
<Image Include="Assets\CalculatorAppList.targetsize-40_altform-unplated.png" />
<Image Include="Assets\CalculatorAppList.targetsize-40_altform-unplated_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-40_altform-unplated_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-40_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-40_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-48.png" />
<Image Include="Assets\CalculatorAppList.targetsize-48_altform-lightunplated.png" />
<Image Include="Assets\CalculatorAppList.targetsize-48_altform-unplated.png" />
<Image Include="Assets\CalculatorAppList.targetsize-48_altform-unplated_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-48_altform-unplated_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-48_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-48_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-60.png" />
<Image Include="Assets\CalculatorAppList.targetsize-60_altform-lightunplated.png" />
<Image Include="Assets\CalculatorAppList.targetsize-60_altform-unplated.png" />
<Image Include="Assets\CalculatorAppList.targetsize-60_altform-unplated_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-60_altform-unplated_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-60_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-60_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-64.png" />
<Image Include="Assets\CalculatorAppList.targetsize-64_altform-lightunplated.png" />
<Image Include="Assets\CalculatorAppList.targetsize-64_altform-unplated.png" />
<Image Include="Assets\CalculatorAppList.targetsize-64_altform-unplated_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-64_altform-unplated_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-64_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-64_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-72.png" />
<Image Include="Assets\CalculatorAppList.targetsize-72_altform-lightunplated.png" />
<Image Include="Assets\CalculatorAppList.targetsize-72_altform-unplated.png" />
<Image Include="Assets\CalculatorAppList.targetsize-72_altform-unplated_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-72_altform-unplated_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-72_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-72_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-80.png" />
<Image Include="Assets\CalculatorAppList.targetsize-80_altform-lightunplated.png" />
<Image Include="Assets\CalculatorAppList.targetsize-80_altform-unplated.png" />
<Image Include="Assets\CalculatorAppList.targetsize-80_altform-unplated_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-80_altform-unplated_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-80_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-80_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-96.png" />
<Image Include="Assets\CalculatorAppList.targetsize-96_altform-lightunplated.png" />
<Image Include="Assets\CalculatorAppList.targetsize-96_altform-unplated.png" />
<Image Include="Assets\CalculatorAppList.targetsize-96_altform-unplated_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-96_altform-unplated_contrast-white.png" />
<Image Include="Assets\CalculatorAppList.targetsize-96_contrast-black.png" />
<Image Include="Assets\CalculatorAppList.targetsize-96_contrast-white.png" />
<Image Include="Assets\CalculatorLargeTile.scale-100_contrast-black.png" />
<Image Include="Assets\CalculatorLargeTile.scale-100_contrast-white.png" />
<Image Include="Assets\CalculatorLargeTile.scale-125_contrast-black.png" />
<Image Include="Assets\CalculatorLargeTile.scale-125_contrast-white.png" />
<Image Include="Assets\CalculatorLargeTile.scale-150_contrast-black.png" />
<Image Include="Assets\CalculatorLargeTile.scale-150_contrast-white.png" />
<Image Include="Assets\CalculatorLargeTile.scale-200_contrast-black.png" />
<Image Include="Assets\CalculatorLargeTile.scale-200_contrast-white.png" />
<Image Include="Assets\CalculatorLargeTile.scale-400_contrast-black.png" />
<Image Include="Assets\CalculatorLargeTile.scale-400_contrast-white.png" />
<Image Include="Assets\CalculatorMedTile.scale-100_contrast-black.png" />
<Image Include="Assets\CalculatorMedTile.scale-100_contrast-white.png" />
<Image Include="Assets\CalculatorMedTile.scale-125_contrast-black.png" />
<Image Include="Assets\CalculatorMedTile.scale-125_contrast-white.png" />
<Image Include="Assets\CalculatorMedTile.scale-150_contrast-black.png" />
<Image Include="Assets\CalculatorMedTile.scale-150_contrast-white.png" />
<Image Include="Assets\CalculatorMedTile.scale-200_contrast-black.png" />
<Image Include="Assets\CalculatorMedTile.scale-200_contrast-white.png" />
<Image Include="Assets\CalculatorMedTile.scale-400_contrast-black.png" />
<Image Include="Assets\CalculatorMedTile.scale-400_contrast-white.png" />
<Image Include="Assets\CalculatorSmallTile.scale-100_contrast-black.png" />
<Image Include="Assets\CalculatorSmallTile.scale-100_contrast-white.png" />
<Image Include="Assets\CalculatorSmallTile.scale-125_contrast-black.png" />
<Image Include="Assets\CalculatorSmallTile.scale-125_contrast-white.png" />
<Image Include="Assets\CalculatorSmallTile.scale-150_contrast-black.png" />
<Image Include="Assets\CalculatorSmallTile.scale-150_contrast-white.png" />
<Image Include="Assets\CalculatorSmallTile.scale-200_contrast-black.png" />
<Image Include="Assets\CalculatorSmallTile.scale-200_contrast-white.png" />
<Image Include="Assets\CalculatorSmallTile.scale-400_contrast-black.png" />
<Image Include="Assets\CalculatorSmallTile.scale-400_contrast-white.png" />
<Image Include="Assets\CalculatorSplashScreen.scale-100_altform-colorful.png" />
<Image Include="Assets\CalculatorSplashScreen.scale-100_contrast-black.png" />
<Image Include="Assets\CalculatorSplashScreen.scale-100_contrast-white.png" />
<Image Include="Assets\CalculatorSplashScreen.scale-125_altform-colorful.png" />
<Image Include="Assets\CalculatorSplashScreen.scale-125_contrast-black.png" />
<Image Include="Assets\CalculatorSplashScreen.scale-125_contrast-white.png" />
<Image Include="Assets\CalculatorSplashScreen.scale-150_altform-colorful.png" />
<Image Include="Assets\CalculatorSplashScreen.scale-150_contrast-black.png" />
<Image Include="Assets\CalculatorSplashScreen.scale-150_contrast-white.png" />
<Image Include="Assets\CalculatorSplashScreen.scale-200_altform-colorful.png" />
<Image Include="Assets\CalculatorSplashScreen.scale-200_contrast-black.png" />
<Image Include="Assets\CalculatorSplashScreen.scale-200_contrast-white.png" />
<Image Include="Assets\CalculatorSplashScreen.scale-400_altform-colorful.png" />
<Image Include="Assets\CalculatorSplashScreen.scale-400_contrast-black.png" />
<Image Include="Assets\CalculatorSplashScreen.scale-400_contrast-white.png" />
<Image Include="Assets\CalculatorStoreLogo.scale-100_contrast-black.png" />
<Image Include="Assets\CalculatorStoreLogo.scale-100_contrast-white.png" />
<Image Include="Assets\CalculatorStoreLogo.scale-200_contrast-black.png" />
<Image Include="Assets\CalculatorStoreLogo.scale-200_contrast-white.png" />
<Image Include="Assets\CalculatorWideTile.scale-100_contrast-black.png" />
<Image Include="Assets\CalculatorWideTile.scale-100_contrast-white.png" />
<Image Include="Assets\CalculatorWideTile.scale-125_contrast-black.png" />
<Image Include="Assets\CalculatorWideTile.scale-125_contrast-white.png" />
<Image Include="Assets\CalculatorWideTile.scale-150_contrast-black.png" />
<Image Include="Assets\CalculatorWideTile.scale-150_contrast-white.png" />
<Image Include="Assets\CalculatorWideTile.scale-200_contrast-black.png" />
<Image Include="Assets\CalculatorWideTile.scale-200_contrast-white.png" />
<Image Include="Assets\CalculatorWideTile.scale-400_contrast-black.png" />
<Image Include="Assets\CalculatorWideTile.scale-400_contrast-white.png" />
<Image Include="Assets\Date.targetsize-16_contrast-black.png" />
<Image Include="Assets\Date.targetsize-16_contrast-white.png" />
<Image Include="Assets\Date.targetsize-20_contrast-black.png" />
<Image Include="Assets\Date.targetsize-20_contrast-white.png" />
<Image Include="Assets\Date.targetsize-24_contrast-black.png" />
<Image Include="Assets\Date.targetsize-24_contrast-white.png" />
<Image Include="Assets\Date.targetsize-32_contrast-black.png" />
<Image Include="Assets\Date.targetsize-32_contrast-white.png" />
<Image Include="Assets\Date.targetsize-64_contrast-black.png" />
<Image Include="Assets\Date.targetsize-64_contrast-white.png" />
<Image Include="Assets\Graphing.targetsize-16.png" />
<Image Include="Assets\Graphing.targetsize-16_contrast-black.png" />
<Image Include="Assets\Graphing.targetsize-16_contrast-white.png" />
<Image Include="Assets\Graphing.targetsize-20.png" />
<Image Include="Assets\Graphing.targetsize-20_contrast-black.png" />
<Image Include="Assets\Graphing.targetsize-20_contrast-white.png" />
<Image Include="Assets\Graphing.targetsize-24.png" />
<Image Include="Assets\Graphing.targetsize-24_contrast-black.png" />
<Image Include="Assets\Graphing.targetsize-24_contrast-white.png" />
<Image Include="Assets\Graphing.targetsize-32.png" />
<Image Include="Assets\Graphing.targetsize-32_contrast-black.png" />
<Image Include="Assets\Graphing.targetsize-32_contrast-white.png" />
<Image Include="Assets\Graphing.targetsize-64.png" />
<Image Include="Assets\Graphing.targetsize-64_contrast-black.png" />
<Image Include="Assets\Graphing.targetsize-64_contrast-white.png" />
<Image Include="Assets\Programmer.targetsize-16_contrast-black.png" />
<Image Include="Assets\Programmer.targetsize-16_contrast-white.png" />
<Image Include="Assets\Programmer.targetsize-20_contrast-black.png" />
<Image Include="Assets\Programmer.targetsize-20_contrast-white.png" />
<Image Include="Assets\Programmer.targetsize-24_contrast-black.png" />
<Image Include="Assets\Programmer.targetsize-24_contrast-white.png" />
<Image Include="Assets\Programmer.targetsize-32_contrast-black.png" />
<Image Include="Assets\Programmer.targetsize-32_contrast-white.png" />
<Image Include="Assets\Programmer.targetsize-64_contrast-black.png" />
<Image Include="Assets\Programmer.targetsize-64_contrast-white.png" />
<Image Include="Assets\Scientific.targetsize-16_contrast-black.png" />
<Image Include="Assets\Scientific.targetsize-16_contrast-white.png" />
<Image Include="Assets\Scientific.targetsize-20_contrast-black.png" />
<Image Include="Assets\Scientific.targetsize-20_contrast-white.png" />
<Image Include="Assets\Scientific.targetsize-24_contrast-black.png" />
<Image Include="Assets\Scientific.targetsize-24_contrast-white.png" />
<Image Include="Assets\Scientific.targetsize-32_contrast-black.png" />
<Image Include="Assets\Scientific.targetsize-32_contrast-white.png" />
<Image Include="Assets\Scientific.targetsize-64_contrast-black.png" />
<Image Include="Assets\Scientific.targetsize-64_contrast-white.png" />
<Image Include="Assets\Standard.targetsize-16_contrast-black.png" />
<Image Include="Assets\Standard.targetsize-16_contrast-white.png" />
<Image Include="Assets\Standard.targetsize-20_contrast-black.png" />
<Image Include="Assets\Standard.targetsize-20_contrast-white.png" />
<Image Include="Assets\Standard.targetsize-24_contrast-black.png" />
<Image Include="Assets\Standard.targetsize-24_contrast-white.png" />
<Image Include="Assets\Standard.targetsize-32_contrast-black.png" />
<Image Include="Assets\Standard.targetsize-32_contrast-white.png" />
<Image Include="Assets\Standard.targetsize-64_contrast-black.png" />
<Image Include="Assets\Standard.targetsize-64_contrast-white.png" />
</ItemGroup>
<ItemGroup>
<Font Include="Assets\CalcMDL2.ttf">
<DeploymentContent>true</DeploymentContent>
</Font>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CalcViewModel\CalcViewModel.vcxproj">
<Project>{90e9761d-9262-4773-942d-caeae75d7140}</Project>
</ProjectReference>
<ProjectReference Include="..\GraphControl\GraphControl.vcxproj">
<Project>{e727a92b-f149-492c-8117-c039a298719b}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<!-- Override MSBuild target to workaround VS bug with building using framework packages -->
<Target Name="_GenerateAdditionalFrameworkSDKReference">
<ItemGroup>
<_IntermediateFrameworkSdkReference Include="@(AppxPackageRegistration)" Condition="'@(AppxPackageRegistration)' != ''&#xD;&#xA; AND ('$(Configuration)' == '%(AppxPackageRegistration.Configuration)' OR '%(AppxPackageRegistration.Configuration)' == '')&#xD;&#xA; AND ('$(PlatformTarget)' == '%(AppxPackageRegistration.Architecture)' OR '%(AppxPackageRegistration.Configuration)' == '')">
<SDKName Condition="%(AppxPackageRegistration.Name) != ''">%(AppxPackageRegistration.Name)</SDKName>
<SDKName Condition="%(AppxPackageRegistration.Name) == ''">%(AppxPackageRegistration.Filename)</SDKName>
<TargetedSDKConfiguration>%(AppxPackageRegistration.Configuration)</TargetedSDKConfiguration>
<TargetedSDKArchitecture>%(AppxPackageRegistration.Architecture)</TargetedSDKArchitecture>
<AppxLocation>%(AppxPackageRegistration.Identity)</AppxLocation>
</_IntermediateFrameworkSdkReference>
<FrameworkSdkReference Include="@(_IntermediateFrameworkSdkReference)">
<FrameworkIdentity>Name = %(_IntermediateFrameworkSdkReference.SDKName), MinVersion = %(_IntermediateFrameworkSdkReference.Version), Publisher = %(_IntermediateFrameworkSdkReference.Publisher)</FrameworkIdentity>
</FrameworkSdkReference>
</ItemGroup>
</Target>
<ImportGroup Label="ExtensionTargets">
<Import Project="..\..\packages\Microsoft.UI.Xaml.2.4.3\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\packages\Microsoft.UI.Xaml.2.4.3\build\native\Microsoft.UI.Xaml.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see https://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\Microsoft.UI.Xaml.2.4.3\build\native\Microsoft.UI.Xaml.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.UI.Xaml.2.4.3\build\native\Microsoft.UI.Xaml.targets'))" />
</Target>
</Project>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,260 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections;
using System.Collections.Generic;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml.Data;
namespace CalculatorApp
{
namespace Common
{
sealed class AlwaysSelectedCollectionView : Windows.UI.Xaml.DependencyObject, Windows.UI.Xaml.Data.ICollectionView
{
internal AlwaysSelectedCollectionView(IList source)
{
m_currentPosition = -1;
m_source = source;
var observable = source as Windows.UI.Xaml.Interop.IBindableObservableVector;
if (observable != null)
{
observable.VectorChanged += OnSourceBindableVectorChanged;
}
}
public bool MoveCurrentTo(object item)
{
if (item != null)
{
int newCurrentPosition = m_source.IndexOf(item);
if (newCurrentPosition != -1)
{
m_currentPosition = newCurrentPosition;
CurrentChanged?.Invoke(this, null);
return true;
}
}
// The item is not in the collection
// We're going to schedule a call back later so we
// restore the selection to the way we wanted it to begin with
if (m_currentPosition >= 0 && m_currentPosition < m_source.Count)
{
Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, new Windows.UI.Core.DispatchedHandler(() =>
{
CurrentChanged?.Invoke(this, null);
})).AsTask().Wait();
}
return false;
}
public bool MoveCurrentToPosition(int index)
{
if (index < 0 || index >= m_source.Count)
{
return false;
}
m_currentPosition = index;
CurrentChanged?.Invoke(this, null);
return true;
}
#region no implementations
public bool MoveCurrentToFirst()
{
throw new NotImplementedException();
}
public bool MoveCurrentToLast()
{
throw new NotImplementedException();
}
public bool MoveCurrentToNext()
{
throw new NotImplementedException();
}
public bool MoveCurrentToPrevious()
{
throw new NotImplementedException();
}
public IAsyncOperation<LoadMoreItemsResult> LoadMoreItemsAsync(uint count)
{
throw new NotImplementedException();
}
public void Insert(int index, object item)
{
throw new NotImplementedException();
}
public void RemoveAt(int index)
{
throw new NotImplementedException();
}
public void Add(object item)
{
throw new NotImplementedException();
}
public void Clear()
{
throw new NotImplementedException();
}
public bool Contains(object item)
{
throw new NotImplementedException();
}
public void CopyTo(object[] array, int arrayIndex)
{
throw new NotImplementedException();
}
public bool Remove(object item)
{
throw new NotImplementedException();
}
public bool IsReadOnly => throw new NotImplementedException();
#endregion no implementations
public object this[int index]
{
get
{
return m_source[index];
}
set => throw new NotImplementedException();
}
public int Count
{
get
{
return m_source.Count;
}
}
public IObservableVector<object> CollectionGroups
{
get
{
return (IObservableVector<object>)new List<object>();
}
}
public object CurrentItem
{
get
{
if (m_currentPosition >= 0 && m_currentPosition < m_source.Count)
{
return m_source[m_currentPosition];
}
return null;
}
}
public int CurrentPosition
{
get
{
return m_currentPosition;
}
}
public bool HasMoreItems
{
get
{
return false;
}
}
public bool IsCurrentAfterLast
{
get
{
return m_currentPosition >= m_source.Count;
}
}
public bool IsCurrentBeforeFirst
{
get
{
return m_currentPosition < 0;
}
}
public int IndexOf(object item)
{
return m_source.IndexOf(item);
}
public IEnumerator<object> GetEnumerator()
{
throw new NotImplementedException();
}
IEnumerator IEnumerable.GetEnumerator()
{
throw new NotImplementedException();
}
// Event handlers
void OnSourceBindableVectorChanged(Windows.UI.Xaml.Interop.IBindableObservableVector source, object e)
{
Windows.Foundation.Collections.IVectorChangedEventArgs args = (Windows.Foundation.Collections.IVectorChangedEventArgs)e;
VectorChanged?.Invoke(this, args);
}
public event EventHandler<object> CurrentChanged;
public event VectorChangedEventHandler<object> VectorChanged;
public event CurrentChangingEventHandler CurrentChanging
{
add => throw new NotImplementedException();
remove => throw new NotImplementedException();
}
IList m_source;
int m_currentPosition;
}
public sealed class AlwaysSelectedCollectionViewConverter : Windows.UI.Xaml.Data.IValueConverter
{
public AlwaysSelectedCollectionViewConverter()
{
}
public object Convert(object value, Type targetType, object parameter, string language)
{
var result = value as IList;
if (result != null)
{
return new AlwaysSelectedCollectionView(result);
}
return Windows.UI.Xaml.DependencyProperty.UnsetValue; // Can't convert
}
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
return Windows.UI.Xaml.DependencyProperty.UnsetValue;
}
}
}
}

View file

@ -1,293 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once
namespace CalculatorApp
{
namespace Common
{
ref class AlwaysSelectedCollectionView sealed : public Windows::UI::Xaml::DependencyObject, public Windows::UI::Xaml::Data::ICollectionView
{
internal : AlwaysSelectedCollectionView(Windows::UI::Xaml::Interop::IBindableVector ^ source)
: m_currentPosition(-1)
{
m_source = source;
Windows::UI::Xaml::Interop::IBindableObservableVector ^ observable =
dynamic_cast<Windows::UI::Xaml::Interop::IBindableObservableVector ^>(source);
if (observable)
{
observable->VectorChanged += ref new Windows::UI::Xaml::Interop::BindableVectorChangedEventHandler(
this, &AlwaysSelectedCollectionView::OnSourceBindableVectorChanged);
}
}
private:
// ICollectionView
// Not implemented methods
virtual Windows::Foundation::IAsyncOperation<
Windows::UI::Xaml::Data::LoadMoreItemsResult> ^ LoadMoreItemsAsync(unsigned int) = Windows::UI::Xaml::Data::ICollectionView::LoadMoreItemsAsync
{
throw ref new Platform::NotImplementedException();
}
virtual bool MoveCurrentToFirst() = Windows::UI::Xaml::Data::ICollectionView::MoveCurrentToFirst
{
throw ref new Platform::NotImplementedException();
}
virtual bool MoveCurrentToLast() = Windows::UI::Xaml::Data::ICollectionView::MoveCurrentToLast
{
throw ref new Platform::NotImplementedException();
}
virtual bool MoveCurrentToNext() = Windows::UI::Xaml::Data::ICollectionView::MoveCurrentToNext
{
throw ref new Platform::NotImplementedException();
}
virtual bool MoveCurrentToPrevious() = Windows::UI::Xaml::Data::ICollectionView::MoveCurrentToPrevious
{
throw ref new Platform::NotImplementedException();
}
property Windows::Foundation::Collections::IObservableVector<Platform::Object ^> ^ CollectionGroups {
virtual Windows::Foundation::Collections::IObservableVector<
Platform::Object ^> ^ get() = Windows::UI::Xaml::Data::ICollectionView::CollectionGroups::get
{
return ref new Platform::Collections::Vector<Platform::Object ^>();
}
} property bool HasMoreItems
{
virtual bool get() = Windows::UI::Xaml::Data::ICollectionView::HasMoreItems::get
{
return false;
}
}
// Implementented methods
virtual bool MoveCurrentTo(Platform::Object ^ item) = Windows::UI::Xaml::Data::ICollectionView::MoveCurrentTo
{
if (item)
{
unsigned int newCurrentPosition = 0;
bool result = m_source->IndexOf(item, &newCurrentPosition);
if (result)
{
m_currentPosition = newCurrentPosition;
m_currentChanged(this, nullptr);
return true;
}
}
// The item is not in the collection
// We're going to schedule a call back later so we
// restore the selection to the way we wanted it to begin with
if (m_currentPosition >= 0 && m_currentPosition < static_cast<int>(m_source->Size))
{
this->Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new Windows::UI::Core::DispatchedHandler([this]() {
m_currentChanged(this, nullptr);
}));
}
return false;
}
virtual bool MoveCurrentToPosition(int index) = Windows::UI::Xaml::Data::ICollectionView::MoveCurrentToPosition
{
if (index < 0 || index >= static_cast<int>(m_source->Size))
{
return false;
}
m_currentPosition = index;
m_currentChanged(this, nullptr);
return true;
}
property Platform::Object^ CurrentItem
{
virtual Platform::Object^ get() = Windows::UI::Xaml::Data::ICollectionView::CurrentItem::get
{
if (m_currentPosition >= 0 && m_currentPosition < static_cast<int>(m_source->Size))
{
return m_source->GetAt(m_currentPosition);
}
return nullptr;
}
}
property int CurrentPosition
{
virtual int get() = Windows::UI::Xaml::Data::ICollectionView::CurrentPosition::get
{
return m_currentPosition;
}
}
property bool IsCurrentAfterLast
{
virtual bool get() = Windows::UI::Xaml::Data::ICollectionView::IsCurrentAfterLast::get
{
return m_currentPosition >= static_cast<int>(m_source->Size);
}
}
property bool IsCurrentBeforeFirst
{
virtual bool get() = Windows::UI::Xaml::Data::ICollectionView::IsCurrentBeforeFirst::get
{
return m_currentPosition < 0;
}
}
event Windows::Foundation::EventHandler<Platform::Object^>^ CurrentChanged
{
virtual Windows::Foundation::EventRegistrationToken add(Windows::Foundation::EventHandler<Platform::Object^>^ handler) = Windows::UI::Xaml::Data::ICollectionView::CurrentChanged::add
{
return m_currentChanged += handler;
}
virtual void remove(Windows::Foundation::EventRegistrationToken token) = Windows::UI::Xaml::Data::ICollectionView::CurrentChanged::remove
{
m_currentChanged -= token;
}
}
event Windows::UI::Xaml::Data::CurrentChangingEventHandler^ CurrentChanging
{
virtual Windows::Foundation::EventRegistrationToken add(Windows::UI::Xaml::Data::CurrentChangingEventHandler^ handler) = Windows::UI::Xaml::Data::ICollectionView::CurrentChanging::add
{
return m_currentChanging += handler;
}
virtual void remove(Windows::Foundation::EventRegistrationToken token) = Windows::UI::Xaml::Data::ICollectionView::CurrentChanging::remove
{
m_currentChanging -= token;
}
}
// IVector<Object^>
// Not implemented methods
virtual void Append(Platform::Object^ /*item*/) = Windows::Foundation::Collections::IVector<Platform::Object^>::Append
{
throw ref new Platform::NotImplementedException();
}
virtual void Clear() = Windows::Foundation::Collections::IVector<Platform::Object ^>::Clear
{
throw ref new Platform::NotImplementedException();
}
virtual unsigned int GetMany(
unsigned int /*startIndex*/,
Platform::WriteOnlyArray<Platform::Object ^> ^ /*items*/) = Windows::Foundation::Collections::IVector<Platform::Object ^>::GetMany
{
throw ref new Platform::NotImplementedException();
}
virtual Windows::Foundation::Collections::IVectorView<Platform::Object ^> ^ GetView() = Windows::Foundation::Collections::IVector<
Platform::Object ^>::GetView
{
throw ref new Platform::NotImplementedException();
}
virtual void InsertAt(unsigned int /*index*/, Platform::Object ^ /*item*/) = Windows::Foundation::Collections::IVector<Platform::Object ^>::InsertAt
{
throw ref new Platform::NotImplementedException();
}
virtual void RemoveAt(unsigned int /*index*/) = Windows::Foundation::Collections::IVector<Platform::Object ^>::RemoveAt
{
throw ref new Platform::NotImplementedException();
}
virtual void RemoveAtEnd() = Windows::Foundation::Collections::IVector<Platform::Object ^>::RemoveAtEnd
{
throw ref new Platform::NotImplementedException();
}
virtual void
ReplaceAll(const Platform::Array<Platform::Object ^> ^ /*items*/) = Windows::Foundation::Collections::IVector<Platform::Object ^>::ReplaceAll
{
throw ref new Platform::NotImplementedException();
}
virtual void SetAt(unsigned int /*index*/, Platform::Object ^ /*item*/) = Windows::Foundation::Collections::IVector<Platform::Object ^>::SetAt
{
throw ref new Platform::NotImplementedException();
}
// Implemented methods
virtual Platform::Object ^ GetAt(unsigned int index) = Windows::Foundation::Collections::IVector<Platform::Object ^>::GetAt
{
return m_source->GetAt(index);
}
virtual bool IndexOf(Platform::Object ^ item, unsigned int* index) = Windows::Foundation::Collections::IVector<Platform::Object ^>::IndexOf
{
return m_source->IndexOf(item, index);
}
property unsigned int Size
{
virtual unsigned int get() = Windows::Foundation::Collections::IVector<Platform::Object ^>::Size::get
{
return m_source->Size;
}
}
// IObservableVector<Object^>
event Windows::Foundation::Collections::VectorChangedEventHandler<Platform::Object^>^ VectorChanged
{
virtual Windows::Foundation::EventRegistrationToken add(Windows::Foundation::Collections::VectorChangedEventHandler<Platform::Object^>^ handler) = Windows::Foundation::Collections::IObservableVector<Platform::Object^>::VectorChanged::add
{
return m_vectorChanged += handler;
}
virtual void remove(Windows::Foundation::EventRegistrationToken token) = Windows::Foundation::Collections::IObservableVector<Platform::Object^>::VectorChanged::remove
{
m_vectorChanged -= token;
}
}
// IIterable<Object^>
// Not implemented
virtual Windows::Foundation::Collections::IIterator<Platform::Object^>^ First() = Windows::Foundation::Collections::IIterable<Platform::Object^>::First
{
throw ref new Platform::NotImplementedException();
}
// Event handlers
void OnSourceBindableVectorChanged(Windows::UI::Xaml::Interop::IBindableObservableVector ^ source, Platform::Object ^ e)
{
Windows::Foundation::Collections::IVectorChangedEventArgs ^ args = safe_cast<Windows::Foundation::Collections::IVectorChangedEventArgs ^>(e);
m_vectorChanged(this, args);
}
Windows::UI::Xaml::Interop::IBindableVector ^ m_source;
int m_currentPosition;
event Windows::Foundation::EventHandler<Platform::Object ^> ^ m_currentChanged;
event Windows::UI::Xaml::Data::CurrentChangingEventHandler ^ m_currentChanging;
event Windows::Foundation::Collections::VectorChangedEventHandler<Platform::Object ^> ^ m_vectorChanged;
};
public
ref class AlwaysSelectedCollectionViewConverter sealed : public Windows::UI::Xaml::Data::IValueConverter
{
public:
AlwaysSelectedCollectionViewConverter()
{
}
private:
virtual Platform::Object
^ Convert(
Platform::Object ^ value,
Windows::UI::Xaml::Interop::TypeName /*targetType*/,
Platform::Object ^ /*parameter*/,
Platform::String ^ /*language*/) = Windows::UI::Xaml::Data::IValueConverter::Convert
{
auto result = dynamic_cast<Windows::UI::Xaml::Interop::IBindableVector ^>(value);
if (result)
{
return ref new AlwaysSelectedCollectionView(result);
}
return Windows::UI::Xaml::DependencyProperty::UnsetValue; // Can't convert
}
virtual Platform::Object
^ ConvertBack(
Platform::Object ^ /*value*/,
Windows::UI::Xaml::Interop::TypeName /*targetType*/,
Platform::Object ^ /*parameter*/,
Platform::String ^ /*language*/) = Windows::UI::Xaml::Data::IValueConverter::ConvertBack
{
return Windows::UI::Xaml::DependencyProperty::UnsetValue;
}
};
}
}

View file

@ -1,149 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "pch.h"
#include "AppLifecycleLogger.h"
#include <winmeta.h>
using namespace std;
using namespace winrt;
using namespace winrt::Windows::ApplicationModel;
using namespace winrt::Windows::ApplicationModel::Background;
using namespace winrt::Windows::ApplicationModel::Core;
using namespace winrt::Windows::Foundation::Diagnostics;
using namespace winrt::Windows::UI::ViewManagement;
namespace CalculatorApp
{
#ifdef SEND_DIAGNOSTICS
// c.f. WINEVENT_KEYWORD_RESERVED_63-56 0xFF00000000000000 // Bits 63-56 - channel keywords
// c.f. WINEVENT_KEYWORD_* 0x00FF000000000000 // Bits 55-48 - system-reserved keywords
constexpr int64_t MICROSOFT_KEYWORD_LEVEL_1 = 0x0000800000000000; // Bit 47
constexpr int64_t MICROSOFT_KEYWORD_LEVEL_2 = 0x0000400000000000; // Bit 46
constexpr int64_t MICROSOFT_KEYWORD_LEVEL_3 = 0x0000200000000000; // Bit 45
constexpr int64_t MICROSOFT_KEYWORD_RESERVED_44 = 0x0000100000000000; // Bit 44 (reserved for future assignment)
#else
// define all Keyword options as 0 when we do not want to upload app diagnostics
constexpr int64_t MICROSOFT_KEYWORD_LEVEL_1 = 0;
constexpr int64_t MICROSOFT_KEYWORD_LEVEL_2 = 0;
constexpr int64_t MICROSOFT_KEYWORD_LEVEL_3 = 0;
constexpr int64_t MICROSOFT_KEYWORD_RESERVED_44 = 0;
#endif
#pragma region TraceLogger setup and cleanup
AppLifecycleLogger::AppLifecycleLogger()
: m_appLifecycleProvider(
L"Microsoft.Windows.AppLifeCycle",
LoggingChannelOptions(GUID{ 0x4f50731a, 0x89cf, 0x4782, 0xb3, 0xe0, 0xdc, 0xe8, 0xc9, 0x4, 0x76, 0xba }),
GUID{ 0xef00584a, 0x2655, 0x462c, 0xbc, 0x24, 0xe7, 0xde, 0x63, 0xe, 0x7f, 0xbf }) // Unique provider ID {EF00584A-2655-462C-BC24-E7DE630E7FBF}
{
}
AppLifecycleLogger::~AppLifecycleLogger()
{
}
AppLifecycleLogger& AppLifecycleLogger::GetInstance()
{
static AppLifecycleLogger s_selfInstance;
return s_selfInstance;
}
bool AppLifecycleLogger::GetTraceLoggingProviderEnabled() const
{
return m_appLifecycleProvider.Enabled();
}
#pragma region Tracing methods
void AppLifecycleLogger::LogAppLifecycleEvent(hstring const& eventName, LoggingFields const& fields) const
{
m_appLifecycleProvider.LogEvent(
eventName, fields, LoggingLevel::Information, LoggingOptions(MICROSOFT_KEYWORD_LEVEL_3 | WINEVENT_KEYWORD_RESPONSE_TIME));
}
#pragma endregion
void AppLifecycleLogger::LaunchUIResponsive() const
{
if (!GetTraceLoggingProviderEnabled())
return;
LoggingFields fields{};
PopulateAppInfo(fields);
LogAppLifecycleEvent(L"ModernAppLaunch_UIResponsive", fields);
}
void AppLifecycleLogger::LaunchVisibleComplete() const
{
if (!GetTraceLoggingProviderEnabled())
return;
LoggingFields fields{};
PopulateAppInfo(fields);
LogAppLifecycleEvent(L"ModernAppLaunch_VisibleComplete", fields);
}
void AppLifecycleLogger::ResumeUIResponsive() const
{
if (!GetTraceLoggingProviderEnabled())
return;
LoggingFields fields{};
PopulateAppInfo(fields);
LogAppLifecycleEvent(L"ModernAppResume_UIResponsive", fields);
}
void AppLifecycleLogger::ResumeVisibleComplete() const
{
if (!GetTraceLoggingProviderEnabled())
return;
LoggingFields fields{};
PopulateAppInfo(fields);
LogAppLifecycleEvent(L"ModernAppResume_VisibleComplete", fields);
}
void AppLifecycleLogger::ResizeUIResponsive() const
{
ResizeUIResponsive(ApplicationView::GetForCurrentView().Id());
}
void AppLifecycleLogger::ResizeUIResponsive(int32_t viewId) const
{
if (!GetTraceLoggingProviderEnabled())
return;
LoggingFields fields{};
PopulateAppInfo(fields);
fields.AddInt32(L"ViewId", viewId);
LogAppLifecycleEvent(L"ModernAppResize_UIResponsive", fields);
}
void AppLifecycleLogger::ResizeVisibleComplete() const
{
ResizeVisibleComplete(ApplicationView::GetForCurrentView().Id());
}
void AppLifecycleLogger::ResizeVisibleComplete(int32_t viewId) const
{
if (!GetTraceLoggingProviderEnabled())
return;
LoggingFields fields{};
PopulateAppInfo(fields);
fields.AddInt32(L"ViewId", viewId);
LogAppLifecycleEvent(L"ModernAppResize_VisibleComplete", fields);
}
void AppLifecycleLogger::PopulateAppInfo(LoggingFields& fields) const
{
auto appId = CoreApplication::Id();
auto aumId = Package::Current().Id().FamilyName() + L"!" + appId;
auto packageFullName = Package::Current().Id().FullName();
auto psmKey = Package::Current().Id().FullName() + L"+" + appId;
fields.AddString(L"AumId", aumId);
fields.AddString(L"PackageFullName", packageFullName);
fields.AddString(L"PsmKey", psmKey);
}
}

View file

@ -0,0 +1,152 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using CalculatorApp.ViewModel.Common;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Core;
using Windows.Foundation.Diagnostics;
using Windows.UI.ViewManagement;
namespace CalculatorApp
{
static public partial class Globals
{
#if SEND_DIAGNOSTICS
// c.f. WINEVENT_KEYWORD_RESERVED_63-56 0xFF00000000000000 // Bits 63-56 - channel keywords
// c.f. WINEVENT_KEYWORD_* 0x00FF000000000000 // Bits 55-48 - system-reserved keywords
public const long MICROSOFT_KEYWORD_LEVEL_1 = 0x0000800000000000; // Bit 47
public const long MICROSOFT_KEYWORD_LEVEL_2 = 0x0000400000000000; // Bit 46
public const long MICROSOFT_KEYWORD_LEVEL_3 = 0x0000200000000000; // Bit 45
public const long MICROSOFT_KEYWORD_RESERVED_44 = 0x0000100000000000; // Bit 44 (reserved for future assignment)
#else
// define all Keyword options as 0 when we do not want to upload app diagnostics
public const long MICROSOFT_KEYWORD_LEVEL_1 = 0;
public const long MICROSOFT_KEYWORD_LEVEL_2 = 0;
public const long MICROSOFT_KEYWORD_LEVEL_3 = 0;
public const long MICROSOFT_KEYWORD_RESERVED_44 = 0;
#endif
}
class AppLifecycleLogger
{
public static AppLifecycleLogger GetInstance()
{
return s_selfInstance.Value;
}
public bool GetTraceLoggingProviderEnabled()
{
return m_appLifecycleProvider.Enabled;
}
public void LaunchUIResponsive()
{
if (!GetTraceLoggingProviderEnabled())
return;
LoggingFields fields = new LoggingFields();
PopulateAppInfo(fields);
LogAppLifecycleEvent("ModernAppLaunch_UIResponsive", fields);
}
public void LaunchVisibleComplete()
{
if (!GetTraceLoggingProviderEnabled())
return;
LoggingFields fields = new LoggingFields();
PopulateAppInfo(fields);
LogAppLifecycleEvent("ModernAppLaunch_VisibleComplete", fields);
}
public void ResumeUIResponsive()
{
if (!GetTraceLoggingProviderEnabled())
return;
LoggingFields fields = new LoggingFields();
PopulateAppInfo(fields);
LogAppLifecycleEvent("ModernAppResume_UIResponsive", fields);
}
public void ResumeVisibleComplete()
{
if (!GetTraceLoggingProviderEnabled())
return;
LoggingFields fields = new LoggingFields();
PopulateAppInfo(fields);
LogAppLifecycleEvent("ModernAppResume_VisibleComplete", fields);
}
public void ResizeUIResponsive()
{
ResizeUIResponsive(ApplicationView.GetForCurrentView().Id);
}
public void ResizeVisibleComplete()
{
ResizeVisibleComplete(ApplicationView.GetForCurrentView().Id);
}
public void ResizeUIResponsive(int viewId)
{
if (!GetTraceLoggingProviderEnabled())
return;
LoggingFields fields = new LoggingFields();
PopulateAppInfo(fields);
fields.AddInt32("ViewId", viewId);
LogAppLifecycleEvent("ModernAppResize_UIResponsive", fields);
}
public void ResizeVisibleComplete(int viewId)
{
if (!GetTraceLoggingProviderEnabled())
return;
LoggingFields fields = new LoggingFields();
PopulateAppInfo(fields);
fields.AddInt32("ViewId", viewId);
LogAppLifecycleEvent("ModernAppResize_VisibleComplete", fields);
}
// Make the object construction private to allow singleton access to this class
private AppLifecycleLogger()
{
m_appLifecycleProvider = new LoggingChannel(
"Microsoft.Windows.AppLifeCycle",
new LoggingChannelOptions(new Guid(0x4f50731a, 0x89cf, 0x4782, 0xb3, 0xe0, 0xdc, 0xe8, 0xc9, 0x4, 0x76, 0xba)),
new Guid(0xef00584a, 0x2655, 0x462c, 0xbc, 0x24, 0xe7, 0xde, 0x63, 0xe, 0x7f, 0xbf));
}
// Any new Log method should
// a) Decide the level of logging. This will help us in limiting recording of events only up to a certain level. See this link for guidance
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa363742(v=vs.85).aspx We're using Verbose level for events that are called frequently and
// needed only for debugging or capturing perf for specific scenarios b) Should decide whether or not to log to diagnostics and pass
// TraceLoggingKeyword(MICROSOFT_KEYWORD_LEVEL_3) accordingly c) Should accept a variable number of additional data arguments if needed
private void LogAppLifecycleEvent(string eventName, LoggingFields fields)
{
m_appLifecycleProvider.LogEvent(
eventName, fields, LoggingLevel.Information, new LoggingOptions(Globals.MICROSOFT_KEYWORD_LEVEL_3 | Utilities.GetConst_WINEVENT_KEYWORD_RESPONSE_TIME()));
}
private void PopulateAppInfo(LoggingFields fields)
{
var appId = CoreApplication.Id;
var aumId = Package.Current.Id.FamilyName + "!" + appId;
var packageFullName = Package.Current.Id.FullName;
var psmKey = Package.Current.Id.FullName + "+" + appId;
fields.AddString("AumId", aumId);
fields.AddString("PackageFullName", packageFullName);
fields.AddString("PsmKey", psmKey);
}
private LoggingChannel m_appLifecycleProvider;
private static readonly Lazy<AppLifecycleLogger> s_selfInstance = new Lazy<AppLifecycleLogger>(() => new AppLifecycleLogger(), true);
}
}

View file

@ -1,41 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once
namespace CalculatorApp
{
class AppLifecycleLogger
{
public:
AppLifecycleLogger(AppLifecycleLogger const&) = delete;
AppLifecycleLogger const& operator=(AppLifecycleLogger const&) = delete;
~AppLifecycleLogger();
static AppLifecycleLogger& GetInstance();
bool GetTraceLoggingProviderEnabled() const;
void LaunchUIResponsive() const;
void LaunchVisibleComplete() const;
void ResumeUIResponsive() const;
void ResumeVisibleComplete() const;
void ResizeUIResponsive() const;
void ResizeVisibleComplete() const;
void ResizeUIResponsive(int32_t viewId) const;
void ResizeVisibleComplete(int32_t viewId) const;
private:
// Make the object construction private to allow singleton access to this class
AppLifecycleLogger();
// Any new Log method should
// a) Decide the level of logging. This will help us in limiting recording of events only up to a certain level. See this link for guidance
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa363742(v=vs.85).aspx We're using Verbose level for events that are called frequently and
// needed only for debugging or capturing perf for specific scenarios b) Should decide whether or not to log to diagnostics and pass
// TraceLoggingKeyword(MICROSOFT_KEYWORD_LEVEL_3) accordingly c) Should accept a variable number of additional data arguments if needed
void LogAppLifecycleEvent(winrt::hstring const& eventName, winrt::Windows::Foundation::Diagnostics::LoggingFields const& fields) const;
void PopulateAppInfo(winrt::Windows::Foundation::Diagnostics::LoggingFields& fields) const;
winrt::Windows::Foundation::Diagnostics::LoggingChannel m_appLifecycleProvider;
};
}

View file

@ -0,0 +1,832 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using CalculatorApp.ViewModel;
using CalculatorApp.ViewModel.Common;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using Windows.Foundation.Collections;
using Windows.UI.Core;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using MUXC = Microsoft.UI.Xaml.Controls;
namespace CalculatorApp
{
namespace Common
{
static partial class KeyboardShortcutManagerLocals
{
// Lights up all of the buttons in the given range
// The range is defined by a pair of iterators
static public void LightUpButtons(IEnumerable<WeakReference> buttons)
{
foreach (var button in buttons)
{
var btn = button.Target as ButtonBase;
if (btn != null && btn.IsEnabled)
{
LightUpButton(btn);
}
}
}
static public void LightUpButton(ButtonBase button)
{
// If the button is a toggle button then we don't need
// to change the UI of the button
if (button is ToggleButton)
{
return;
}
// The button will go into the visual Pressed state with this call
VisualStateManager.GoToState(button, "Pressed", true);
// This timer will fire after lightUpTime and make the button
// go back to the normal state.
// This timer will only fire once after which it will be destroyed
var timer = new DispatcherTimer();
TimeSpan lightUpTime = TimeSpan.FromMilliseconds(50); // 5e5 100-ns
timer.Interval = lightUpTime;
var timerWeakReference = new WeakReference(timer);
var buttonWeakReference = new WeakReference(button);
timer.Tick += (sender, args) =>
{
var btn = buttonWeakReference.Target as ButtonBase;
if (btn != null)
{
VisualStateManager.GoToState(button, "Normal", true);
}
var tmr = timerWeakReference.Target as DispatcherTimer;
if (tmr != null)
{
tmr.Stop();
}
};
timer.Start();
}
// Looks for the first button reference that it can resolve
// and execute its command.
// NOTE: It is assumed that all buttons associated with a particular
// key have the same command
static public void RunFirstEnabledButtonCommand(IEnumerable<WeakReference> buttons)
{
foreach (var button in buttons)
{
var btn = button.Target as ButtonBase;
if (btn != null && btn.IsEnabled)
{
RunButtonCommand(btn);
break;
}
}
}
static public void RunButtonCommand(ButtonBase button)
{
if (button.IsEnabled)
{
var command = button.Command;
var parameter = button.CommandParameter;
if (command != null && command.CanExecute(parameter))
{
command.Execute(parameter);
}
var radio = (button as RadioButton);
if (radio != null)
{
radio.IsChecked = true;
return;
}
var toggle = (button as ToggleButton);
if (toggle != null)
{
toggle.IsChecked = !(toggle.IsChecked != null && toggle.IsChecked.Value);
return;
}
}
}
}
public sealed class KeyboardShortcutManager : DependencyObject
{
public KeyboardShortcutManager()
{
}
public static readonly DependencyProperty CharacterProperty =
DependencyProperty.RegisterAttached(
"Character",
typeof(string),
typeof(KeyboardShortcutManager),
new PropertyMetadata(string.Empty, (sender, args) =>
{
OnCharacterPropertyChanged(sender, (string)args.OldValue, (string)args.NewValue);
}));
public static string GetCharacter(DependencyObject target)
{
return (string)target.GetValue(CharacterProperty);
}
public static void SetCharacter(DependencyObject target, string value)
{
target.SetValue(CharacterProperty, value);
}
public static readonly DependencyProperty VirtualKeyProperty =
DependencyProperty.RegisterAttached(
"VirtualKey",
typeof(MyVirtualKey),
typeof(KeyboardShortcutManager),
new PropertyMetadata(default(MyVirtualKey), (sender, args) =>
{
OnVirtualKeyPropertyChanged(sender, (MyVirtualKey)args.OldValue, (MyVirtualKey)args.NewValue);
}));
public static MyVirtualKey GetVirtualKey(DependencyObject target)
{
return (MyVirtualKey)target.GetValue(VirtualKeyProperty);
}
public static void SetVirtualKey(DependencyObject target, MyVirtualKey value)
{
target.SetValue(VirtualKeyProperty, value);
}
public static readonly DependencyProperty VirtualKeyControlChordProperty =
DependencyProperty.RegisterAttached(
"VirtualKey",
typeof(MyVirtualKey),
typeof(KeyboardShortcutManager),
new PropertyMetadata(default(MyVirtualKey), (sender, args) =>
{
OnVirtualKeyControlChordPropertyChanged(sender, (MyVirtualKey)args.OldValue, (MyVirtualKey)args.NewValue);
}));
public static MyVirtualKey GetVirtualKeyControlChord(DependencyObject target)
{
return (MyVirtualKey)target.GetValue(VirtualKeyControlChordProperty);
}
public static void SetVirtualKeyControlChord(DependencyObject target, MyVirtualKey value)
{
target.SetValue(VirtualKeyControlChordProperty, value);
}
public static readonly DependencyProperty VirtualKeyShiftChordProperty =
DependencyProperty.RegisterAttached(
"VirtualKey",
typeof(MyVirtualKey),
typeof(KeyboardShortcutManager),
new PropertyMetadata(default(MyVirtualKey), (sender, args) =>
{
OnVirtualKeyShiftChordPropertyChanged(sender, (MyVirtualKey)args.OldValue, (MyVirtualKey)args.NewValue);
}));
public static MyVirtualKey GetVirtualKeyShiftChord(DependencyObject target)
{
return (MyVirtualKey)target.GetValue(VirtualKeyShiftChordProperty);
}
public static void SetVirtualKeyShiftChord(DependencyObject target, MyVirtualKey value)
{
target.SetValue(VirtualKeyShiftChordProperty, value);
}
public static readonly DependencyProperty VirtualKeyAltChordProperty =
DependencyProperty.RegisterAttached(
"VirtualKey",
typeof(MyVirtualKey),
typeof(KeyboardShortcutManager),
new PropertyMetadata(default(MyVirtualKey), (sender, args) =>
{
OnVirtualKeyAltChordPropertyChanged(sender, (MyVirtualKey)args.OldValue, (MyVirtualKey)args.NewValue);
}));
public static MyVirtualKey GetVirtualKeyAltChord(DependencyObject target)
{
return (MyVirtualKey)target.GetValue(VirtualKeyAltChordProperty);
}
public static void SetVirtualKeyAltChord(DependencyObject target, MyVirtualKey value)
{
target.SetValue(VirtualKeyAltChordProperty, value);
}
public static readonly DependencyProperty VirtualKeyControlShiftChordProperty =
DependencyProperty.RegisterAttached(
"VirtualKey",
typeof(MyVirtualKey),
typeof(KeyboardShortcutManager),
new PropertyMetadata(default(MyVirtualKey), (sender, args) =>
{
OnVirtualKeyControlShiftChordPropertyChanged(sender, (MyVirtualKey)args.OldValue, (MyVirtualKey)args.NewValue);
}));
public static MyVirtualKey GetVirtualKeyControlShiftChord(DependencyObject target)
{
return (MyVirtualKey)target.GetValue(VirtualKeyControlShiftChordProperty);
}
public static void SetVirtualKeyControlShiftChord(DependencyObject target, MyVirtualKey value)
{
target.SetValue(VirtualKeyControlShiftChordProperty, value);
}
internal static void Initialize()
{
var coreWindow = Window.Current.CoreWindow;
coreWindow.CharacterReceived += OnCharacterReceivedHandler;
coreWindow.KeyDown += OnKeyDownHandler;
coreWindow.Dispatcher.AcceleratorKeyActivated += OnAcceleratorKeyActivated;
KeyboardShortcutManager.RegisterNewAppViewId();
}
// Sometimes, like with popups, escape is treated as special and even
// though it is handled we get it passed through to us. In those cases
// we need to be able to ignore it (looking at e->Handled isn't sufficient
// because that always returns true).
// The onlyOnce flag is used to indicate whether we should only ignore the
// next escape, or keep ignoring until you explicitly HonorEscape.
public static void IgnoreEscape(bool onlyOnce)
{
// Writer lock for the static maps
lock (s_keyboardShortcutMapLockMutex)
{
int viewId = Utilities.GetWindowId();
if (s_ignoreNextEscape.ContainsKey(viewId))
{
s_ignoreNextEscape[viewId] = true;
}
if (s_keepIgnoringEscape.ContainsKey(viewId))
{
s_keepIgnoringEscape[viewId] = !onlyOnce;
}
}
}
public static void HonorEscape()
{
// Writer lock for the static maps
lock (s_keyboardShortcutMapLockMutex)
{
int viewId = Utilities.GetWindowId();
if (s_ignoreNextEscape.ContainsKey(viewId))
{
s_ignoreNextEscape[viewId] = false;
}
if (s_keepIgnoringEscape.ContainsKey(viewId))
{
s_keepIgnoringEscape[viewId] = false;
}
}
}
public static void HonorShortcuts(bool allow)
{
// Writer lock for the static maps
lock (s_keyboardShortcutMapLockMutex)
{
int viewId = Utilities.GetWindowId();
if (s_fHonorShortcuts.ContainsKey(viewId))
{
if (s_fDisableShortcuts.ContainsKey(viewId))
{
if (s_fDisableShortcuts[viewId])
{
s_fHonorShortcuts[viewId] = false;
return;
}
}
s_fHonorShortcuts[viewId] = allow;
}
}
}
public static void DisableShortcuts(bool disable)
{
int viewId = Utilities.GetWindowId();
if (s_fDisableShortcuts.ContainsKey(viewId))
{
s_fDisableShortcuts[viewId] = disable;
}
HonorShortcuts(!disable);
}
public static void UpdateDropDownState(bool isOpen)
{
int viewId = Utilities.GetWindowId();
if (s_IsDropDownOpen.ContainsKey(viewId))
{
s_IsDropDownOpen[viewId] = isOpen;
}
}
public static void RegisterNewAppViewId()
{
// Writer lock for the static maps
lock (s_keyboardShortcutMapLockMutex)
{
int appViewId = Utilities.GetWindowId();
// Check if the View Id has already been registered
if (!s_characterForButtons.ContainsKey(appViewId))
{
s_characterForButtons.Add(appViewId, new SortedDictionary<char, List<WeakReference>>());
}
if (!s_virtualKey.ContainsKey(appViewId))
{
s_virtualKey.Add(appViewId, new SortedDictionary<MyVirtualKey, List<WeakReference>>());
}
if (!s_VirtualKeyControlChordsForButtons.ContainsKey(appViewId))
{
s_VirtualKeyControlChordsForButtons.Add(appViewId, new SortedDictionary<MyVirtualKey, List<WeakReference>>());
}
if (!s_VirtualKeyShiftChordsForButtons.ContainsKey(appViewId))
{
s_VirtualKeyShiftChordsForButtons.Add(appViewId, new SortedDictionary<MyVirtualKey, List<WeakReference>>());
}
if (!s_VirtualKeyAltChordsForButtons.ContainsKey(appViewId))
{
s_VirtualKeyAltChordsForButtons.Add(appViewId, new SortedDictionary<MyVirtualKey, List<WeakReference>>());
}
if (!s_VirtualKeyControlShiftChordsForButtons.ContainsKey(appViewId))
{
s_VirtualKeyControlShiftChordsForButtons.Add(appViewId, new SortedDictionary<MyVirtualKey, List<WeakReference>>());
}
s_IsDropDownOpen[appViewId] = false;
s_ignoreNextEscape[appViewId] = false;
s_keepIgnoringEscape[appViewId] = false;
s_fHonorShortcuts[appViewId] = true;
s_fDisableShortcuts[appViewId] = false;
}
}
public static void OnWindowClosed(int viewId)
{
// Writer lock for the static maps
lock (s_keyboardShortcutMapLockMutex)
{
s_characterForButtons.Remove(viewId);
s_virtualKey.Remove(viewId);
s_VirtualKeyControlChordsForButtons.Remove(viewId);
s_VirtualKeyShiftChordsForButtons.Remove(viewId);
s_VirtualKeyAltChordsForButtons.Remove(viewId);
s_VirtualKeyControlShiftChordsForButtons.Remove(viewId);
s_IsDropDownOpen.Remove(viewId);
s_ignoreNextEscape.Remove(viewId);
s_keepIgnoringEscape.Remove(viewId);
s_fHonorShortcuts.Remove(viewId);
s_fDisableShortcuts.Remove(viewId);
}
}
private static void OnCharacterPropertyChanged(DependencyObject target, string oldValue, string newValue)
{
// Writer lock for the static maps
lock (s_keyboardShortcutMapLockMutex)
{
var button = (target as ButtonBase);
int viewId = Utilities.GetWindowId();
if (s_characterForButtons.TryGetValue(viewId, out var iterViewMap))
{
if (!string.IsNullOrEmpty(oldValue))
{
iterViewMap.Remove(oldValue[0]);
}
if (!string.IsNullOrEmpty(newValue))
{
if (newValue == ".")
{
char decSep = LocalizationSettings.GetInstance().GetDecimalSeparator();
Insert(iterViewMap, decSep, new WeakReference(button));
}
else
{
Insert(iterViewMap, newValue[0], new WeakReference(button));
}
}
}
else
{
s_characterForButtons.Add(viewId, new SortedDictionary<char, List<WeakReference>>());
if (newValue == ".")
{
char decSep = LocalizationSettings.GetInstance().GetDecimalSeparator();
Insert(s_characterForButtons[viewId], decSep, new WeakReference(button));
}
else
{
Insert(s_characterForButtons[viewId], newValue[0], new WeakReference(button));
}
}
}
}
private static void OnVirtualKeyPropertyChanged(DependencyObject target, MyVirtualKey oldValue, MyVirtualKey newValue)
{
// Writer lock for the static maps
lock (s_keyboardShortcutMapLockMutex)
{
var button = ((ButtonBase)target);
int viewId = Utilities.GetWindowId();
// Check if the View Id has already been registered
if (s_virtualKey.TryGetValue(viewId, out var iterViewMap))
{
Insert(iterViewMap, newValue, new WeakReference(button));
}
else
{
// If the View Id is not already registered, then register it and make the entry
s_virtualKey.Add(viewId, new SortedDictionary<MyVirtualKey, List<WeakReference>>());
Insert(s_virtualKey[viewId], newValue, new WeakReference(button));
}
}
}
private static void OnVirtualKeyControlChordPropertyChanged(DependencyObject target, MyVirtualKey oldValue, MyVirtualKey newValue)
{
// Writer lock for the static maps
lock (s_keyboardShortcutMapLockMutex)
{
Control control = (target as ButtonBase);
if (control == null)
{
// Handling Ctrl+E shortcut for Date Calc, target would be NavigationView^ in that case
control = (target as MUXC.NavigationView);
}
int viewId = Utilities.GetWindowId();
// Check if the View Id has already been registered
if (s_VirtualKeyControlChordsForButtons.TryGetValue(viewId, out var iterViewMap))
{
Insert(iterViewMap, newValue, new WeakReference(control));
}
else
{
// If the View Id is not already registered, then register it and make the entry
s_VirtualKeyControlChordsForButtons.Add(viewId, new SortedDictionary<MyVirtualKey, List<WeakReference>>());
Insert(s_VirtualKeyControlChordsForButtons[viewId], newValue, new WeakReference(control));
}
}
}
private static void OnVirtualKeyShiftChordPropertyChanged(DependencyObject target, MyVirtualKey oldValue, MyVirtualKey newValue)
{
// Writer lock for the static maps
lock (s_keyboardShortcutMapLockMutex)
{
var button = (target as ButtonBase);
int viewId = Utilities.GetWindowId();
// Check if the View Id has already been registered
if (s_VirtualKeyShiftChordsForButtons.TryGetValue(viewId, out var iterViewMap))
{
Insert(iterViewMap, newValue, new WeakReference(button));
}
else
{
// If the View Id is not already registered, then register it and make the entry
s_VirtualKeyShiftChordsForButtons.Add(viewId, new SortedDictionary<MyVirtualKey, List<WeakReference>>());
Insert(s_VirtualKeyShiftChordsForButtons[viewId], newValue, new WeakReference(button));
}
}
}
private static void OnVirtualKeyAltChordPropertyChanged(DependencyObject target, MyVirtualKey oldValue, MyVirtualKey newValue)
{
// Writer lock for the static maps
lock (s_keyboardShortcutMapLockMutex)
{
MUXC.NavigationView navView = (target as MUXC.NavigationView);
int viewId = Utilities.GetWindowId();
// Check if the View Id has already been registered
if (s_VirtualKeyAltChordsForButtons.TryGetValue(viewId, out var iterViewMap))
{
Insert(iterViewMap, newValue, new WeakReference(navView));
}
else
{
// If the View Id is not already registered, then register it and make the entry
s_VirtualKeyAltChordsForButtons.Add(viewId, new SortedDictionary<MyVirtualKey, List<WeakReference>>());
Insert(s_VirtualKeyAltChordsForButtons[viewId], newValue, new WeakReference(navView));
}
}
}
private static void OnVirtualKeyControlShiftChordPropertyChanged(DependencyObject target, MyVirtualKey oldValue, MyVirtualKey newValue)
{
// Writer lock for the static maps
lock (s_keyboardShortcutMapLockMutex)
{
var button = (target as ButtonBase);
int viewId = Utilities.GetWindowId();
// Check if the View Id has already been registered
if (s_VirtualKeyControlShiftChordsForButtons.TryGetValue(viewId, out var iterViewMap))
{
Insert(iterViewMap, newValue, new WeakReference(button));
}
else
{
// If the View Id is not already registered, then register it and make the entry
s_VirtualKeyControlShiftChordsForButtons.Add(viewId, new SortedDictionary<MyVirtualKey, List<WeakReference>>());
Insert(s_VirtualKeyControlShiftChordsForButtons[viewId], newValue, new WeakReference(button));
}
}
}
// In the three event handlers below we will not mark the event as handled
// because this is a supplemental operation and we don't want to interfere with
// the normal keyboard handling.
private static void OnCharacterReceivedHandler(CoreWindow sender, CharacterReceivedEventArgs args)
{
int viewId = Utilities.GetWindowId();
bool hit = s_fHonorShortcuts.TryGetValue(viewId, out var currentHonorShortcuts);
if (!hit || currentHonorShortcuts)
{
char character = ((char)args.KeyCode);
var buttons = EqualRange(s_characterForButtons[viewId], character);
KeyboardShortcutManagerLocals.RunFirstEnabledButtonCommand(buttons);
KeyboardShortcutManagerLocals.LightUpButtons(buttons);
}
}
private static void OnKeyDownHandler(CoreWindow sender, KeyEventArgs args)
{
if (args.Handled)
{
return;
}
var key = args.VirtualKey;
int viewId = Utilities.GetWindowId();
bool isControlKeyPressed = (Window.Current.CoreWindow.GetKeyState(Windows.System.VirtualKey.Control) & CoreVirtualKeyStates.Down) == CoreVirtualKeyStates.Down;
bool isShiftKeyPressed = (Window.Current.CoreWindow.GetKeyState(Windows.System.VirtualKey.Shift) & CoreVirtualKeyStates.Down) == CoreVirtualKeyStates.Down;
bool isAltKeyPressed = (Window.Current.CoreWindow.GetKeyState(Windows.System.VirtualKey.Menu) & CoreVirtualKeyStates.Down) == CoreVirtualKeyStates.Down;
// Handle Ctrl + E for DateCalculator
if ((key == Windows.System.VirtualKey.E) && isControlKeyPressed && !isShiftKeyPressed && !isAltKeyPressed)
{
var lookupMap = GetCurrentKeyDictionary(isControlKeyPressed, isShiftKeyPressed, false);
if (lookupMap == null)
{
return;
}
var buttons = EqualRange(lookupMap, (MyVirtualKey)key);
var navView = buttons.ElementAt(0).Target as MUXC.NavigationView;
var appViewModel = (navView.DataContext as ApplicationViewModel);
appViewModel.Mode = ViewMode.Date;
var categoryName = AppResourceProvider.GetInstance().GetResourceString("DateCalculationModeText");
appViewModel.CategoryName = categoryName;
var menuItems = ((ObservableCollection<object>)navView.MenuItemsSource);
var flatIndex = NavCategory.GetFlatIndex(ViewMode.Date);
navView.SelectedItem = menuItems[flatIndex];
return;
}
if (s_ignoreNextEscape.TryGetValue(viewId, out var currentIgnoreNextEscape))
{
if (currentIgnoreNextEscape && key == Windows.System.VirtualKey.Escape)
{
if (s_keepIgnoringEscape.TryGetValue(viewId, out var currentKeepIgnoringEscape))
{
if (!currentKeepIgnoringEscape)
{
HonorEscape();
}
return;
}
}
}
if (s_fHonorShortcuts.TryGetValue(viewId, out var currentHonorShortcuts))
{
if (currentHonorShortcuts)
{
var myVirtualKey = key;
var lookupMap = GetCurrentKeyDictionary(isControlKeyPressed, isShiftKeyPressed, isAltKeyPressed);
if (lookupMap == null)
{
return;
}
var buttons = EqualRange(lookupMap, (MyVirtualKey)myVirtualKey);
if (buttons.Count() <= 0)
{
return;
}
KeyboardShortcutManagerLocals.RunFirstEnabledButtonCommand(buttons);
// Ctrl+C and Ctrl+V shifts focus to some button because of which enter doesn't work after copy/paste. So don't shift focus if Ctrl+C or Ctrl+V
// is pressed. When drop down is open, pressing escape shifts focus to clear button. So dont's shift focus if drop down is open. Ctrl+Insert is
// equivalent to Ctrl+C and Shift+Insert is equivalent to Ctrl+V
//var currentIsDropDownOpen = s_IsDropDownOpen.find(viewId);
if (!s_IsDropDownOpen.TryGetValue(viewId, out var currentIsDropDownOpen) || !currentIsDropDownOpen)
{
// Do not Light Up Buttons when Ctrl+C, Ctrl+V, Ctrl+Insert or Shift+Insert is pressed
if (!(isControlKeyPressed && (key == Windows.System.VirtualKey.C || key == Windows.System.VirtualKey.V || key == Windows.System.VirtualKey.Insert))
& !(isShiftKeyPressed && (key == Windows.System.VirtualKey.Insert)))
{
KeyboardShortcutManagerLocals.LightUpButtons(buttons);
}
}
}
}
}
private static void OnAcceleratorKeyActivated(CoreDispatcher dispatcher, AcceleratorKeyEventArgs args)
{
if (args.KeyStatus.IsKeyReleased)
{
var key = args.VirtualKey;
bool altPressed = args.KeyStatus.IsMenuKeyDown;
// If the Alt/Menu key is not pressed then we don't care about the key anymore
if (!altPressed)
{
return;
}
bool controlKeyPressed = (Window.Current.CoreWindow.GetKeyState(Windows.System.VirtualKey.Control) & CoreVirtualKeyStates.Down) == CoreVirtualKeyStates.Down;
// Ctrl is pressed in addition to alt, this means Alt Gr is intended. do not navigate.
if (controlKeyPressed)
{
return;
}
bool shiftKeyPressed = (Window.Current.CoreWindow.GetKeyState(Windows.System.VirtualKey.Shift) & CoreVirtualKeyStates.Down) == CoreVirtualKeyStates.Down;
var lookupMap = GetCurrentKeyDictionary(controlKeyPressed, shiftKeyPressed, altPressed);
if (lookupMap != null)
{
var listItems = EqualRange(lookupMap, (MyVirtualKey)key);
foreach (var itemRef in listItems)
{
var item = itemRef.Target as MUXC.NavigationView;
if (item != null)
{
var navView = (MUXC.NavigationView)item;
var menuItems = ((ObservableCollection<object>)navView.MenuItemsSource);
if (menuItems != null)
{
var vm = (navView.DataContext as ApplicationViewModel);
if (null != vm)
{
ViewMode toMode = NavCategory.GetViewModeForVirtualKey(((MyVirtualKey)key));
var nvi = (menuItems[NavCategory.GetFlatIndex(toMode)] as MUXC.NavigationViewItem);
if (nvi != null && nvi.IsEnabled && NavCategory.IsValidViewMode(toMode))
{
vm.Mode = toMode;
navView.SelectedItem = nvi;
}
}
}
break;
}
}
}
}
}
private static SortedDictionary<MyVirtualKey, List<WeakReference>> GetCurrentKeyDictionary(bool controlKeyPressed, bool shiftKeyPressed, bool altPressed)
{
int viewId = Utilities.GetWindowId();
if (controlKeyPressed)
{
if (altPressed)
{
return null;
}
else
{
if (shiftKeyPressed)
{
return s_VirtualKeyControlShiftChordsForButtons[viewId];
}
else
{
return s_VirtualKeyControlChordsForButtons[viewId];
}
}
}
else
{
if (altPressed)
{
if (!shiftKeyPressed)
{
return s_VirtualKeyAltChordsForButtons[viewId];
}
else
{
return null;
}
}
else
{
if (shiftKeyPressed)
{
return s_VirtualKeyShiftChordsForButtons[viewId];
}
else
{
return s_virtualKey[viewId];
}
}
}
}
// EqualRange is a helper function to pick a range from std::multimap.
private static IEnumerable<TValue> EqualRange<TKey, TValue>(SortedDictionary<TKey, List<TValue>> source, TKey key)
{
Debug.Assert(source != null);
if (source.TryGetValue(key, out List<TValue> items))
{
return items;
}
else
{
return Enumerable.Empty<TValue>();
}
}
// Insert is a helper function to insert a pair into std::multimap.
private static void Insert<Tkey, TValue>(SortedDictionary<Tkey, List<TValue>> dest, Tkey key, TValue value)
{
if (dest.TryGetValue(key, out List<TValue> items))
{
items.Add(value);
}
else
{
items = new List<TValue> { value };
dest.Add(key, items);
}
}
private static SortedDictionary<int, SortedDictionary<char, List<WeakReference>>> s_characterForButtons = new SortedDictionary<int, SortedDictionary<char, List<WeakReference>>>();
private static SortedDictionary<int, SortedDictionary<MyVirtualKey, List<WeakReference>>> s_virtualKey = new SortedDictionary<int, SortedDictionary<MyVirtualKey, List<WeakReference>>>();
private static SortedDictionary<int, SortedDictionary<MyVirtualKey, List<WeakReference>>> s_VirtualKeyControlChordsForButtons = new SortedDictionary<int, SortedDictionary<MyVirtualKey, List<WeakReference>>>();
private static SortedDictionary<int, SortedDictionary<MyVirtualKey, List<WeakReference>>> s_VirtualKeyShiftChordsForButtons = new SortedDictionary<int, SortedDictionary<MyVirtualKey, List<WeakReference>>>();
private static SortedDictionary<int, SortedDictionary<MyVirtualKey, List<WeakReference>>> s_VirtualKeyAltChordsForButtons = new SortedDictionary<int, SortedDictionary<MyVirtualKey, List<WeakReference>>>();
private static SortedDictionary<int, SortedDictionary<MyVirtualKey, List<WeakReference>>> s_VirtualKeyControlShiftChordsForButtons = new SortedDictionary<int, SortedDictionary<MyVirtualKey, List<WeakReference>>>();
private static SortedDictionary<int, bool> s_IsDropDownOpen = new SortedDictionary<int, bool>();
private static SortedDictionary<int, bool> s_ignoreNextEscape = new SortedDictionary<int, bool>();
private static SortedDictionary<int, bool> s_keepIgnoringEscape = new SortedDictionary<int, bool>();
private static SortedDictionary<int, bool> s_fHonorShortcuts = new SortedDictionary<int, bool>();
private static SortedDictionary<int, bool> s_fDisableShortcuts = new SortedDictionary<int, bool>();
//private static Concurrency.reader_writer_lock s_keyboardShortcutMapLock;
private static readonly object s_keyboardShortcutMapLockMutex = new object();
}
}
}

View file

@ -1,692 +0,0 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "pch.h"
#include "KeyboardShortcutManager.h"
#include "CalcViewModel/Common/AppResourceProvider.h"
#include "CalcViewModel/ApplicationViewModel.h"
#include "CalcViewModel/Common/LocalizationSettings.h"
using namespace Concurrency;
using namespace Platform;
using namespace std;
using namespace chrono;
using namespace Windows::ApplicationModel::Resources;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
using namespace Windows::UI::Core;
using namespace Windows::UI::Xaml::Controls::Primitives;
using namespace Windows::System;
using namespace Utils;
using namespace CalculatorApp;
using namespace CalculatorApp::Common;
using namespace CalculatorApp::ViewModel;
namespace MUXC = Microsoft::UI::Xaml::Controls;
DEPENDENCY_PROPERTY_INITIALIZATION(KeyboardShortcutManager, Character);
DEPENDENCY_PROPERTY_INITIALIZATION(KeyboardShortcutManager, VirtualKey);
DEPENDENCY_PROPERTY_INITIALIZATION(KeyboardShortcutManager, VirtualKeyControlChord);
DEPENDENCY_PROPERTY_INITIALIZATION(KeyboardShortcutManager, VirtualKeyShiftChord);
DEPENDENCY_PROPERTY_INITIALIZATION(KeyboardShortcutManager, VirtualKeyAltChord);
DEPENDENCY_PROPERTY_INITIALIZATION(KeyboardShortcutManager, VirtualKeyControlShiftChord);
map<int, multimap<wchar_t, WeakReference>> KeyboardShortcutManager::s_characterForButtons;
map<int, multimap<MyVirtualKey, WeakReference>> KeyboardShortcutManager::s_virtualKey;
map<int, multimap<MyVirtualKey, WeakReference>> KeyboardShortcutManager::s_VirtualKeyControlChordsForButtons;
map<int, multimap<MyVirtualKey, WeakReference>> KeyboardShortcutManager::s_VirtualKeyShiftChordsForButtons;
map<int, multimap<MyVirtualKey, WeakReference>> KeyboardShortcutManager::s_VirtualKeyAltChordsForButtons;
map<int, multimap<MyVirtualKey, WeakReference>> KeyboardShortcutManager::s_VirtualKeyControlShiftChordsForButtons;
map<int, bool> KeyboardShortcutManager::s_IsDropDownOpen;
map<int, bool> KeyboardShortcutManager::s_ignoreNextEscape;
map<int, bool> KeyboardShortcutManager::s_keepIgnoringEscape;
map<int, bool> KeyboardShortcutManager::s_fHonorShortcuts;
map<int, bool> KeyboardShortcutManager::s_fDisableShortcuts;
reader_writer_lock KeyboardShortcutManager::s_keyboardShortcutMapLock;
namespace CalculatorApp
{
namespace Common
{
// Lights up all of the buttons in the given range
// The range is defined by a pair of iterators
template <typename T>
void LightUpButtons(const T& buttons)
{
auto iterator = buttons.first;
for (; iterator != buttons.second; ++iterator)
{
auto button = iterator->second.Resolve<ButtonBase>();
if (button && button->IsEnabled)
{
LightUpButton(button);
}
}
}
void LightUpButton(ButtonBase ^ button)
{
// If the button is a toggle button then we don't need
// to change the UI of the button
if (dynamic_cast<ToggleButton ^>(button))
{
return;
}
// The button will go into the visual Pressed state with this call
VisualStateManager::GoToState(button, "Pressed", true);
// This timer will fire after lightUpTime and make the button
// go back to the normal state.
// This timer will only fire once after which it will be destroyed
auto timer = ref new DispatcherTimer();
TimeSpan lightUpTime{};
lightUpTime.Duration = 500000L; // Half second (in 100-ns units)
timer->Interval = lightUpTime;
WeakReference timerWeakReference(timer);
WeakReference buttonWeakReference(button);
timer->Tick += ref new EventHandler<Object ^>([buttonWeakReference, timerWeakReference](Object ^, Object ^) {
auto button = buttonWeakReference.Resolve<ButtonBase>();
if (button)
{
VisualStateManager::GoToState(button, "Normal", true);
}
// Cancel the timer after we're done so it only fires once
auto timer = timerWeakReference.Resolve<DispatcherTimer>();
if (timer)
{
timer->Stop();
}
});
timer->Start();
}
// Looks for the first button reference that it can resolve
// and execute its command.
// NOTE: It is assumed that all buttons associated with a particular
// key have the same command
template <typename T>
void RunFirstEnabledButtonCommand(const T& buttons)
{
auto buttonIterator = buttons.first;
for (; buttonIterator != buttons.second; ++buttonIterator)
{
auto button = buttonIterator->second.Resolve<ButtonBase>();
if (button && button->IsEnabled)
{
RunButtonCommand(button);
break;
}
}
}
void RunButtonCommand(ButtonBase ^ button)
{
if (button->IsEnabled)
{
auto command = button->Command;
auto parameter = button->CommandParameter;
if (command && command->CanExecute(parameter))
{
command->Execute(parameter);
}
auto radio = dynamic_cast<RadioButton ^>(button);
if (radio)
{
radio->IsChecked = true;
return;
}
auto toggle = dynamic_cast<ToggleButton ^>(button);
if (toggle)
{
toggle->IsChecked = !(toggle->IsChecked != nullptr && toggle->IsChecked->Value);
return;
}
}
}
}
}
void KeyboardShortcutManager::IgnoreEscape(bool onlyOnce)
{
// Writer lock for the static maps
reader_writer_lock::scoped_lock lock(s_keyboardShortcutMapLock);
int viewId = Utils::GetWindowId();
if (s_ignoreNextEscape.find(viewId) != s_ignoreNextEscape.end())
{
s_ignoreNextEscape[viewId] = true;
}
if (s_keepIgnoringEscape.find(viewId) != s_keepIgnoringEscape.end())
{
s_keepIgnoringEscape[viewId] = !onlyOnce;
}
}
void KeyboardShortcutManager::HonorEscape()
{
// Writer lock for the static maps
reader_writer_lock::scoped_lock lock(s_keyboardShortcutMapLock);
int viewId = Utils::GetWindowId();
if (s_ignoreNextEscape.find(viewId) != s_ignoreNextEscape.end())
{
s_ignoreNextEscape[viewId] = false;
}
if (s_keepIgnoringEscape.find(viewId) != s_keepIgnoringEscape.end())
{
s_keepIgnoringEscape[viewId] = false;
}
}
void KeyboardShortcutManager::OnCharacterPropertyChanged(DependencyObject ^ target, String ^ oldValue, String ^ newValue)
{
// Writer lock for the static maps
reader_writer_lock::scoped_lock lock(s_keyboardShortcutMapLock);
auto button = safe_cast<ButtonBase ^>(target);
int viewId = Utils::GetWindowId();
auto iterViewMap = s_characterForButtons.find(viewId);
if (iterViewMap != s_characterForButtons.end())
{
if (oldValue)
{
iterViewMap->second.erase(oldValue->Data()[0]);
}
if (newValue)
{
if (newValue == L".")
{
wchar_t decSep = LocalizationSettings::GetInstance().GetDecimalSeparator();
iterViewMap->second.insert(make_pair(decSep, WeakReference(button)));
}
else
{
iterViewMap->second.insert(make_pair(newValue->Data()[0], WeakReference(button)));
}
}
}
else
{
s_characterForButtons.insert(make_pair(viewId, multimap<wchar_t, WeakReference>()));
if (newValue == L".")
{
wchar_t decSep = LocalizationSettings::GetInstance().GetDecimalSeparator();
s_characterForButtons.find(viewId)->second.insert(make_pair(decSep, WeakReference(button)));
}
else
{
s_characterForButtons.find(viewId)->second.insert(make_pair(newValue->Data()[0], WeakReference(button)));
}
}
}
void KeyboardShortcutManager::OnVirtualKeyPropertyChanged(DependencyObject ^ target, MyVirtualKey /*oldValue*/, MyVirtualKey newValue)
{
// Writer lock for the static maps
reader_writer_lock::scoped_lock lock(s_keyboardShortcutMapLock);
auto button = static_cast<ButtonBase ^>(target);
int viewId = Utils::GetWindowId();
auto iterViewMap = s_virtualKey.find(viewId);
// Check if the View Id has already been registered
if (iterViewMap != s_virtualKey.end())
{
iterViewMap->second.insert(make_pair(newValue, WeakReference(button)));
}
else
{
// If the View Id is not already registered, then register it and make the entry
s_virtualKey.insert(make_pair(viewId, multimap<MyVirtualKey, WeakReference>()));
s_virtualKey.find(viewId)->second.insert(make_pair(newValue, WeakReference(button)));
}
}
void KeyboardShortcutManager::OnVirtualKeyControlChordPropertyChanged(DependencyObject ^ target, MyVirtualKey /*oldValue*/, MyVirtualKey newValue)
{
// Writer lock for the static maps
reader_writer_lock::scoped_lock lock(s_keyboardShortcutMapLock);
Control ^ control = dynamic_cast<ButtonBase ^>(target);
if (control == nullptr)
{
// Handling Ctrl+E shortcut for Date Calc, target would be NavigationView^ in that case
control = safe_cast<MUXC::NavigationView ^>(target);
}
int viewId = Utils::GetWindowId();
auto iterViewMap = s_VirtualKeyControlChordsForButtons.find(viewId);
// Check if the View Id has already been registered
if (iterViewMap != s_VirtualKeyControlChordsForButtons.end())
{
iterViewMap->second.insert(make_pair(newValue, WeakReference(control)));
}
else
{
// If the View Id is not already registered, then register it and make the entry
s_VirtualKeyControlChordsForButtons.insert(make_pair(viewId, multimap<MyVirtualKey, WeakReference>()));
s_VirtualKeyControlChordsForButtons.find(viewId)->second.insert(make_pair(newValue, WeakReference(control)));
}
}
void KeyboardShortcutManager::OnVirtualKeyShiftChordPropertyChanged(DependencyObject ^ target, MyVirtualKey /*oldValue*/, MyVirtualKey newValue)
{
// Writer lock for the static maps
reader_writer_lock::scoped_lock lock(s_keyboardShortcutMapLock);
auto button = safe_cast<ButtonBase ^>(target);
int viewId = Utils::GetWindowId();
auto iterViewMap = s_VirtualKeyShiftChordsForButtons.find(viewId);
// Check if the View Id has already been registered
if (iterViewMap != s_VirtualKeyShiftChordsForButtons.end())
{
iterViewMap->second.insert(make_pair(newValue, WeakReference(button)));
}
else
{
// If the View Id is not already registered, then register it and make the entry
s_VirtualKeyShiftChordsForButtons.insert(make_pair(viewId, multimap<MyVirtualKey, WeakReference>()));
s_VirtualKeyShiftChordsForButtons.find(viewId)->second.insert(make_pair(newValue, WeakReference(button)));
}
}
void KeyboardShortcutManager::OnVirtualKeyAltChordPropertyChanged(DependencyObject ^ target, MyVirtualKey /*oldValue*/, MyVirtualKey newValue)
{
// Writer lock for the static maps
reader_writer_lock::scoped_lock lock(s_keyboardShortcutMapLock);
MUXC::NavigationView ^ navView = safe_cast<MUXC::NavigationView ^>(target);
int viewId = Utils::GetWindowId();
auto iterViewMap = s_VirtualKeyAltChordsForButtons.find(viewId);
// Check if the View Id has already been registered
if (iterViewMap != s_VirtualKeyAltChordsForButtons.end())
{
iterViewMap->second.insert(make_pair(newValue, WeakReference(navView)));
}
else
{
// If the View Id is not already registered, then register it and make the entry
s_VirtualKeyAltChordsForButtons.insert(make_pair(viewId, multimap<MyVirtualKey, WeakReference>()));
s_VirtualKeyAltChordsForButtons.find(viewId)->second.insert(make_pair(newValue, WeakReference(navView)));
}
}
void KeyboardShortcutManager::OnVirtualKeyControlShiftChordPropertyChanged(DependencyObject ^ target, MyVirtualKey /*oldValue*/, MyVirtualKey newValue)
{
// Writer lock for the static maps
reader_writer_lock::scoped_lock lock(s_keyboardShortcutMapLock);
auto button = safe_cast<ButtonBase ^>(target);
int viewId = Utils::GetWindowId();
auto iterViewMap = s_VirtualKeyControlShiftChordsForButtons.find(viewId);
// Check if the View Id has already been registered
if (iterViewMap != s_VirtualKeyControlShiftChordsForButtons.end())
{
iterViewMap->second.insert(make_pair(newValue, WeakReference(button)));
}
else
{
// If the View Id is not already registered, then register it and make the entry
s_VirtualKeyControlShiftChordsForButtons.insert(make_pair(viewId, multimap<MyVirtualKey, WeakReference>()));
s_VirtualKeyControlShiftChordsForButtons.find(viewId)->second.insert(make_pair(newValue, WeakReference(button)));
}
}
// In the three event handlers below we will not mark the event as handled
// because this is a supplemental operation and we don't want to interfere with
// the normal keyboard handling.
void KeyboardShortcutManager::OnCharacterReceivedHandler(CoreWindow ^ sender, CharacterReceivedEventArgs ^ args)
{
int viewId = Utils::GetWindowId();
auto currentHonorShortcuts = s_fHonorShortcuts.find(viewId);
if (currentHonorShortcuts == s_fHonorShortcuts.end() || currentHonorShortcuts->second)
{
wchar_t character = static_cast<wchar_t>(args->KeyCode);
auto buttons = s_characterForButtons.find(viewId)->second.equal_range(character);
RunFirstEnabledButtonCommand(buttons);
LightUpButtons(buttons);
}
}
const multimap<MyVirtualKey, WeakReference>* KeyboardShortcutManager::GetCurrentKeyDictionary(bool controlKeyPressed, bool shiftKeyPressed, bool altPressed)
{
int viewId = Utils::GetWindowId();
if (controlKeyPressed)
{
if (altPressed)
{
return nullptr;
}
else
{
if (shiftKeyPressed)
{
return &s_VirtualKeyControlShiftChordsForButtons.find(viewId)->second;
}
else
{
return &s_VirtualKeyControlChordsForButtons.find(viewId)->second;
}
}
}
else
{
if (altPressed)
{
if (!shiftKeyPressed)
{
return &s_VirtualKeyAltChordsForButtons.find(viewId)->second;
}
else
{
return nullptr;
}
}
else
{
if (shiftKeyPressed)
{
return &s_VirtualKeyShiftChordsForButtons.find(viewId)->second;
}
else
{
return &s_virtualKey.find(viewId)->second;
}
}
}
}
void KeyboardShortcutManager::OnKeyDownHandler(CoreWindow ^ sender, KeyEventArgs ^ args)
{
if (args->Handled)
{
return;
}
auto key = args->VirtualKey;
int viewId = Utils::GetWindowId();
const bool isControlKeyPressed = (Window::Current->CoreWindow->GetKeyState(VirtualKey::Control) & CoreVirtualKeyStates::Down) == CoreVirtualKeyStates::Down;
const bool isShiftKeyPressed = (Window::Current->CoreWindow->GetKeyState(VirtualKey::Shift) & CoreVirtualKeyStates::Down) == CoreVirtualKeyStates::Down;
const bool isAltKeyPressed = (Window::Current->CoreWindow->GetKeyState(VirtualKey::Menu) & CoreVirtualKeyStates::Down) == CoreVirtualKeyStates::Down;
// Handle Ctrl + E for DateCalculator
if ((key == VirtualKey::E) && isControlKeyPressed && !isShiftKeyPressed && !isAltKeyPressed)
{
const auto lookupMap = GetCurrentKeyDictionary(isControlKeyPressed, isShiftKeyPressed, false);
if (lookupMap == nullptr)
{
return;
}
auto buttons = lookupMap->equal_range(static_cast<MyVirtualKey>(key));
auto navView = buttons.first->second.Resolve<MUXC::NavigationView>();
auto appViewModel = safe_cast<ApplicationViewModel ^>(navView->DataContext);
appViewModel->Mode = ViewMode::Date;
auto categoryName = AppResourceProvider::GetInstance()->GetResourceString(L"DateCalculationModeText");
appViewModel->CategoryName = categoryName;
auto menuItems = static_cast<IObservableVector<Object ^> ^>(navView->MenuItemsSource);
auto flatIndex = NavCategory::GetFlatIndex(ViewMode::Date);
navView->SelectedItem = menuItems->GetAt(flatIndex);
return;
}
auto currentIgnoreNextEscape = s_ignoreNextEscape.find(viewId);
if (currentIgnoreNextEscape != s_ignoreNextEscape.end())
{
if (currentIgnoreNextEscape->second && key == VirtualKey::Escape)
{
auto currentKeepIgnoringEscape = s_keepIgnoringEscape.find(viewId);
if (currentKeepIgnoringEscape != s_keepIgnoringEscape.end())
{
if (!currentKeepIgnoringEscape->second)
{
HonorEscape();
}
return;
}
}
}
auto currentHonorShortcuts = s_fHonorShortcuts.find(viewId);
if (currentHonorShortcuts != s_fHonorShortcuts.end())
{
if (currentHonorShortcuts->second)
{
const auto myVirtualKey = static_cast<MyVirtualKey>(key);
const auto lookupMap = GetCurrentKeyDictionary(isControlKeyPressed, isShiftKeyPressed, isAltKeyPressed);
if (lookupMap == nullptr)
{
return;
}
auto buttons = lookupMap->equal_range(myVirtualKey);
if (buttons.first == buttons.second)
{
return;
}
RunFirstEnabledButtonCommand(buttons);
// Ctrl+C and Ctrl+V shifts focus to some button because of which enter doesn't work after copy/paste. So don't shift focus if Ctrl+C or Ctrl+V
// is pressed. When drop down is open, pressing escape shifts focus to clear button. So dont's shift focus if drop down is open. Ctrl+Insert is
// equivalent to Ctrl+C and Shift+Insert is equivalent to Ctrl+V
auto currentIsDropDownOpen = s_IsDropDownOpen.find(viewId);
if (currentIsDropDownOpen == s_IsDropDownOpen.end() || !currentIsDropDownOpen->second)
{
// Do not Light Up Buttons when Ctrl+C, Ctrl+V, Ctrl+Insert or Shift+Insert is pressed
if (!(isControlKeyPressed && (key == VirtualKey::C || key == VirtualKey::V || key == VirtualKey::Insert))
&& !(isShiftKeyPressed && (key == VirtualKey::Insert)))
{
LightUpButtons(buttons);
}
}
}
}
}
void KeyboardShortcutManager::OnAcceleratorKeyActivated(CoreDispatcher ^, AcceleratorKeyEventArgs ^ args)
{
if (args->KeyStatus.IsKeyReleased)
{
auto key = args->VirtualKey;
const bool altPressed = args->KeyStatus.IsMenuKeyDown;
// If the Alt/Menu key is not pressed then we don't care about the key anymore
if (!altPressed)
{
return;
}
const bool controlKeyPressed =
(Window::Current->CoreWindow->GetKeyState(VirtualKey::Control) & CoreVirtualKeyStates::Down) == CoreVirtualKeyStates::Down;
// Ctrl is pressed in addition to alt, this means Alt Gr is intended. do not navigate.
if (controlKeyPressed)
{
return;
}
const bool shiftKeyPressed = (Window::Current->CoreWindow->GetKeyState(VirtualKey::Shift) & CoreVirtualKeyStates::Down) == CoreVirtualKeyStates::Down;
const auto lookupMap = GetCurrentKeyDictionary(controlKeyPressed, shiftKeyPressed, altPressed);
if (lookupMap != nullptr)
{
auto listItems = lookupMap->equal_range(static_cast<MyVirtualKey>(key));
for (auto listIterator = listItems.first; listIterator != listItems.second; ++listIterator)
{
auto item = listIterator->second.Resolve<MUXC::NavigationView>();
if (item != nullptr)
{
auto navView = safe_cast<MUXC::NavigationView ^>(item);
auto menuItems = static_cast<IObservableVector<Object ^> ^>(navView->MenuItemsSource);
if (menuItems != nullptr)
{
auto vm = safe_cast<ApplicationViewModel ^>(navView->DataContext);
if (nullptr != vm)
{
ViewMode toMode = NavCategory::GetViewModeForVirtualKey(static_cast<MyVirtualKey>(key));
auto nvi = dynamic_cast<MUXC::NavigationViewItem ^>(menuItems->GetAt(NavCategory::GetFlatIndex(toMode)));
if (nvi && nvi->IsEnabled && NavCategory::IsValidViewMode(toMode))
{
vm->Mode = toMode;
navView->SelectedItem = nvi;
}
}
}
break;
}
}
}
}
}
void KeyboardShortcutManager::Initialize()
{
auto coreWindow = Window::Current->CoreWindow;
coreWindow->CharacterReceived +=
ref new TypedEventHandler<CoreWindow ^, CharacterReceivedEventArgs ^>(&KeyboardShortcutManager::OnCharacterReceivedHandler);
coreWindow->KeyDown += ref new TypedEventHandler<CoreWindow ^, KeyEventArgs ^>(&KeyboardShortcutManager::OnKeyDownHandler);
coreWindow->Dispatcher->AcceleratorKeyActivated +=
ref new TypedEventHandler<CoreDispatcher ^, AcceleratorKeyEventArgs ^>(&KeyboardShortcutManager::OnAcceleratorKeyActivated);
KeyboardShortcutManager::RegisterNewAppViewId();
}
void KeyboardShortcutManager::UpdateDropDownState(bool isOpen)
{
int viewId = Utils::GetWindowId();
if (s_IsDropDownOpen.find(viewId) != s_IsDropDownOpen.end())
{
s_IsDropDownOpen[viewId] = isOpen;
}
}
void KeyboardShortcutManager::HonorShortcuts(bool allow)
{
// Writer lock for the static maps
reader_writer_lock::scoped_lock lock(s_keyboardShortcutMapLock);
int viewId = Utils::GetWindowId();
if (s_fHonorShortcuts.find(viewId) != s_fHonorShortcuts.end())
{
if (s_fDisableShortcuts.find(viewId) != s_fDisableShortcuts.end())
{
if (s_fDisableShortcuts[viewId])
{
s_fHonorShortcuts[viewId] = false;
return;
}
}
s_fHonorShortcuts[viewId] = allow;
}
}
void KeyboardShortcutManager::RegisterNewAppViewId()
{
// Writer lock for the static maps
reader_writer_lock::scoped_lock lock(s_keyboardShortcutMapLock);
int appViewId = Utils::GetWindowId();
// Check if the View Id has already been registered
if (s_characterForButtons.find(appViewId) == s_characterForButtons.end())
{
s_characterForButtons.insert(make_pair(appViewId, multimap<wchar_t, WeakReference>()));
}
if (s_virtualKey.find(appViewId) == s_virtualKey.end())
{
s_virtualKey.insert(make_pair(appViewId, multimap<MyVirtualKey, WeakReference>()));
}
if (s_VirtualKeyControlChordsForButtons.find(appViewId) == s_VirtualKeyControlChordsForButtons.end())
{
s_VirtualKeyControlChordsForButtons.insert(make_pair(appViewId, multimap<MyVirtualKey, WeakReference>()));
}
if (s_VirtualKeyShiftChordsForButtons.find(appViewId) == s_VirtualKeyShiftChordsForButtons.end())
{
s_VirtualKeyShiftChordsForButtons.insert(make_pair(appViewId, multimap<MyVirtualKey, WeakReference>()));
}
if (s_VirtualKeyAltChordsForButtons.find(appViewId) == s_VirtualKeyAltChordsForButtons.end())
{
s_VirtualKeyAltChordsForButtons.insert(make_pair(appViewId, multimap<MyVirtualKey, WeakReference>()));
}
if (s_VirtualKeyControlShiftChordsForButtons.find(appViewId) == s_VirtualKeyControlShiftChordsForButtons.end())
{
s_VirtualKeyControlShiftChordsForButtons.insert(make_pair(appViewId, multimap<MyVirtualKey, WeakReference>()));
}
s_IsDropDownOpen[appViewId] = false;
s_ignoreNextEscape[appViewId] = false;
s_keepIgnoringEscape[appViewId] = false;
s_fHonorShortcuts[appViewId] = true;
s_fDisableShortcuts[appViewId] = false;
}
void KeyboardShortcutManager::OnWindowClosed(int viewId)
{
// Writer lock for the static maps
reader_writer_lock::scoped_lock lock(s_keyboardShortcutMapLock);
s_characterForButtons.erase(viewId);
s_virtualKey.erase(viewId);
s_VirtualKeyControlChordsForButtons.erase(viewId);
s_VirtualKeyShiftChordsForButtons.erase(viewId);
s_VirtualKeyAltChordsForButtons.erase(viewId);
s_VirtualKeyControlShiftChordsForButtons.erase(viewId);
s_IsDropDownOpen.erase(viewId);
s_ignoreNextEscape.erase(viewId);
s_keepIgnoringEscape.erase(viewId);
s_fHonorShortcuts.erase(viewId);
s_fDisableShortcuts.erase(viewId);
}
void KeyboardShortcutManager::DisableShortcuts(bool disable)
{
int viewId = Utils::GetWindowId();
if (s_fDisableShortcuts.find(viewId) != s_fDisableShortcuts.end())
{
s_fDisableShortcuts[viewId] = disable;
}
HonorShortcuts(!disable);
}

Some files were not shown because too many files have changed in this diff Show more