diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..a750736 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,5 @@ +[*.cs] + +# CA1801: Review unused parameters +# Ignore reasonn: Event listener trigger this rule, resulting in bloated warnings list +dotnet_diagnostic.CA1801.severity = suggestion diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 0000000..dd816b5 --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,20 @@ +<Project> + + <!-- Output paths --> + <PropertyGroup> + <BaseOutputPath>..\..\artifacts\$(Configuration)\</BaseOutputPath> + + <OutputPath>$(BaseOutputPath)\$(MSBuildProjectName)\</OutputPath> + + <!--<BaseIntermediateOutputPath>..\..\artifacts\intermediates\$(Configuration)\$(MSBuildProjectName)\</BaseIntermediateOutputPath>--> + <IntermediateOutputPath>..\..\artifacts\intermediates\$(MSBuildProjectName)\</IntermediateOutputPath> + <GeneratedFilesDir>..\..\artifacts\intermediates\$(MSBuildProjectName)\Generated Files\</GeneratedFilesDir> + </PropertyGroup> + + <!-- Packages needed in every project --> + <ItemGroup> + <!-- Code analyzer --> + <PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8"> + </PackageReference> + </ItemGroup> +</Project> diff --git a/Directory.Build.targets b/Directory.Build.targets new file mode 100644 index 0000000..64db5ee --- /dev/null +++ b/Directory.Build.targets @@ -0,0 +1,12 @@ +<Project> + <PropertyGroup> + <!-- + CA1303: Do not pass literals as localized parameters + Ignore reason: All strings we use are templates or logging and are in english per design + + CA1305: Specify IFormatProvider + Ignore reason: All strings are english--> + + <NoWarn>;$(NoWarn);CA1303;CA1305</NoWarn> + </PropertyGroup> +</Project> diff --git a/UWPResourcesGallery.sln b/UWPResourcesGallery.sln new file mode 100644 index 0000000..6cbdecb --- /dev/null +++ b/UWPResourcesGallery.sln @@ -0,0 +1,172 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29326.143 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{44DBB23E-4C53-4482-A04C-92EE0515150C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UWPResourcesGallery", "src\UWPResourcesGallery\UWPResourcesGallery.csproj", "{45C7F2FE-580E-4A64-BD5F-DFF8E21F2EE6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ResourceModel", "src\ResourceModel\ResourceModel.csproj", "{957B1E0E-D863-41E3-8042-7FAC37A512DD}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{AA684C57-74FA-403E-A3D7-656CC23365C5}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ResoureModelTests", "tests\ResoureModelTests\ResoureModelTests.csproj", "{C2B9B471-9028-46C3-A04E-37DD4B96D059}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ControlTests", "tests\ControlTests\ControlTests.csproj", "{40FCF2F6-2D83-4D02-94FF-57F52A73B462}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AppInteractionTests", "tests\AppInteractionTests\AppInteractionTests.csproj", "{494C8631-7686-4174-9673-026BFEFE1F33}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C6DCF158-E072-48B0-8CB8-E12100A3F218}" + ProjectSection(SolutionItems) = preProject + .editorconfig = .editorconfig + Directory.Build.props = Directory.Build.props + Directory.Build.targets = Directory.Build.targets + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|ARM = Debug|ARM + Debug|ARM64 = Debug|ARM64 + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|ARM = Release|ARM + Release|ARM64 = Release|ARM64 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {45C7F2FE-580E-4A64-BD5F-DFF8E21F2EE6}.Debug|Any CPU.ActiveCfg = Debug|x86 + {45C7F2FE-580E-4A64-BD5F-DFF8E21F2EE6}.Debug|ARM.ActiveCfg = Debug|ARM + {45C7F2FE-580E-4A64-BD5F-DFF8E21F2EE6}.Debug|ARM.Build.0 = Debug|ARM + {45C7F2FE-580E-4A64-BD5F-DFF8E21F2EE6}.Debug|ARM.Deploy.0 = Debug|ARM + {45C7F2FE-580E-4A64-BD5F-DFF8E21F2EE6}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {45C7F2FE-580E-4A64-BD5F-DFF8E21F2EE6}.Debug|ARM64.Build.0 = Debug|ARM64 + {45C7F2FE-580E-4A64-BD5F-DFF8E21F2EE6}.Debug|ARM64.Deploy.0 = Debug|ARM64 + {45C7F2FE-580E-4A64-BD5F-DFF8E21F2EE6}.Debug|x64.ActiveCfg = Debug|x64 + {45C7F2FE-580E-4A64-BD5F-DFF8E21F2EE6}.Debug|x64.Build.0 = Debug|x64 + {45C7F2FE-580E-4A64-BD5F-DFF8E21F2EE6}.Debug|x64.Deploy.0 = Debug|x64 + {45C7F2FE-580E-4A64-BD5F-DFF8E21F2EE6}.Debug|x86.ActiveCfg = Debug|x86 + {45C7F2FE-580E-4A64-BD5F-DFF8E21F2EE6}.Debug|x86.Build.0 = Debug|x86 + {45C7F2FE-580E-4A64-BD5F-DFF8E21F2EE6}.Debug|x86.Deploy.0 = Debug|x86 + {45C7F2FE-580E-4A64-BD5F-DFF8E21F2EE6}.Release|Any CPU.ActiveCfg = Release|x86 + {45C7F2FE-580E-4A64-BD5F-DFF8E21F2EE6}.Release|ARM.ActiveCfg = Release|ARM + {45C7F2FE-580E-4A64-BD5F-DFF8E21F2EE6}.Release|ARM.Build.0 = Release|ARM + {45C7F2FE-580E-4A64-BD5F-DFF8E21F2EE6}.Release|ARM.Deploy.0 = Release|ARM + {45C7F2FE-580E-4A64-BD5F-DFF8E21F2EE6}.Release|ARM64.ActiveCfg = Release|ARM64 + {45C7F2FE-580E-4A64-BD5F-DFF8E21F2EE6}.Release|ARM64.Build.0 = Release|ARM64 + {45C7F2FE-580E-4A64-BD5F-DFF8E21F2EE6}.Release|ARM64.Deploy.0 = Release|ARM64 + {45C7F2FE-580E-4A64-BD5F-DFF8E21F2EE6}.Release|x64.ActiveCfg = Release|x64 + {45C7F2FE-580E-4A64-BD5F-DFF8E21F2EE6}.Release|x64.Build.0 = Release|x64 + {45C7F2FE-580E-4A64-BD5F-DFF8E21F2EE6}.Release|x64.Deploy.0 = Release|x64 + {45C7F2FE-580E-4A64-BD5F-DFF8E21F2EE6}.Release|x86.ActiveCfg = Release|x86 + {45C7F2FE-580E-4A64-BD5F-DFF8E21F2EE6}.Release|x86.Build.0 = Release|x86 + {45C7F2FE-580E-4A64-BD5F-DFF8E21F2EE6}.Release|x86.Deploy.0 = Release|x86 + {957B1E0E-D863-41E3-8042-7FAC37A512DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {957B1E0E-D863-41E3-8042-7FAC37A512DD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {957B1E0E-D863-41E3-8042-7FAC37A512DD}.Debug|ARM.ActiveCfg = Debug|ARM + {957B1E0E-D863-41E3-8042-7FAC37A512DD}.Debug|ARM.Build.0 = Debug|ARM + {957B1E0E-D863-41E3-8042-7FAC37A512DD}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {957B1E0E-D863-41E3-8042-7FAC37A512DD}.Debug|ARM64.Build.0 = Debug|ARM64 + {957B1E0E-D863-41E3-8042-7FAC37A512DD}.Debug|x64.ActiveCfg = Debug|x64 + {957B1E0E-D863-41E3-8042-7FAC37A512DD}.Debug|x64.Build.0 = Debug|x64 + {957B1E0E-D863-41E3-8042-7FAC37A512DD}.Debug|x86.ActiveCfg = Debug|x86 + {957B1E0E-D863-41E3-8042-7FAC37A512DD}.Debug|x86.Build.0 = Debug|x86 + {957B1E0E-D863-41E3-8042-7FAC37A512DD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {957B1E0E-D863-41E3-8042-7FAC37A512DD}.Release|Any CPU.Build.0 = Release|Any CPU + {957B1E0E-D863-41E3-8042-7FAC37A512DD}.Release|ARM.ActiveCfg = Release|ARM + {957B1E0E-D863-41E3-8042-7FAC37A512DD}.Release|ARM.Build.0 = Release|ARM + {957B1E0E-D863-41E3-8042-7FAC37A512DD}.Release|ARM64.ActiveCfg = Release|ARM64 + {957B1E0E-D863-41E3-8042-7FAC37A512DD}.Release|ARM64.Build.0 = Release|ARM64 + {957B1E0E-D863-41E3-8042-7FAC37A512DD}.Release|x64.ActiveCfg = Release|x64 + {957B1E0E-D863-41E3-8042-7FAC37A512DD}.Release|x64.Build.0 = Release|x64 + {957B1E0E-D863-41E3-8042-7FAC37A512DD}.Release|x86.ActiveCfg = Release|x86 + {957B1E0E-D863-41E3-8042-7FAC37A512DD}.Release|x86.Build.0 = Release|x86 + {C2B9B471-9028-46C3-A04E-37DD4B96D059}.Debug|Any CPU.ActiveCfg = Debug|x86 + {C2B9B471-9028-46C3-A04E-37DD4B96D059}.Debug|ARM.ActiveCfg = Debug|ARM + {C2B9B471-9028-46C3-A04E-37DD4B96D059}.Debug|ARM.Build.0 = Debug|ARM + {C2B9B471-9028-46C3-A04E-37DD4B96D059}.Debug|ARM.Deploy.0 = Debug|ARM + {C2B9B471-9028-46C3-A04E-37DD4B96D059}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {C2B9B471-9028-46C3-A04E-37DD4B96D059}.Debug|ARM64.Build.0 = Debug|ARM64 + {C2B9B471-9028-46C3-A04E-37DD4B96D059}.Debug|ARM64.Deploy.0 = Debug|ARM64 + {C2B9B471-9028-46C3-A04E-37DD4B96D059}.Debug|x64.ActiveCfg = Debug|x64 + {C2B9B471-9028-46C3-A04E-37DD4B96D059}.Debug|x64.Build.0 = Debug|x64 + {C2B9B471-9028-46C3-A04E-37DD4B96D059}.Debug|x64.Deploy.0 = Debug|x64 + {C2B9B471-9028-46C3-A04E-37DD4B96D059}.Debug|x86.ActiveCfg = Debug|x86 + {C2B9B471-9028-46C3-A04E-37DD4B96D059}.Debug|x86.Build.0 = Debug|x86 + {C2B9B471-9028-46C3-A04E-37DD4B96D059}.Debug|x86.Deploy.0 = Debug|x86 + {C2B9B471-9028-46C3-A04E-37DD4B96D059}.Release|Any CPU.ActiveCfg = Release|x86 + {C2B9B471-9028-46C3-A04E-37DD4B96D059}.Release|ARM.ActiveCfg = Release|ARM + {C2B9B471-9028-46C3-A04E-37DD4B96D059}.Release|ARM.Build.0 = Release|ARM + {C2B9B471-9028-46C3-A04E-37DD4B96D059}.Release|ARM.Deploy.0 = Release|ARM + {C2B9B471-9028-46C3-A04E-37DD4B96D059}.Release|ARM64.ActiveCfg = Release|ARM64 + {C2B9B471-9028-46C3-A04E-37DD4B96D059}.Release|ARM64.Build.0 = Release|ARM64 + {C2B9B471-9028-46C3-A04E-37DD4B96D059}.Release|ARM64.Deploy.0 = Release|ARM64 + {C2B9B471-9028-46C3-A04E-37DD4B96D059}.Release|x64.ActiveCfg = Release|x64 + {C2B9B471-9028-46C3-A04E-37DD4B96D059}.Release|x64.Build.0 = Release|x64 + {C2B9B471-9028-46C3-A04E-37DD4B96D059}.Release|x64.Deploy.0 = Release|x64 + {C2B9B471-9028-46C3-A04E-37DD4B96D059}.Release|x86.ActiveCfg = Release|x86 + {C2B9B471-9028-46C3-A04E-37DD4B96D059}.Release|x86.Build.0 = Release|x86 + {C2B9B471-9028-46C3-A04E-37DD4B96D059}.Release|x86.Deploy.0 = Release|x86 + {40FCF2F6-2D83-4D02-94FF-57F52A73B462}.Debug|Any CPU.ActiveCfg = Debug|x86 + {40FCF2F6-2D83-4D02-94FF-57F52A73B462}.Debug|ARM.ActiveCfg = Debug|ARM + {40FCF2F6-2D83-4D02-94FF-57F52A73B462}.Debug|ARM.Build.0 = Debug|ARM + {40FCF2F6-2D83-4D02-94FF-57F52A73B462}.Debug|ARM.Deploy.0 = Debug|ARM + {40FCF2F6-2D83-4D02-94FF-57F52A73B462}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {40FCF2F6-2D83-4D02-94FF-57F52A73B462}.Debug|ARM64.Build.0 = Debug|ARM64 + {40FCF2F6-2D83-4D02-94FF-57F52A73B462}.Debug|ARM64.Deploy.0 = Debug|ARM64 + {40FCF2F6-2D83-4D02-94FF-57F52A73B462}.Debug|x64.ActiveCfg = Debug|x64 + {40FCF2F6-2D83-4D02-94FF-57F52A73B462}.Debug|x64.Build.0 = Debug|x64 + {40FCF2F6-2D83-4D02-94FF-57F52A73B462}.Debug|x64.Deploy.0 = Debug|x64 + {40FCF2F6-2D83-4D02-94FF-57F52A73B462}.Debug|x86.ActiveCfg = Debug|x86 + {40FCF2F6-2D83-4D02-94FF-57F52A73B462}.Debug|x86.Build.0 = Debug|x86 + {40FCF2F6-2D83-4D02-94FF-57F52A73B462}.Debug|x86.Deploy.0 = Debug|x86 + {40FCF2F6-2D83-4D02-94FF-57F52A73B462}.Release|Any CPU.ActiveCfg = Release|x86 + {40FCF2F6-2D83-4D02-94FF-57F52A73B462}.Release|ARM.ActiveCfg = Release|ARM + {40FCF2F6-2D83-4D02-94FF-57F52A73B462}.Release|ARM.Build.0 = Release|ARM + {40FCF2F6-2D83-4D02-94FF-57F52A73B462}.Release|ARM.Deploy.0 = Release|ARM + {40FCF2F6-2D83-4D02-94FF-57F52A73B462}.Release|ARM64.ActiveCfg = Release|ARM64 + {40FCF2F6-2D83-4D02-94FF-57F52A73B462}.Release|ARM64.Build.0 = Release|ARM64 + {40FCF2F6-2D83-4D02-94FF-57F52A73B462}.Release|ARM64.Deploy.0 = Release|ARM64 + {40FCF2F6-2D83-4D02-94FF-57F52A73B462}.Release|x64.ActiveCfg = Release|x64 + {40FCF2F6-2D83-4D02-94FF-57F52A73B462}.Release|x64.Build.0 = Release|x64 + {40FCF2F6-2D83-4D02-94FF-57F52A73B462}.Release|x64.Deploy.0 = Release|x64 + {40FCF2F6-2D83-4D02-94FF-57F52A73B462}.Release|x86.ActiveCfg = Release|x86 + {40FCF2F6-2D83-4D02-94FF-57F52A73B462}.Release|x86.Build.0 = Release|x86 + {40FCF2F6-2D83-4D02-94FF-57F52A73B462}.Release|x86.Deploy.0 = Release|x86 + {494C8631-7686-4174-9673-026BFEFE1F33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {494C8631-7686-4174-9673-026BFEFE1F33}.Debug|Any CPU.Build.0 = Debug|Any CPU + {494C8631-7686-4174-9673-026BFEFE1F33}.Debug|ARM.ActiveCfg = Debug|Any CPU + {494C8631-7686-4174-9673-026BFEFE1F33}.Debug|ARM.Build.0 = Debug|Any CPU + {494C8631-7686-4174-9673-026BFEFE1F33}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {494C8631-7686-4174-9673-026BFEFE1F33}.Debug|ARM64.Build.0 = Debug|Any CPU + {494C8631-7686-4174-9673-026BFEFE1F33}.Debug|x64.ActiveCfg = Debug|Any CPU + {494C8631-7686-4174-9673-026BFEFE1F33}.Debug|x64.Build.0 = Debug|Any CPU + {494C8631-7686-4174-9673-026BFEFE1F33}.Debug|x86.ActiveCfg = Debug|Any CPU + {494C8631-7686-4174-9673-026BFEFE1F33}.Debug|x86.Build.0 = Debug|Any CPU + {494C8631-7686-4174-9673-026BFEFE1F33}.Release|Any CPU.ActiveCfg = Release|Any CPU + {494C8631-7686-4174-9673-026BFEFE1F33}.Release|Any CPU.Build.0 = Release|Any CPU + {494C8631-7686-4174-9673-026BFEFE1F33}.Release|ARM.ActiveCfg = Release|Any CPU + {494C8631-7686-4174-9673-026BFEFE1F33}.Release|ARM.Build.0 = Release|Any CPU + {494C8631-7686-4174-9673-026BFEFE1F33}.Release|ARM64.ActiveCfg = Release|Any CPU + {494C8631-7686-4174-9673-026BFEFE1F33}.Release|ARM64.Build.0 = Release|Any CPU + {494C8631-7686-4174-9673-026BFEFE1F33}.Release|x64.ActiveCfg = Release|Any CPU + {494C8631-7686-4174-9673-026BFEFE1F33}.Release|x64.Build.0 = Release|Any CPU + {494C8631-7686-4174-9673-026BFEFE1F33}.Release|x86.ActiveCfg = Release|Any CPU + {494C8631-7686-4174-9673-026BFEFE1F33}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {45C7F2FE-580E-4A64-BD5F-DFF8E21F2EE6} = {44DBB23E-4C53-4482-A04C-92EE0515150C} + {957B1E0E-D863-41E3-8042-7FAC37A512DD} = {44DBB23E-4C53-4482-A04C-92EE0515150C} + {C2B9B471-9028-46C3-A04E-37DD4B96D059} = {AA684C57-74FA-403E-A3D7-656CC23365C5} + {40FCF2F6-2D83-4D02-94FF-57F52A73B462} = {AA684C57-74FA-403E-A3D7-656CC23365C5} + {494C8631-7686-4174-9673-026BFEFE1F33} = {AA684C57-74FA-403E-A3D7-656CC23365C5} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {751E228E-9AE5-4F15-867D-1FE372A548C1} + EndGlobalSection +EndGlobal diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..548af2f --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,153 @@ +# Universal Windows Platform +# Build a Universal Windows Platform project using Visual Studio. +# Add steps that test and distribute an app, save build artifacts, and more: +# https://aka.ms/yaml + +trigger: +- master + +pool: + vmImage: 'windows-latest' + +variables: + solution: '**/*.sln' + buildPlatform: 'x86' + buildConfiguration: 'Debug' + appxPackageDir: '$(build.artifactStagingDirectory)\AppxPackages\\' +stages: + - stage: Build + jobs: + - job: Build_Artifacts + displayName: Artifacts + steps: + - task: NuGetToolInstaller@1 + + - task: NuGetCommand@2 + inputs: + restoreSolution: '$(solution)' + + - task: VSBuild@1 + inputs: + platform: 'x86' + solution: '$(solution)' + configuration: '$(buildConfiguration)' + msbuildArgs: '/p:AppxBundlePlatforms="$(buildPlatform)" /p:AppxPackageDir="$(appxPackageDir)" /p:AppxBundle=Always /p:UapAppxPackageBuildMode=SideloadOnly /p:AppxPackageSigningEnabled=true' + + - task: PublishPipelineArtifact@1 + inputs: + targetPath: '$(System.DefaultWorkingDirectory)\artifacts\$(buildConfiguration)' + artifact: 'artifacts_$(buildConfiguration)_$(buildPlatform)' + publishLocation: 'pipeline' + + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)\AppxPackages\' + ArtifactName: 'appxbundles_$(buildConfiguration)_$(buildPlatform)' + publishLocation: 'Container' + + - stage: Testing + dependsOn: Build + jobs: + - job: Unit_Tests + displayName: Unit Tests + steps: + - task: NuGetToolInstaller@1 + + - task: NuGetCommand@2 + inputs: + restoreSolution: '$(solution)' + + - task: DownloadPipelineArtifact@2 + inputs: + buildType: 'current' + artifactName: 'artifacts_$(buildConfiguration)_$(buildPlatform)' + targetPath: '$(System.DefaultWorkingDirectory)\artifacts\$(buildConfiguration)' + + - task: VSTest@2 + inputs: + testSelector: 'testAssemblies' + testAssemblyVer2: | + **\*ControlTests**.appxrecipe + !**\*TestAdapter.dll + !**\obj\** + searchFolder: '$(System.DefaultWorkingDirectory)' + uiTests: true + + - task: VSTest@2 + inputs: + testSelector: 'testAssemblies' + testAssemblyVer2: | + **\*ResourceModelTests**.appxrecipe + !**\*TestAdapter.dll + !**\obj\** + searchFolder: '$(System.DefaultWorkingDirectory)' + uiTests: true + + - job: Interaction_Tests + displayName: Interaction Tests + steps: + - task: NuGetToolInstaller@1 + + - task: NuGetCommand@2 + inputs: + restoreSolution: '$(solution)' + + - task: DownloadPipelineArtifact@2 + inputs: + buildType: 'current' + artifactName: 'artifacts_$(buildConfiguration)_$(buildPlatform)' + targetPath: '$(System.DefaultWorkingDirectory)\artifacts\$(buildConfiguration)' + + - task: DownloadPipelineArtifact@2 + inputs: + buildType: 'current' + artifactName: 'appxbundles_$(buildConfiguration)_$(buildPlatform)' + targetPath: '$(System.DefaultWorkingDirectory)\appxbundles' + + - task: PowerShell@2 + inputs: + targetType: 'inline' + script: | + # Find correct folder and run app install script. + cd ./appxbundles + + $AppBundle = Get-ChildItem -Filter UWP*Test -Name + echo $AppBundle + cd $AppBundle + ./Add-AppDevPackage.ps1 -Force + errorActionPreference: 'continue' + failOnStderr: true + workingDirectory: '$(System.DefaultWorkingDirectory)' + + - task: VSTest@2 + inputs: + testSelector: 'testAssemblies' + testAssemblyVer2: | + **\*AppInteractionTests**.dll + !**\*TestAdapter.dll + !**\obj\** + searchFolder: '$(System.DefaultWorkingDirectory)' + + - stage: Publish + dependsOn: Testing + jobs: + - job: Publish_Release + displayName: Release Build + steps: + - task: NuGetToolInstaller@1 + + - task: NuGetCommand@2 + inputs: + restoreSolution: '$(solution)' + - task: VSBuild@1 + inputs: + platform: 'x86' + solution: '$(solution)' + configuration: 'Release' + msbuildArgs: '/p:AppxBundlePlatforms="$(buildPlatform)" /p:AppxPackageDir="$(appxPackageDir)" /p:AppxBundle=Always /p:UapAppxPackageBuildMode=StoreUpload /p:AppxPackageSigningEnabled=true' + + - task: PublishPipelineArtifact@1 + inputs: + targetPath: '$(System.DefaultWorkingDirectory)\artifacts\Release\' + artifact: 'Release_$(buildPlatform)' + publishLocation: 'pipeline' diff --git a/src/ResourceModel/Assets/IconList.json b/src/ResourceModel/Assets/IconList.json new file mode 100644 index 0000000..33e4b78 --- /dev/null +++ b/src/ResourceModel/Assets/IconList.json @@ -0,0 +1,5440 @@ +{ + "icons": [ + { + "code": "E700", + "name": "GlobalNavigationButton" + }, + { + "code": "E701", + "name": "Wifi" + }, + { + "code": "E702", + "name": "Bluetooth" + }, + { + "code": "E703", + "name": "Connect" + }, + { + "code": "E704", + "name": "InternetSharing" + }, + { + "code": "E705", + "name": "VPN" + }, + { + "code": "E706", + "name": "Brightness" + }, + { + "code": "E707", + "name": "MapPin" + }, + { + "code": "E708", + "name": "QuietHours" + }, + { + "code": "E709", + "name": "Airplane" + }, + { + "code": "E70A", + "name": "Tablet" + }, + { + "code": "E70B", + "name": "QuickNote" + }, + { + "code": "E70C", + "name": "RememberedDevice" + }, + { + "code": "E70D", + "name": "ChevronDown" + }, + { + "code": "E70E", + "name": "ChevronUp" + }, + { + "code": "E70F", + "name": "Edit" + }, + { + "code": "E710", + "name": "Add" + }, + { + "code": "E711", + "name": "Cancel" + }, + { + "code": "E712", + "name": "More" + }, + { + "code": "E713", + "name": "Settings" + }, + { + "code": "E714", + "name": "Video" + }, + { + "code": "E715", + "name": "Mail" + }, + { + "code": "E716", + "name": "People" + }, + { + "code": "E717", + "name": "Phone" + }, + { + "code": "E718", + "name": "Pin" + }, + { + "code": "E719", + "name": "Shop" + }, + { + "code": "E71A", + "name": "Stop" + }, + { + "code": "E71B", + "name": "Link" + }, + { + "code": "E71C", + "name": "Filter" + }, + { + "code": "E71D", + "name": "AllApps" + }, + { + "code": "E71E", + "name": "Zoom" + }, + { + "code": "E71F", + "name": "ZoomOut" + }, + { + "code": "E720", + "name": "Microphone" + }, + { + "code": "E721", + "name": "Search" + }, + { + "code": "E722", + "name": "Camera" + }, + { + "code": "E723", + "name": "Attach" + }, + { + "code": "E724", + "name": "Send" + }, + { + "code": "E725", + "name": "SendFill" + }, + { + "code": "E726", + "name": "WalkSolid" + }, + { + "code": "E727", + "name": "InPrivate" + }, + { + "code": "E728", + "name": "FavoriteList" + }, + { + "code": "E729", + "name": "PageSolid" + }, + { + "code": "E72A", + "name": "Forward" + }, + { + "code": "E72B", + "name": "Back" + }, + { + "code": "E72C", + "name": "Refresh" + }, + { + "code": "E72D", + "name": "Share" + }, + { + "code": "E72E", + "name": "Lock" + }, + { + "code": "E730", + "name": "ReportHacked" + }, + { + "code": "E731", + "name": "EMI" + }, + { + "code": "E734", + "name": "FavoriteStar" + }, + { + "code": "E735", + "name": "FavoriteStarFill" + }, + { + "code": "E736", + "name": "ReadingMode" + }, + { + "code": "E737", + "name": "Favicon" + }, + { + "code": "E738", + "name": "Remove" + }, + { + "code": "E739", + "name": "Checkbox" + }, + { + "code": "E73A", + "name": "CheckboxComposite" + }, + { + "code": "E73B", + "name": "CheckboxFill" + }, + { + "code": "E73C", + "name": "CheckboxIndeterminate" + }, + { + "code": "E73D", + "name": "CheckboxCompositeReversed" + }, + { + "code": "E73E", + "name": "CheckMark" + }, + { + "code": "E73F", + "name": "BackToWindow" + }, + { + "code": "E740", + "name": "FullScreen" + }, + { + "code": "E741", + "name": "ResizeTouchLarger" + }, + { + "code": "E742", + "name": "ResizeTouchSmaller" + }, + { + "code": "E743", + "name": "ResizeMouseSmall" + }, + { + "code": "E744", + "name": "ResizeMouseMedium" + }, + { + "code": "E745", + "name": "ResizeMouseWide" + }, + { + "code": "E746", + "name": "ResizeMouseTall" + }, + { + "code": "E747", + "name": "ResizeMouseLarge" + }, + { + "code": "E748", + "name": "SwitchUser" + }, + { + "code": "E749", + "name": "Print" + }, + { + "code": "E74A", + "name": "Up" + }, + { + "code": "E74B", + "name": "Down" + }, + { + "code": "E74C", + "name": "OEM" + }, + { + "code": "E74D", + "name": "Delete" + }, + { + "code": "E74E", + "name": "Save" + }, + { + "code": "E74F", + "name": "Mute" + }, + { + "code": "E750", + "name": "BackSpaceQWERTY" + }, + { + "code": "E751", + "name": "ReturnKey" + }, + { + "code": "E752", + "name": "UpArrowShiftKey" + }, + { + "code": "E753", + "name": "Cloud" + }, + { + "code": "E754", + "name": "Flashlight" + }, + { + "code": "E755", + "name": "RotationLock" + }, + { + "code": "E756", + "name": "CommandPrompt" + }, + { + "code": "E759", + "name": "SIPMove" + }, + { + "code": "E75A", + "name": "SIPUndock" + }, + { + "code": "E75B", + "name": "SIPRedock" + }, + { + "code": "E75C", + "name": "EraseTool" + }, + { + "code": "E75D", + "name": "UnderscoreSpace" + }, + { + "code": "E75E", + "name": "GripperTool" + }, + { + "code": "E75F", + "name": "Dialpad" + }, + { + "code": "E760", + "name": "PageLeft" + }, + { + "code": "E761", + "name": "PageRight" + }, + { + "code": "E762", + "name": "MultiSelect" + }, + { + "code": "E763", + "name": "KeyboardLeftHanded" + }, + { + "code": "E764", + "name": "KeyboardRightHanded" + }, + { + "code": "E765", + "name": "KeyboardClassic" + }, + { + "code": "E766", + "name": "KeyboardSplit" + }, + { + "code": "E767", + "name": "Volume" + }, + { + "code": "E768", + "name": "Play" + }, + { + "code": "E769", + "name": "Pause" + }, + { + "code": "E76B", + "name": "ChevronLeft" + }, + { + "code": "E76C", + "name": "ChevronRight" + }, + { + "code": "E76D", + "name": "InkingTool" + }, + { + "code": "E76E", + "name": "Emoji2" + }, + { + "code": "E76F", + "name": "GripperBarHorizontal" + }, + { + "code": "E770", + "name": "System" + }, + { + "code": "E771", + "name": "Personalize" + }, + { + "code": "E772", + "name": "Devices" + }, + { + "code": "E773", + "name": "SearchAndApps" + }, + { + "code": "E774", + "name": "Globe" + }, + { + "code": "E775", + "name": "TimeLanguage" + }, + { + "code": "E776", + "name": "EaseOfAccess" + }, + { + "code": "E777", + "name": "UpdateRestore" + }, + { + "code": "E778", + "name": "HangUp" + }, + { + "code": "E779", + "name": "ContactInfo" + }, + { + "code": "E77A", + "name": "Unpin" + }, + { + "code": "E77B", + "name": "Contact" + }, + { + "code": "E77C", + "name": "Memo" + }, + { + "code": "E77E", + "name": "IncomingCall" + }, + { + "code": "E77F", + "name": "Paste" + }, + { + "code": "E780", + "name": "PhoneBook" + }, + { + "code": "E781", + "name": "LEDLight" + }, + { + "code": "E783", + "name": "Error" + }, + { + "code": "E784", + "name": "GripperBarVertical" + }, + { + "code": "E785", + "name": "Unlock" + }, + { + "code": "E786", + "name": "Slideshow" + }, + { + "code": "E787", + "name": "Calendar" + }, + { + "code": "E788", + "name": "GripperResize" + }, + { + "code": "E789", + "name": "Megaphone" + }, + { + "code": "E78A", + "name": "Trim" + }, + { + "code": "E78B", + "name": "NewWindow" + }, + { + "code": "E78C", + "name": "SaveLocal" + }, + { + "code": "E790", + "name": "Color" + }, + { + "code": "E791", + "name": "DataSense" + }, + { + "code": "E792", + "name": "SaveAs" + }, + { + "code": "E793", + "name": "Light" + }, + { + "code": "E799", + "name": "AspectRatio" + }, + { + "code": "E7A5", + "name": "DataSenseBar" + }, + { + "code": "E7A6", + "name": "Redo" + }, + { + "code": "E7A7", + "name": "Undo" + }, + { + "code": "E7A8", + "name": "Crop" + }, + { + "code": "E7AC", + "name": "OpenWith" + }, + { + "code": "E7AD", + "name": "Rotate" + }, + { + "code": "E7B3", + "name": "RedEye" + }, + { + "code": "E7B5", + "name": "SetlockScreen" + }, + { + "code": "E7B7", + "name": "MapPin2" + }, + { + "code": "E7B8", + "name": "Package" + }, + { + "code": "E7BA", + "name": "Warning" + }, + { + "code": "E7BC", + "name": "ReadingList" + }, + { + "code": "E7BE", + "name": "Education" + }, + { + "code": "E7BF", + "name": "ShoppingCart" + }, + { + "code": "E7C0", + "name": "Train" + }, + { + "code": "E7C1", + "name": "Flag" + }, + { + "code": "E7C3", + "name": "Page" + }, + { + "code": "E7C4", + "name": "TaskView" + }, + { + "code": "E7C5", + "name": "BrowsePhotos" + }, + { + "code": "E7C6", + "name": "HalfStarLeft" + }, + { + "code": "E7C7", + "name": "HalfStarRight" + }, + { + "code": "E7C8", + "name": "Record" + }, + { + "code": "E7C9", + "name": "TouchPointer" + }, + { + "code": "E7DE", + "name": "LangJPN" + }, + { + "code": "E7E3", + "name": "Ferry" + }, + { + "code": "E7E6", + "name": "Highlight" + }, + { + "code": "E7E7", + "name": "ActionCenterNotification" + }, + { + "code": "E7E8", + "name": "PowerButton" + }, + { + "code": "E7EA", + "name": "ResizeTouchNarrower" + }, + { + "code": "E7EB", + "name": "ResizeTouchShorter" + }, + { + "code": "E7EC", + "name": "DrivingMode" + }, + { + "code": "E7ED", + "name": "RingerSilent" + }, + { + "code": "E7EE", + "name": "OtherUser" + }, + { + "code": "E7EF", + "name": "Admin" + }, + { + "code": "E7F0", + "name": "CC" + }, + { + "code": "E7F1", + "name": "SDCard" + }, + { + "code": "E7F2", + "name": "CallForwarding" + }, + { + "code": "E7F3", + "name": "SettingsDisplaySound" + }, + { + "code": "E7F4", + "name": "TVMonitor" + }, + { + "code": "E7F5", + "name": "Speakers" + }, + { + "code": "E7F6", + "name": "Headphone" + }, + { + "code": "E7F7", + "name": "DeviceLaptopPic" + }, + { + "code": "E7F8", + "name": "DeviceLaptopNoPic" + }, + { + "code": "E7F9", + "name": "DeviceMonitorRightPic" + }, + { + "code": "E7FA", + "name": "DeviceMonitorLeftPic" + }, + { + "code": "E7FB", + "name": "DeviceMonitorNoPic" + }, + { + "code": "E7FC", + "name": "Game" + }, + { + "code": "E7FD", + "name": "HorizontalTabKey" + }, + { + "code": "E802", + "name": "StreetsideSplitMinimize" + }, + { + "code": "E803", + "name": "StreetsideSplitExpand" + }, + { + "code": "E804", + "name": "Car" + }, + { + "code": "E805", + "name": "Walk" + }, + { + "code": "E806", + "name": "Bus" + }, + { + "code": "E809", + "name": "TiltUp" + }, + { + "code": "E80A", + "name": "TiltDown" + }, + { + "code": "E80B", + "name": "CallControl" + }, + { + "code": "E80C", + "name": "RotateMapRight" + }, + { + "code": "E80D", + "name": "RotateMapLeft" + }, + { + "code": "E80F", + "name": "Home" + }, + { + "code": "E811", + "name": "ParkingLocation" + }, + { + "code": "E812", + "name": "MapCompassTop" + }, + { + "code": "E813", + "name": "MapCompassBottom" + }, + { + "code": "E814", + "name": "IncidentTriangle" + }, + { + "code": "E815", + "name": "Touch" + }, + { + "code": "E816", + "name": "MapDirections" + }, + { + "code": "E819", + "name": "StartPoint" + }, + { + "code": "E81A", + "name": "StopPoint" + }, + { + "code": "E81B", + "name": "EndPoint" + }, + { + "code": "E81C", + "name": "History" + }, + { + "code": "E81D", + "name": "Location" + }, + { + "code": "E81E", + "name": "MapLayers" + }, + { + "code": "E81F", + "name": "Accident" + }, + { + "code": "E821", + "name": "Work" + }, + { + "code": "E822", + "name": "Construction" + }, + { + "code": "E823", + "name": "Recent" + }, + { + "code": "E825", + "name": "Bank" + }, + { + "code": "E826", + "name": "DownloadMap" + }, + { + "code": "E829", + "name": "InkingToolFill2" + }, + { + "code": "E82A", + "name": "HighlightFill2" + }, + { + "code": "E82B", + "name": "EraseToolFill" + }, + { + "code": "E82C", + "name": "EraseToolFill2" + }, + { + "code": "E82D", + "name": "Dictionary" + }, + { + "code": "E82E", + "name": "DictionaryAdd" + }, + { + "code": "E82F", + "name": "ToolTip" + }, + { + "code": "E830", + "name": "ChromeBack" + }, + { + "code": "E835", + "name": "ProvisioningPackage" + }, + { + "code": "E836", + "name": "AddRemoteDevice" + }, + { + "code": "E838", + "name": "FolderOpen" + }, + { + "code": "E839", + "name": "Ethernet" + }, + { + "code": "E83A", + "name": "ShareBroadband" + }, + { + "code": "E83B", + "name": "DirectAccess" + }, + { + "code": "E83C", + "name": "DialUp" + }, + { + "code": "E83D", + "name": "DefenderApp " + }, + { + "code": "E83E", + "name": "BatteryCharging9" + }, + { + "code": "E83F", + "name": "Battery10" + }, + { + "code": "E840", + "name": "Pinned" + }, + { + "code": "E841", + "name": "PinFill" + }, + { + "code": "E842", + "name": "PinnedFill" + }, + { + "code": "E843", + "name": "PeriodKey" + }, + { + "code": "E844", + "name": "PuncKey" + }, + { + "code": "E845", + "name": "RevToggleKey" + }, + { + "code": "E846", + "name": "RightArrowKeyTime1" + }, + { + "code": "E847", + "name": "RightArrowKeyTime2" + }, + { + "code": "E848", + "name": "LeftQuote" + }, + { + "code": "E849", + "name": "RightQuote" + }, + { + "code": "E84A", + "name": "DownShiftKey" + }, + { + "code": "E84B", + "name": "UpShiftKey" + }, + { + "code": "E84C", + "name": "PuncKey0" + }, + { + "code": "E84D", + "name": "PuncKeyLeftBottom" + }, + { + "code": "E84E", + "name": "RightArrowKeyTime3" + }, + { + "code": "E84F", + "name": "RightArrowKeyTime4" + }, + { + "code": "E850", + "name": "Battery0" + }, + { + "code": "E851", + "name": "Battery1" + }, + { + "code": "E852", + "name": "Battery2" + }, + { + "code": "E853", + "name": "Battery3" + }, + { + "code": "E854", + "name": "Battery4" + }, + { + "code": "E855", + "name": "Battery5" + }, + { + "code": "E856", + "name": "Battery6" + }, + { + "code": "E857", + "name": "Battery7" + }, + { + "code": "E858", + "name": "Battery8" + }, + { + "code": "E859", + "name": "Battery9" + }, + { + "code": "E85A", + "name": "BatteryCharging0" + }, + { + "code": "E85B", + "name": "BatteryCharging1" + }, + { + "code": "E85C", + "name": "BatteryCharging2" + }, + { + "code": "E85D", + "name": "BatteryCharging3" + }, + { + "code": "E85E", + "name": "BatteryCharging4" + }, + { + "code": "E85F", + "name": "BatteryCharging5" + }, + { + "code": "E860", + "name": "BatteryCharging6" + }, + { + "code": "E861", + "name": "BatteryCharging7" + }, + { + "code": "E862", + "name": "BatteryCharging8" + }, + { + "code": "E863", + "name": "BatterySaver0" + }, + { + "code": "E864", + "name": "BatterySaver1" + }, + { + "code": "E865", + "name": "BatterySaver2" + }, + { + "code": "E866", + "name": "BatterySaver3" + }, + { + "code": "E867", + "name": "BatterySaver4" + }, + { + "code": "E868", + "name": "BatterySaver5" + }, + { + "code": "E869", + "name": "BatterySaver6" + }, + { + "code": "E86A", + "name": "BatterySaver7" + }, + { + "code": "E86B", + "name": "BatterySaver8" + }, + { + "code": "E86C", + "name": "SignalBars1" + }, + { + "code": "E86D", + "name": "SignalBars2" + }, + { + "code": "E86E", + "name": "SignalBars3" + }, + { + "code": "E86F", + "name": "SignalBars4" + }, + { + "code": "E870", + "name": "SignalBars5" + }, + { + "code": "E871", + "name": "SignalNotConnected" + }, + { + "code": "E872", + "name": "Wifi1" + }, + { + "code": "E873", + "name": "Wifi2" + }, + { + "code": "E874", + "name": "Wifi3" + }, + { + "code": "E875", + "name": "MobSIMLock" + }, + { + "code": "E876", + "name": "MobSIMMissing" + }, + { + "code": "E877", + "name": "Vibrate" + }, + { + "code": "E878", + "name": "RoamingInternational" + }, + { + "code": "E879", + "name": "RoamingDomestic" + }, + { + "code": "E87A", + "name": "CallForwardInternational" + }, + { + "code": "E87B", + "name": "CallForwardRoaming" + }, + { + "code": "E87C", + "name": "JpnRomanji" + }, + { + "code": "E87D", + "name": "JpnRomanjiLock" + }, + { + "code": "E87E", + "name": "JpnRomanjiShift" + }, + { + "code": "E87F", + "name": "JpnRomanjiShiftLock" + }, + { + "code": "E880", + "name": "StatusDataTransfer" + }, + { + "code": "E881", + "name": "StatusDataTransferVPN" + }, + { + "code": "E882", + "name": "StatusDualSIM2" + }, + { + "code": "E883", + "name": "StatusDualSIM2VPN" + }, + { + "code": "E884", + "name": "StatusDualSIM1" + }, + { + "code": "E885", + "name": "StatusDualSIM1VPN" + }, + { + "code": "E886", + "name": "StatusSGLTE" + }, + { + "code": "E887", + "name": "StatusSGLTECell" + }, + { + "code": "E888", + "name": "StatusSGLTEDataVPN" + }, + { + "code": "E889", + "name": "StatusVPN" + }, + { + "code": "E88A", + "name": "WifiHotspot" + }, + { + "code": "E88B", + "name": "LanguageKor" + }, + { + "code": "E88C", + "name": "LanguageCht" + }, + { + "code": "E88D", + "name": "LanguageChs" + }, + { + "code": "E88E", + "name": "USB" + }, + { + "code": "E88F", + "name": "InkingToolFill" + }, + { + "code": "E890", + "name": "View" + }, + { + "code": "E891", + "name": "HighlightFill" + }, + { + "code": "E892", + "name": "Previous" + }, + { + "code": "E893", + "name": "Next" + }, + { + "code": "E894", + "name": "Clear" + }, + { + "code": "E895", + "name": "Sync" + }, + { + "code": "E896", + "name": "Download" + }, + { + "code": "E897", + "name": "Help" + }, + { + "code": "E898", + "name": "Upload" + }, + { + "code": "E899", + "name": "Emoji" + }, + { + "code": "E89A", + "name": "TwoPage" + }, + { + "code": "E89B", + "name": "LeaveChat" + }, + { + "code": "E89C", + "name": "MailForward" + }, + { + "code": "E89E", + "name": "RotateCamera" + }, + { + "code": "E89F", + "name": "ClosePane" + }, + { + "code": "E8A0", + "name": "OpenPane" + }, + { + "code": "E8A1", + "name": "PreviewLink" + }, + { + "code": "E8A2", + "name": "AttachCamera" + }, + { + "code": "E8A3", + "name": "ZoomIn" + }, + { + "code": "E8A4", + "name": "Bookmarks" + }, + { + "code": "E8A5", + "name": "Document" + }, + { + "code": "E8A6", + "name": "ProtectedDocument" + }, + { + "code": "E8A7", + "name": "OpenInNewWindow" + }, + { + "code": "E8A8", + "name": "MailFill" + }, + { + "code": "E8A9", + "name": "ViewAll" + }, + { + "code": "E8AA", + "name": "VideoChat" + }, + { + "code": "E8AB", + "name": "Switch" + }, + { + "code": "E8AC", + "name": "Rename" + }, + { + "code": "E8AD", + "name": "Go" + }, + { + "code": "E8AE", + "name": "SurfaceHub" + }, + { + "code": "E8AF", + "name": "Remote" + }, + { + "code": "E8B0", + "name": "Click" + }, + { + "code": "E8B1", + "name": "Shuffle" + }, + { + "code": "E8B2", + "name": "Movies" + }, + { + "code": "E8B3", + "name": "SelectAll" + }, + { + "code": "E8B4", + "name": "Orientation" + }, + { + "code": "E8B5", + "name": "Import" + }, + { + "code": "E8B6", + "name": "ImportAll" + }, + { + "code": "E8B7", + "name": "Folder" + }, + { + "code": "E8B8", + "name": "Webcam" + }, + { + "code": "E8B9", + "name": "Picture" + }, + { + "code": "E8BA", + "name": "Caption" + }, + { + "code": "E8BB", + "name": "ChromeClose" + }, + { + "code": "E8BC", + "name": "ShowResults" + }, + { + "code": "E8BD", + "name": "Message" + }, + { + "code": "E8BE", + "name": "Leaf" + }, + { + "code": "E8BF", + "name": "CalendarDay" + }, + { + "code": "E8C0", + "name": "CalendarWeek" + }, + { + "code": "E8C1", + "name": "Characters" + }, + { + "code": "E8C2", + "name": "MailReplyAll" + }, + { + "code": "E8C3", + "name": "Read" + }, + { + "code": "E8C4", + "name": "ShowBcc" + }, + { + "code": "E8C5", + "name": "HideBcc" + }, + { + "code": "E8C6", + "name": "Cut" + }, + { + "code": "E8C7", + "name": "PaymentCard" + }, + { + "code": "E8C8", + "name": "Copy" + }, + { + "code": "E8C9", + "name": "Important" + }, + { + "code": "E8CA", + "name": "MailReply" + }, + { + "code": "E8CB", + "name": "Sort" + }, + { + "code": "E8CC", + "name": "MobileTablet" + }, + { + "code": "E8CD", + "name": "DisconnectDrive" + }, + { + "code": "E8CE", + "name": "MapDrive" + }, + { + "code": "E8CF", + "name": "ContactPresence" + }, + { + "code": "E8D0", + "name": "Priority" + }, + { + "code": "E8D1", + "name": "GotoToday" + }, + { + "code": "E8D2", + "name": "Font" + }, + { + "code": "E8D3", + "name": "FontColor" + }, + { + "code": "E8D4", + "name": "Contact2" + }, + { + "code": "E8D5", + "name": "FolderFill" + }, + { + "code": "E8D6", + "name": "Audio" + }, + { + "code": "E8D7", + "name": "Permissions" + }, + { + "code": "E8D8", + "name": "DisableUpdates" + }, + { + "code": "E8D9", + "name": "Unfavorite" + }, + { + "code": "E8DA", + "name": "OpenLocal" + }, + { + "code": "E8DB", + "name": "Italic" + }, + { + "code": "E8DC", + "name": "Underline" + }, + { + "code": "E8DD", + "name": "Bold" + }, + { + "code": "E8DE", + "name": "MoveToFolder" + }, + { + "code": "E8DF", + "name": "LikeDislike" + }, + { + "code": "E8E0", + "name": "Dislike" + }, + { + "code": "E8E1", + "name": "Like" + }, + { + "code": "E8E2", + "name": "AlignRight" + }, + { + "code": "E8E3", + "name": "AlignCenter" + }, + { + "code": "E8E4", + "name": "AlignLeft" + }, + { + "code": "E8E5", + "name": "OpenFile" + }, + { + "code": "E8E6", + "name": "ClearSelection" + }, + { + "code": "E8E7", + "name": "FontDecrease" + }, + { + "code": "E8E8", + "name": "FontIncrease" + }, + { + "code": "E8E9", + "name": "FontSize" + }, + { + "code": "E8EA", + "name": "CellPhone" + }, + { + "code": "E8EB", + "name": "Reshare" + }, + { + "code": "E8EC", + "name": "Tag" + }, + { + "code": "E8ED", + "name": "RepeatOne" + }, + { + "code": "E8EE", + "name": "RepeatAll" + }, + { + "code": "E8EF", + "name": "Calculator" + }, + { + "code": "E8F0", + "name": "Directions" + }, + { + "code": "E8F1", + "name": "Library" + }, + { + "code": "E8F2", + "name": "ChatBubbles" + }, + { + "code": "E8F3", + "name": "PostUpdate" + }, + { + "code": "E8F4", + "name": "NewFolder" + }, + { + "code": "E8F5", + "name": "CalendarReply" + }, + { + "code": "E8F6", + "name": "UnsyncFolder" + }, + { + "code": "E8F7", + "name": "SyncFolder" + }, + { + "code": "E8F8", + "name": "BlockContact" + }, + { + "code": "E8F9", + "name": "SwitchApps" + }, + { + "code": "E8FA", + "name": "AddFriend" + }, + { + "code": "E8FB", + "name": "Accept" + }, + { + "code": "E8FC", + "name": "GoToStart" + }, + { + "code": "E8FD", + "name": "BulletedList" + }, + { + "code": "E8FE", + "name": "Scan" + }, + { + "code": "E8FF", + "name": "Preview" + }, + { + "code": "E902", + "name": "Group" + }, + { + "code": "E904", + "name": "ZeroBars" + }, + { + "code": "E905", + "name": "OneBar" + }, + { + "code": "E906", + "name": "TwoBars" + }, + { + "code": "E907", + "name": "ThreeBars" + }, + { + "code": "E908", + "name": "FourBars" + }, + { + "code": "E909", + "name": "World" + }, + { + "code": "E90A", + "name": "Comment" + }, + { + "code": "E90B", + "name": "MusicInfo" + }, + { + "code": "E90C", + "name": "DockLeft" + }, + { + "code": "E90D", + "name": "DockRight" + }, + { + "code": "E90E", + "name": "DockBottom" + }, + { + "code": "E90F", + "name": "Repair" + }, + { + "code": "E910", + "name": "Accounts" + }, + { + "code": "E911", + "name": "DullSound" + }, + { + "code": "E912", + "name": "Manage" + }, + { + "code": "E913", + "name": "Street" + }, + { + "code": "E914", + "name": "Printer3D" + }, + { + "code": "E915", + "name": "RadioBullet" + }, + { + "code": "E916", + "name": "Stopwatch" + }, + { + "code": "E91B", + "name": "Photo" + }, + { + "code": "E91C", + "name": "ActionCenter" + }, + { + "code": "E91F", + "name": "FullCircleMask" + }, + { + "code": "E921", + "name": "ChromeMinimize" + }, + { + "code": "E922", + "name": "ChromeMaximize" + }, + { + "code": "E923", + "name": "ChromeRestore" + }, + { + "code": "E924", + "name": "Annotation" + }, + { + "code": "E925", + "name": "BackSpaceQWERTYSm" + }, + { + "code": "E926", + "name": "BackSpaceQWERTYMd" + }, + { + "code": "E927", + "name": "Swipe" + }, + { + "code": "E928", + "name": "Fingerprint" + }, + { + "code": "E929", + "name": "Handwriting" + }, + { + "code": "E92C", + "name": "ChromeBackToWindow" + }, + { + "code": "E92D", + "name": "ChromeFullScreen" + }, + { + "code": "E92E", + "name": "KeyboardStandard" + }, + { + "code": "E92F", + "name": "KeyboardDismiss" + }, + { + "code": "E930", + "name": "Completed" + }, + { + "code": "E931", + "name": "ChromeAnnotate" + }, + { + "code": "E932", + "name": "Label" + }, + { + "code": "E933", + "name": "IBeam" + }, + { + "code": "E934", + "name": "IBeamOutline" + }, + { + "code": "E935", + "name": "FlickDown" + }, + { + "code": "E936", + "name": "FlickUp" + }, + { + "code": "E937", + "name": "FlickLeft" + }, + { + "code": "E938", + "name": "FlickRight" + }, + { + "code": "E939", + "name": "FeedbackApp" + }, + { + "code": "E93C", + "name": "MusicAlbum" + }, + { + "code": "E93E", + "name": "Streaming" + }, + { + "code": "E943", + "name": "Code" + }, + { + "code": "E944", + "name": "ReturnToWindow" + }, + { + "code": "E945", + "name": "LightningBolt" + }, + { + "code": "E946", + "name": "Info" + }, + { + "code": "E947", + "name": "CalculatorMultiply" + }, + { + "code": "E948", + "name": "CalculatorAddition" + }, + { + "code": "E949", + "name": "CalculatorSubtract" + }, + { + "code": "E94A", + "name": "CalculatorDivide" + }, + { + "code": "E94B", + "name": "CalculatorSquareroot" + }, + { + "code": "E94C", + "name": "CalculatorPercentage" + }, + { + "code": "E94D", + "name": "CalculatorNegate" + }, + { + "code": "E94E", + "name": "CalculatorEqualTo" + }, + { + "code": "E94F", + "name": "CalculatorBackspace" + }, + { + "code": "E950", + "name": "Component" + }, + { + "code": "E951", + "name": "DMC" + }, + { + "code": "E952", + "name": "Dock" + }, + { + "code": "E953", + "name": "MultimediaDMS" + }, + { + "code": "E954", + "name": "MultimediaDVR" + }, + { + "code": "E955", + "name": "MultimediaPMP" + }, + { + "code": "E956", + "name": "PrintfaxPrinterFile" + }, + { + "code": "E957", + "name": "Sensor" + }, + { + "code": "E958", + "name": "StorageOptical" + }, + { + "code": "E95A", + "name": "Communications" + }, + { + "code": "E95B", + "name": "Headset" + }, + { + "code": "E95D", + "name": "Projector" + }, + { + "code": "E95E", + "name": "Health" + }, + { + "code": "E95F", + "name": "Wire" + }, + { + "code": "E960", + "name": "Webcam2" + }, + { + "code": "E961", + "name": "Input" + }, + { + "code": "E962", + "name": "Mouse" + }, + { + "code": "E963", + "name": "Smartcard" + }, + { + "code": "E964", + "name": "SmartcardVirtual" + }, + { + "code": "E965", + "name": "MediaStorageTower" + }, + { + "code": "E966", + "name": "ReturnKeySm" + }, + { + "code": "E967", + "name": "GameConsole" + }, + { + "code": "E968", + "name": "Network" + }, + { + "code": "E969", + "name": "StorageNetworkWireless" + }, + { + "code": "E96A", + "name": "StorageTape" + }, + { + "code": "E96D", + "name": "ChevronUpSmall" + }, + { + "code": "E96E", + "name": "ChevronDownSmall" + }, + { + "code": "E96F", + "name": "ChevronLeftSmall" + }, + { + "code": "E970", + "name": "ChevronRightSmall" + }, + { + "code": "E971", + "name": "ChevronUpMed" + }, + { + "code": "E972", + "name": "ChevronDownMed" + }, + { + "code": "E973", + "name": "ChevronLeftMed" + }, + { + "code": "E974", + "name": "ChevronRightMed" + }, + { + "code": "E975", + "name": "Devices2" + }, + { + "code": "E976", + "name": "ExpandTile" + }, + { + "code": "E977", + "name": "PC1" + }, + { + "code": "E978", + "name": "PresenceChicklet" + }, + { + "code": "E979", + "name": "PresenceChickletVideo" + }, + { + "code": "E97A", + "name": "Reply" + }, + { + "code": "E97B", + "name": "SetTile" + }, + { + "code": "E97C", + "name": "Type" + }, + { + "code": "E97D", + "name": "Korean" + }, + { + "code": "E97E", + "name": "HalfAlpha" + }, + { + "code": "E97F", + "name": "FullAlpha" + }, + { + "code": "E980", + "name": "Key12On" + }, + { + "code": "E981", + "name": "ChineseChangjie" + }, + { + "code": "E982", + "name": "QWERTYOn" + }, + { + "code": "E983", + "name": "QWERTYOff" + }, + { + "code": "E984", + "name": "ChineseQuick" + }, + { + "code": "E985", + "name": "Japanese" + }, + { + "code": "E986", + "name": "FullHiragana" + }, + { + "code": "E987", + "name": "FullKatakana" + }, + { + "code": "E988", + "name": "HalfKatakana" + }, + { + "code": "E989", + "name": "ChineseBoPoMoFo" + }, + { + "code": "E98A", + "name": "ChinesePinyin" + }, + { + "code": "E98F", + "name": "ConstructionCone" + }, + { + "code": "E990", + "name": "XboxOneConsole" + }, + { + "code": "E992", + "name": "Volume0" + }, + { + "code": "E993", + "name": "Volume1" + }, + { + "code": "E994", + "name": "Volume2" + }, + { + "code": "E995", + "name": "Volume3" + }, + { + "code": "E996", + "name": "BatteryUnknown" + }, + { + "code": "E998", + "name": "WifiAttentionOverlay" + }, + { + "code": "E99A", + "name": "Robot" + }, + { + "code": "E9A1", + "name": "TapAndSend" + }, + { + "code": "E9A6", + "name": "FitPage" + }, + { + "code": "E9A8", + "name": "PasswordKeyShow" + }, + { + "code": "E9A9", + "name": "PasswordKeyHide" + }, + { + "code": "E9AA", + "name": "BidiLtr" + }, + { + "code": "E9AB", + "name": "BidiRtl" + }, + { + "code": "E9AC", + "name": "ForwardSm" + }, + { + "code": "E9AD", + "name": "CommaKey" + }, + { + "code": "E9AE", + "name": "DashKey" + }, + { + "code": "E9AF", + "name": "DullSoundKey" + }, + { + "code": "E9B0", + "name": "HalfDullSound" + }, + { + "code": "E9B1", + "name": "RightDoubleQuote" + }, + { + "code": "E9B2", + "name": "LeftDoubleQuote" + }, + { + "code": "E9B3", + "name": "PuncKeyRightBottom" + }, + { + "code": "E9B4", + "name": "PuncKey1" + }, + { + "code": "E9B5", + "name": "PuncKey2" + }, + { + "code": "E9B6", + "name": "PuncKey3" + }, + { + "code": "E9B7", + "name": "PuncKey4" + }, + { + "code": "E9B8", + "name": "PuncKey5" + }, + { + "code": "E9B9", + "name": "PuncKey6" + }, + { + "code": "E9BA", + "name": "PuncKey9" + }, + { + "code": "E9BB", + "name": "PuncKey7" + }, + { + "code": "E9BC", + "name": "PuncKey8" + }, + { + "code": "E9CA", + "name": "Frigid" + }, + { + "code": "E9CE", + "name": "Unknown" + }, + { + "code": "E9D2", + "name": "AreaChart" + }, + { + "code": "E9D5", + "name": "CheckList" + }, + { + "code": "E9D9", + "name": "Diagnostic" + }, + { + "code": "E9E9", + "name": "Equalizer" + }, + { + "code": "E9F3", + "name": "Process" + }, + { + "code": "E9F5", + "name": "Processing" + }, + { + "code": "E9F9", + "name": "ReportDocument" + }, + { + "code": "EA0C", + "name": "VideoSolid" + }, + { + "code": "EA0D", + "name": "MixedMediaBadge" + }, + { + "code": "EA14", + "name": "DisconnectDisplay" + }, + { + "code": "EA18", + "name": "Shield" + }, + { + "code": "EA1F", + "name": "Info2" + }, + { + "code": "EA21", + "name": "ActionCenterAsterisk" + }, + { + "code": "EA24", + "name": "Beta" + }, + { + "code": "EA35", + "name": "SaveCopy" + }, + { + "code": "EA37", + "name": "List" + }, + { + "code": "EA38", + "name": "Asterisk" + }, + { + "code": "EA39", + "name": "ErrorBadge" + }, + { + "code": "EA3A", + "name": "CircleRing" + }, + { + "code": "EA3B", + "name": "CircleFill" + }, + { + "code": "EA3C", + "name": "MergeCall" + }, + { + "code": "EA3D", + "name": "PrivateCall" + }, + { + "code": "EA3F", + "name": "Record2" + }, + { + "code": "EA40", + "name": "AllAppsMirrored" + }, + { + "code": "EA41", + "name": "BookmarksMirrored" + }, + { + "code": "EA42", + "name": "BulletedListMirrored" + }, + { + "code": "EA43", + "name": "CallForwardInternationalMirrored" + }, + { + "code": "EA44", + "name": "CallForwardRoamingMirrored" + }, + { + "code": "EA47", + "name": "ChromeBackMirrored" + }, + { + "code": "EA48", + "name": "ClearSelectionMirrored" + }, + { + "code": "EA49", + "name": "ClosePaneMirrored" + }, + { + "code": "EA4A", + "name": "ContactInfoMirrored" + }, + { + "code": "EA4B", + "name": "DockRightMirrored" + }, + { + "code": "EA4C", + "name": "DockLeftMirrored" + }, + { + "code": "EA4E", + "name": "ExpandTileMirrored" + }, + { + "code": "EA4F", + "name": "GoMirrored" + }, + { + "code": "EA50", + "name": "GripperResizeMirrored" + }, + { + "code": "EA51", + "name": "HelpMirrored" + }, + { + "code": "EA52", + "name": "ImportMirrored" + }, + { + "code": "EA53", + "name": "ImportAllMirrored" + }, + { + "code": "EA54", + "name": "LeaveChatMirrored" + }, + { + "code": "EA55", + "name": "ListMirrored" + }, + { + "code": "EA56", + "name": "MailForwardMirrored" + }, + { + "code": "EA57", + "name": "MailReplyMirrored" + }, + { + "code": "EA58", + "name": "MailReplyAllMirrored" + }, + { + "code": "EA5B", + "name": "OpenPaneMirrored" + }, + { + "code": "EA5C", + "name": "OpenWithMirrored" + }, + { + "code": "EA5E", + "name": "ParkingLocationMirrored" + }, + { + "code": "EA5F", + "name": "ResizeMouseMediumMirrored" + }, + { + "code": "EA60", + "name": "ResizeMouseSmallMirrored" + }, + { + "code": "EA61", + "name": "ResizeMouseTallMirrored" + }, + { + "code": "EA62", + "name": "ResizeTouchNarrowerMirrored" + }, + { + "code": "EA63", + "name": "SendMirrored" + }, + { + "code": "EA64", + "name": "SendFillMirrored" + }, + { + "code": "EA65", + "name": "ShowResultsMirrored" + }, + { + "code": "EA69", + "name": "Media" + }, + { + "code": "EA6A", + "name": "SyncError" + }, + { + "code": "EA6C", + "name": "Devices3" + }, + { + "code": "EA79", + "name": "SlowMotionOn" + }, + { + "code": "EA80", + "name": "Lightbulb" + }, + { + "code": "EA81", + "name": "StatusCircle" + }, + { + "code": "EA82", + "name": "StatusTriangle" + }, + { + "code": "EA83", + "name": "StatusError" + }, + { + "code": "EA84", + "name": "StatusWarning" + }, + { + "code": "EA86", + "name": "Puzzle" + }, + { + "code": "EA89", + "name": "CalendarSolid" + }, + { + "code": "EA8A", + "name": "HomeSolid" + }, + { + "code": "EA8B", + "name": "ParkingLocationSolid" + }, + { + "code": "EA8C", + "name": "ContactSolid" + }, + { + "code": "EA8D", + "name": "ConstructionSolid" + }, + { + "code": "EA8E", + "name": "AccidentSolid" + }, + { + "code": "EA8F", + "name": "Ringer" + }, + { + "code": "EA90", + "name": "PDF" + }, + { + "code": "EA91", + "name": "ThoughtBubble" + }, + { + "code": "EA92", + "name": "HeartBroken" + }, + { + "code": "EA93", + "name": "BatteryCharging10" + }, + { + "code": "EA94", + "name": "BatterySaver9" + }, + { + "code": "EA95", + "name": "BatterySaver10" + }, + { + "code": "EA97", + "name": "CallForwardingMirrored" + }, + { + "code": "EA98", + "name": "MultiSelectMirrored" + }, + { + "code": "EA99", + "name": "Broom" + }, + { + "code": "EAC2", + "name": "ForwardCall" + }, + { + "code": "EADF", + "name": "Trackers" + }, + { + "code": "EAFC", + "name": "Market" + }, + { + "code": "EB05", + "name": "PieSingle" + }, + { + "code": "EB0F", + "name": "StockDown" + }, + { + "code": "EB11", + "name": "StockUp" + }, + { + "code": "EB3C", + "name": "Design" + }, + { + "code": "EB41", + "name": "Website" + }, + { + "code": "EB42", + "name": "Drop" + }, + { + "code": "EB44", + "name": "Radar" + }, + { + "code": "EB47", + "name": "BusSolid" + }, + { + "code": "EB48", + "name": "FerrySolid" + }, + { + "code": "EB49", + "name": "StartPointSolid" + }, + { + "code": "EB4A", + "name": "StopPointSolid" + }, + { + "code": "EB4B", + "name": "EndPointSolid" + }, + { + "code": "EB4C", + "name": "AirplaneSolid" + }, + { + "code": "EB4D", + "name": "TrainSolid" + }, + { + "code": "EB4E", + "name": "WorkSolid" + }, + { + "code": "EB4F", + "name": "ReminderFill" + }, + { + "code": "EB50", + "name": "Reminder" + }, + { + "code": "EB51", + "name": "Heart" + }, + { + "code": "EB52", + "name": "HeartFill" + }, + { + "code": "EB55", + "name": "EthernetError" + }, + { + "code": "EB56", + "name": "EthernetWarning" + }, + { + "code": "EB57", + "name": "StatusConnecting1" + }, + { + "code": "EB58", + "name": "StatusConnecting2" + }, + { + "code": "EB59", + "name": "StatusUnsecure" + }, + { + "code": "EB5A", + "name": "WifiError0" + }, + { + "code": "EB5B", + "name": "WifiError1" + }, + { + "code": "EB5C", + "name": "WifiError2" + }, + { + "code": "EB5D", + "name": "WifiError3" + }, + { + "code": "EB5E", + "name": "WifiError4" + }, + { + "code": "EB5F", + "name": "WifiWarning0" + }, + { + "code": "EB60", + "name": "WifiWarning1" + }, + { + "code": "EB61", + "name": "WifiWarning2" + }, + { + "code": "EB62", + "name": "WifiWarning3" + }, + { + "code": "EB63", + "name": "WifiWarning4" + }, + { + "code": "EB66", + "name": "Devices4" + }, + { + "code": "EB67", + "name": "NUIIris" + }, + { + "code": "EB68", + "name": "NUIFace" + }, + { + "code": "EB7E", + "name": "EditMirrored" + }, + { + "code": "EB82", + "name": "NUIFPStartSlideHand " + }, + { + "code": "EB83", + "name": "NUIFPStartSlideAction " + }, + { + "code": "EB84", + "name": "NUIFPContinueSlideHand " + }, + { + "code": "EB85", + "name": "NUIFPContinueSlideAction" + }, + { + "code": "EB86", + "name": "NUIFPRollRightHand " + }, + { + "code": "EB87", + "name": "NUIFPRollRightHandAction" + }, + { + "code": "EB88", + "name": "NUIFPRollLeftHand " + }, + { + "code": "EB89", + "name": "NUIFPRollLeftAction" + }, + { + "code": "EB8A", + "name": "NUIFPPressHand " + }, + { + "code": "EB8B", + "name": "NUIFPPressAction" + }, + { + "code": "EB8C", + "name": "NUIFPPressRepeatHand " + }, + { + "code": "EB8D", + "name": "NUIFPPressRepeatAction" + }, + { + "code": "EB90", + "name": "StatusErrorFull" + }, + { + "code": "EB91", + "name": "TaskViewExpanded" + }, + { + "code": "EB95", + "name": "Certificate" + }, + { + "code": "EB96", + "name": "BackSpaceQWERTYLg" + }, + { + "code": "EB97", + "name": "ReturnKeyLg" + }, + { + "code": "EB9D", + "name": "FastForward" + }, + { + "code": "EB9E", + "name": "Rewind" + }, + { + "code": "EB9F", + "name": "Photo2" + }, + { + "code": "EBA0", + "name": "MobBattery0" + }, + { + "code": "EBA1", + "name": "MobBattery1" + }, + { + "code": "EBA2", + "name": "MobBattery2" + }, + { + "code": "EBA3", + "name": "MobBattery3" + }, + { + "code": "EBA4", + "name": "MobBattery4" + }, + { + "code": "EBA5", + "name": "MobBattery5" + }, + { + "code": "EBA6", + "name": "MobBattery6" + }, + { + "code": "EBA7", + "name": "MobBattery7" + }, + { + "code": "EBA8", + "name": "MobBattery8" + }, + { + "code": "EBA9", + "name": "MobBattery9" + }, + { + "code": "EBAA", + "name": "MobBattery10" + }, + { + "code": "EBAB", + "name": "MobBatteryCharging0" + }, + { + "code": "EBAC", + "name": "MobBatteryCharging1" + }, + { + "code": "EBAD", + "name": "MobBatteryCharging2" + }, + { + "code": "EBAE", + "name": "MobBatteryCharging3" + }, + { + "code": "EBAF", + "name": "MobBatteryCharging4" + }, + { + "code": "EBB0", + "name": "MobBatteryCharging5" + }, + { + "code": "EBB1", + "name": "MobBatteryCharging6" + }, + { + "code": "EBB2", + "name": "MobBatteryCharging7" + }, + { + "code": "EBB3", + "name": "MobBatteryCharging8" + }, + { + "code": "EBB4", + "name": "MobBatteryCharging9" + }, + { + "code": "EBB5", + "name": "MobBatteryCharging10" + }, + { + "code": "EBB6", + "name": "MobBatterySaver0" + }, + { + "code": "EBB7", + "name": "MobBatterySaver1" + }, + { + "code": "EBB8", + "name": "MobBatterySaver2" + }, + { + "code": "EBB9", + "name": "MobBatterySaver3" + }, + { + "code": "EBBA", + "name": "MobBatterySaver4" + }, + { + "code": "EBBB", + "name": "MobBatterySaver5" + }, + { + "code": "EBBC", + "name": "MobBatterySaver6" + }, + { + "code": "EBBD", + "name": "MobBatterySaver7" + }, + { + "code": "EBBE", + "name": "MobBatterySaver8" + }, + { + "code": "EBBF", + "name": "MobBatterySaver9" + }, + { + "code": "EBC0", + "name": "MobBatterySaver10" + }, + { + "code": "EBC3", + "name": "DictionaryCloud" + }, + { + "code": "EBC4", + "name": "ResetDrive" + }, + { + "code": "EBC5", + "name": "VolumeBars" + }, + { + "code": "EBC6", + "name": "Project" + }, + { + "code": "EBD2", + "name": "AdjustHologram" + }, + { + "code": "EBD4", + "name": "WifiCallBars" + }, + { + "code": "EBD5", + "name": "WifiCall0" + }, + { + "code": "EBD6", + "name": "WifiCall1" + }, + { + "code": "EBD7", + "name": "WifiCall2" + }, + { + "code": "EBD8", + "name": "WifiCall3" + }, + { + "code": "EBD9", + "name": "WifiCall4" + }, + { + "code": "EBDA", + "name": "Family" + }, + { + "code": "EBDB", + "name": "LockFeedback" + }, + { + "code": "EBDE", + "name": "DeviceDiscovery" + }, + { + "code": "EBE6", + "name": "WindDirection" + }, + { + "code": "EBE7", + "name": "RightArrowKeyTime0" + }, + { + "code": "EBE8", + "name": "Bug" + }, + { + "code": "EBFC", + "name": "TabletMode" + }, + { + "code": "EBFD", + "name": "StatusCircleLeft" + }, + { + "code": "EBFE", + "name": "StatusTriangleLeft" + }, + { + "code": "EBFF", + "name": "StatusErrorLeft" + }, + { + "code": "EC00", + "name": "StatusWarningLeft" + }, + { + "code": "EC02", + "name": "MobBatteryUnknown" + }, + { + "code": "EC05", + "name": "NetworkTower" + }, + { + "code": "EC06", + "name": "CityNext" + }, + { + "code": "EC07", + "name": "CityNext2" + }, + { + "code": "EC08", + "name": "Courthouse" + }, + { + "code": "EC09", + "name": "Groceries" + }, + { + "code": "EC0A", + "name": "Sustainable" + }, + { + "code": "EC0B", + "name": "BuildingEnergy" + }, + { + "code": "EC11", + "name": "ToggleFilled" + }, + { + "code": "EC12", + "name": "ToggleBorder" + }, + { + "code": "EC13", + "name": "SliderThumb" + }, + { + "code": "EC14", + "name": "ToggleThumb" + }, + { + "code": "EC15", + "name": "MiracastLogoSmall" + }, + { + "code": "EC16", + "name": "MiracastLogoLarge" + }, + { + "code": "EC19", + "name": "PLAP" + }, + { + "code": "EC1B", + "name": "Badge" + }, + { + "code": "EC1E", + "name": "SignalRoaming" + }, + { + "code": "EC20", + "name": "MobileLocked" + }, + { + "code": "EC24", + "name": "InsiderHubApp" + }, + { + "code": "EC25", + "name": "PersonalFolder" + }, + { + "code": "EC26", + "name": "HomeGroup" + }, + { + "code": "EC27", + "name": "MyNetwork" + }, + { + "code": "EC31", + "name": "KeyboardFull" + }, + { + "code": "EC32", + "name": "Cafe" + }, + { + "code": "EC37", + "name": "MobSignal1" + }, + { + "code": "EC38", + "name": "MobSignal2" + }, + { + "code": "EC39", + "name": "MobSignal3" + }, + { + "code": "EC3A", + "name": "MobSignal4" + }, + { + "code": "EC3B", + "name": "MobSignal5" + }, + { + "code": "EC3C", + "name": "MobWifi1" + }, + { + "code": "EC3D", + "name": "MobWifi2" + }, + { + "code": "EC3E", + "name": "MobWifi3" + }, + { + "code": "EC3F", + "name": "MobWifi4" + }, + { + "code": "EC40", + "name": "MobAirplane" + }, + { + "code": "EC41", + "name": "MobBluetooth" + }, + { + "code": "EC42", + "name": "MobActionCenter" + }, + { + "code": "EC43", + "name": "MobLocation" + }, + { + "code": "EC44", + "name": "MobWifiHotspot" + }, + { + "code": "EC45", + "name": "LanguageJpn" + }, + { + "code": "EC46", + "name": "MobQuietHours" + }, + { + "code": "EC47", + "name": "MobDrivingMode" + }, + { + "code": "EC48", + "name": "SpeedOff" + }, + { + "code": "EC49", + "name": "SpeedMedium" + }, + { + "code": "EC4A", + "name": "SpeedHigh" + }, + { + "code": "EC4E", + "name": "ThisPC" + }, + { + "code": "EC4F", + "name": "MusicNote" + }, + { + "code": "EC50", + "name": "FileExplorer" + }, + { + "code": "EC51", + "name": "FileExplorerApp" + }, + { + "code": "EC52", + "name": "LeftArrowKeyTime0" + }, + { + "code": "EC54", + "name": "MicOff" + }, + { + "code": "EC55", + "name": "MicSleep" + }, + { + "code": "EC56", + "name": "MicError" + }, + { + "code": "EC57", + "name": "PlaybackRate1x" + }, + { + "code": "EC58", + "name": "PlaybackRateOther" + }, + { + "code": "EC59", + "name": "CashDrawer" + }, + { + "code": "EC5A", + "name": "BarcodeScanner" + }, + { + "code": "EC5B", + "name": "ReceiptPrinter" + }, + { + "code": "EC5C", + "name": "MagStripeReader" + }, + { + "code": "EC61", + "name": "CompletedSolid" + }, + { + "code": "EC64", + "name": "CompanionApp" + }, + { + "code": "EC6C", + "name": "Favicon2" + }, + { + "code": "EC6D", + "name": "SwipeRevealArt" + }, + { + "code": "EC71", + "name": "MicOn" + }, + { + "code": "EC72", + "name": "MicClipping" + }, + { + "code": "EC74", + "name": "TabletSelected" + }, + { + "code": "EC75", + "name": "MobileSelected" + }, + { + "code": "EC76", + "name": "LaptopSelected" + }, + { + "code": "EC77", + "name": "TVMonitorSelected" + }, + { + "code": "EC7A", + "name": "DeveloperTools" + }, + { + "code": "EC7E", + "name": "MobCallForwarding" + }, + { + "code": "EC7F", + "name": "MobCallForwardingMirrored" + }, + { + "code": "EC80", + "name": "BodyCam" + }, + { + "code": "EC81", + "name": "PoliceCar" + }, + { + "code": "EC87", + "name": "Draw" + }, + { + "code": "EC88", + "name": "DrawSolid" + }, + { + "code": "EC8A", + "name": "LowerBrightness" + }, + { + "code": "EC8F", + "name": "ScrollUpDown" + }, + { + "code": "EC92", + "name": "DateTime" + }, + { + "code": "ECA5", + "name": "Tiles" + }, + { + "code": "ECA7", + "name": "PartyLeader" + }, + { + "code": "ECAA", + "name": "AppIconDefault" + }, + { + "code": "ECAD", + "name": "Calories" + }, + { + "code": "ECB9", + "name": "BandBattery0" + }, + { + "code": "ECBA", + "name": "BandBattery1" + }, + { + "code": "ECBB", + "name": "BandBattery2" + }, + { + "code": "ECBC", + "name": "BandBattery3" + }, + { + "code": "ECBD", + "name": "BandBattery4" + }, + { + "code": "ECBE", + "name": "BandBattery5" + }, + { + "code": "ECBF", + "name": "BandBattery6" + }, + { + "code": "ECC4", + "name": "AddSurfaceHub" + }, + { + "code": "ECC5", + "name": "DevUpdate" + }, + { + "code": "ECC6", + "name": "Unit" + }, + { + "code": "ECC8", + "name": "AddTo" + }, + { + "code": "ECC9", + "name": "RemoveFrom" + }, + { + "code": "ECCA", + "name": "RadioBtnOff" + }, + { + "code": "ECCB", + "name": "RadioBtnOn" + }, + { + "code": "ECCC", + "name": "RadioBullet2" + }, + { + "code": "ECCD", + "name": "ExploreContent" + }, + { + "code": "ECE4", + "name": "Blocked2" + }, + { + "code": "ECE7", + "name": "ScrollMode" + }, + { + "code": "ECE8", + "name": "ZoomMode" + }, + { + "code": "ECE9", + "name": "PanMode" + }, + { + "code": "ECF0", + "name": "WiredUSB " + }, + { + "code": "ECF1", + "name": "WirelessUSB" + }, + { + "code": "ECF3", + "name": "USBSafeConnect" + }, + { + "code": "ED0C", + "name": "ActionCenterNotificationMirrored" + }, + { + "code": "ED0D", + "name": "ActionCenterMirrored" + }, + { + "code": "ED0E", + "name": "SubscriptionAdd" + }, + { + "code": "ED10", + "name": "ResetDevice" + }, + { + "code": "ED11", + "name": "SubscriptionAddMirrored" + }, + { + "code": "ED14", + "name": "QRCode" + }, + { + "code": "ED15", + "name": "Feedback" + }, + { + "code": "ED1E", + "name": "Subtitles" + }, + { + "code": "ED1F", + "name": "SubtitlesAudio" + }, + { + "code": "ED25", + "name": "OpenFolderHorizontal" + }, + { + "code": "ED28", + "name": "CalendarMirrored" + }, + { + "code": "ED2A", + "name": "MobeSIM" + }, + { + "code": "ED2B", + "name": "MobeSIMNoProfile" + }, + { + "code": "ED2C", + "name": "MobeSIMLocked" + }, + { + "code": "ED2D", + "name": "MobeSIMBusy" + }, + { + "code": "ED2E", + "name": "SignalError" + }, + { + "code": "ED2F", + "name": "StreamingEnterprise" + }, + { + "code": "ED30", + "name": "Headphone0" + }, + { + "code": "ED31", + "name": "Headphone1" + }, + { + "code": "ED32", + "name": "Headphone2" + }, + { + "code": "ED33", + "name": "Headphone3" + }, + { + "code": "ED35", + "name": "Apps" + }, + { + "code": "ED39", + "name": "KeyboardBrightness" + }, + { + "code": "ED3A", + "name": "KeyboardLowerBrightness" + }, + { + "code": "ED3C", + "name": "SkipBack10" + }, + { + "code": "ED3D", + "name": "SkipForward30 " + }, + { + "code": "ED41", + "name": "TreeFolderFolder" + }, + { + "code": "ED42", + "name": "TreeFolderFolderFill" + }, + { + "code": "ED43", + "name": "TreeFolderFolderOpen" + }, + { + "code": "ED44", + "name": "TreeFolderFolderOpenFill" + }, + { + "code": "ED47", + "name": "MultimediaDMP" + }, + { + "code": "ED4C", + "name": "KeyboardOneHanded" + }, + { + "code": "ED4D", + "name": "Narrator" + }, + { + "code": "ED53", + "name": "EmojiTabPeople" + }, + { + "code": "ED54", + "name": "EmojiTabSmilesAnimals" + }, + { + "code": "ED55", + "name": "EmojiTabCelebrationObjects" + }, + { + "code": "ED56", + "name": "EmojiTabFoodPlants" + }, + { + "code": "ED57", + "name": "EmojiTabTransitPlaces" + }, + { + "code": "ED58", + "name": "EmojiTabSymbols" + }, + { + "code": "ED59", + "name": "EmojiTabTextSmiles" + }, + { + "code": "ED5A", + "name": "EmojiTabFavorites" + }, + { + "code": "ED5B", + "name": "EmojiSwatch" + }, + { + "code": "ED5C", + "name": "ConnectApp" + }, + { + "code": "ED5D", + "name": "CompanionDeviceFramework" + }, + { + "code": "ED5E", + "name": "Ruler" + }, + { + "code": "ED5F", + "name": "FingerInking" + }, + { + "code": "ED60", + "name": "StrokeErase" + }, + { + "code": "ED61", + "name": "PointErase" + }, + { + "code": "ED62", + "name": "ClearAllInk" + }, + { + "code": "ED63", + "name": "Pencil" + }, + { + "code": "ED64", + "name": "Marker" + }, + { + "code": "ED65", + "name": "InkingCaret" + }, + { + "code": "ED66", + "name": "InkingColorOutline" + }, + { + "code": "ED67", + "name": "InkingColorFill" + }, + { + "code": "EDA2", + "name": "HardDrive" + }, + { + "code": "EDA3", + "name": "NetworkAdapter" + }, + { + "code": "EDA4", + "name": "Touchscreen" + }, + { + "code": "EDA5", + "name": "NetworkPrinter" + }, + { + "code": "EDA6", + "name": "CloudPrinter" + }, + { + "code": "EDA7", + "name": "KeyboardShortcut" + }, + { + "code": "EDA8", + "name": "BrushSize" + }, + { + "code": "EDA9", + "name": "NarratorForward" + }, + { + "code": "EDAA", + "name": "NarratorForwardMirrored" + }, + { + "code": "EDAB", + "name": "SyncBadge12" + }, + { + "code": "EDAC", + "name": "RingerBadge12" + }, + { + "code": "EDAD", + "name": "AsteriskBadge12" + }, + { + "code": "EDAE", + "name": "ErrorBadge12" + }, + { + "code": "EDAF", + "name": "CircleRingBadge12" + }, + { + "code": "EDB0", + "name": "CircleFillBadge12" + }, + { + "code": "EDB1", + "name": "ImportantBadge12" + }, + { + "code": "EDB3", + "name": "MailBadge12" + }, + { + "code": "EDB4", + "name": "PauseBadge12" + }, + { + "code": "EDB5", + "name": "PlayBadge12" + }, + { + "code": "EDC6", + "name": "PenWorkspace" + }, + { + "code": "EDD6", + "name": "CaretRight8" + }, + { + "code": "EDD9", + "name": "CaretLeftSolid8" + }, + { + "code": "EDDA", + "name": "CaretRightSolid8" + }, + { + "code": "EDDB", + "name": "CaretUpSolid8" + }, + { + "code": "EDDC", + "name": "CaretDownSolid8" + }, + { + "code": "EDE1", + "name": "Export" + }, + { + "code": "EDE2", + "name": "ExportMirrored" + }, + { + "code": "EDE3", + "name": "ButtonMenu" + }, + { + "code": "EDE4", + "name": "CloudSeach" + }, + { + "code": "EDE5", + "name": "PinyinIMELogo" + }, + { + "code": "EDFB", + "name": "CalligraphyPen" + }, + { + "code": "EE35", + "name": "ReplyMirrored" + }, + { + "code": "EE3F", + "name": "LockscreenDesktop" + }, + { + "code": "EE40", + "name": "TaskViewSettings" + }, + { + "code": "EE4A", + "name": "Play36" + }, + { + "code": "EE56", + "name": "PenPalette" + }, + { + "code": "EE57", + "name": "GuestUser" + }, + { + "code": "EE63", + "name": "SettingsBattery" + }, + { + "code": "EE64", + "name": "TaskbarPhone" + }, + { + "code": "EE65", + "name": "LockScreenGlance" + }, + { + "code": "EE6F", + "name": "GenericScan" + }, + { + "code": "EE71", + "name": "ImageExport " + }, + { + "code": "EE77", + "name": "WifiEthernet" + }, + { + "code": "EE79", + "name": "ActionCenterQuiet" + }, + { + "code": "EE7A", + "name": "ActionCenterQuietNotification" + }, + { + "code": "EE92", + "name": "TrackersMirrored" + }, + { + "code": "EE93", + "name": "DateTimeMirrored" + }, + { + "code": "EE94", + "name": "Wheel" + }, + { + "code": "EEA3", + "name": "VirtualMachineGroup" + }, + { + "code": "EECA", + "name": "ButtonView2" + }, + { + "code": "EF15", + "name": "PenWorkspaceMirrored" + }, + { + "code": "EF16", + "name": "PenPaletteMirrored" + }, + { + "code": "EF17", + "name": "StrokeEraseMirrored" + }, + { + "code": "EF18", + "name": "PointEraseMirrored" + }, + { + "code": "EF19", + "name": "ClearAllInkMirrored" + }, + { + "code": "EF1F", + "name": "BackgroundToggle" + }, + { + "code": "EF20", + "name": "Marquee" + }, + { + "code": "EF2C", + "name": "ChromeCloseContrast" + }, + { + "code": "EF2D", + "name": "ChromeMinimizeContrast" + }, + { + "code": "EF2E", + "name": "ChromeMaximizeContrast" + }, + { + "code": "EF2F", + "name": "ChromeRestoreContrast" + }, + { + "code": "EF31", + "name": "TrafficLight" + }, + { + "code": "EF3B", + "name": "Replay" + }, + { + "code": "EF3C", + "name": "Eyedropper" + }, + { + "code": "EF3D", + "name": "LineDisplay" + }, + { + "code": "EF3E", + "name": "PINPad" + }, + { + "code": "EF3F", + "name": "SignatureCapture" + }, + { + "code": "EF40", + "name": "ChipCardCreditCardReader" + }, + { + "code": "EF58", + "name": "PlayerSettings" + }, + { + "code": "EF6B", + "name": "LandscapeOrientation" + }, + { + "code": "EF90", + "name": "Flow" + }, + { + "code": "EFA5", + "name": "Touchpad" + }, + { + "code": "EFA9", + "name": "Speech" + }, + { + "code": "F000", + "name": "KnowledgeArticle" + }, + { + "code": "F003", + "name": "Relationship" + }, + { + "code": "F080", + "name": "DefaultAPN" + }, + { + "code": "F081", + "name": "UserAPN " + }, + { + "code": "F085", + "name": "DoublePinyin" + }, + { + "code": "F08C", + "name": "BlueLight" + }, + { + "code": "F093", + "name": "ButtonA" + }, + { + "code": "F094", + "name": "ButtonB" + }, + { + "code": "F095", + "name": "ButtonY" + }, + { + "code": "F096", + "name": "ButtonX" + }, + { + "code": "F0AD", + "name": "ArrowUp8" + }, + { + "code": "F0AE", + "name": "ArrowDown8" + }, + { + "code": "F0AF", + "name": "ArrowRight8" + }, + { + "code": "F0B0", + "name": "ArrowLeft8" + }, + { + "code": "F0B2", + "name": "QuarentinedItems" + }, + { + "code": "F0B3", + "name": "QuarentinedItemsMirrored" + }, + { + "code": "F0B4", + "name": "Protractor" + }, + { + "code": "F0B5", + "name": "ChecklistMirrored" + }, + { + "code": "F0B6", + "name": "StatusCircle7" + }, + { + "code": "F0B7", + "name": "StatusCheckmark7" + }, + { + "code": "F0B8", + "name": "StatusErrorCircle7" + }, + { + "code": "F0B9", + "name": "Connected" + }, + { + "code": "F0C6", + "name": "PencilFill" + }, + { + "code": "F0C7", + "name": "CalligraphyFill" + }, + { + "code": "F0CA", + "name": "QuarterStarLeft" + }, + { + "code": "F0CB", + "name": "QuarterStarRight" + }, + { + "code": "F0CC", + "name": "ThreeQuarterStarLeft" + }, + { + "code": "F0CD", + "name": "ThreeQuarterStarRight" + }, + { + "code": "F0CE", + "name": "QuietHoursBadge12" + }, + { + "code": "F0D2", + "name": "BackMirrored" + }, + { + "code": "F0D3", + "name": "ForwardMirrored" + }, + { + "code": "F0D5", + "name": "ChromeBackContrast" + }, + { + "code": "F0D6", + "name": "ChromeBackContrastMirrored" + }, + { + "code": "F0D7", + "name": "ChromeBackToWindowContrast" + }, + { + "code": "F0D8", + "name": "ChromeFullScreenContrast" + }, + { + "code": "F0E2", + "name": "GridView" + }, + { + "code": "F0E3", + "name": "ClipboardList" + }, + { + "code": "F0E4", + "name": "ClipboardListMirrored" + }, + { + "code": "F0E5", + "name": "OutlineQuarterStarLeft" + }, + { + "code": "F0E6", + "name": "OutlineQuarterStarRight" + }, + { + "code": "F0E7", + "name": "OutlineHalfStarLeft" + }, + { + "code": "F0E8", + "name": "OutlineHalfStarRight" + }, + { + "code": "F0E9", + "name": "OutlineThreeQuarterStarLeft" + }, + { + "code": "F0EA", + "name": "OutlineThreeQuarterStarRight" + }, + { + "code": "F0EB", + "name": "SpatialVolume0" + }, + { + "code": "F0EC", + "name": "SpatialVolume1" + }, + { + "code": "F0ED", + "name": "SpatialVolume2" + }, + { + "code": "F0EE", + "name": "SpatialVolume3" + }, + { + "code": "F0F7", + "name": "OutlineStarLeftHalf" + }, + { + "code": "F0F8", + "name": "OutlineStarRightHalf" + }, + { + "code": "F0F9", + "name": "ChromeAnnotateContrast" + }, + { + "code": "F0FB", + "name": "DefenderBadge12" + }, + { + "code": "F103", + "name": "DetachablePC" + }, + { + "code": "F108", + "name": "LeftStick" + }, + { + "code": "F109", + "name": "RightStick" + }, + { + "code": "F10A", + "name": "TriggerLeft" + }, + { + "code": "F10B", + "name": "TriggerRight" + }, + { + "code": "F10C", + "name": "BumperLeft" + }, + { + "code": "F10D", + "name": "BumperRight" + }, + { + "code": "F10E", + "name": "Dpad" + }, + { + "code": "F110", + "name": "EnglishPunctuation" + }, + { + "code": "F111", + "name": "ChinesePunctuation" + }, + { + "code": "F119", + "name": "HMD" + }, + { + "code": "F11B", + "name": "CtrlSpatialRight" + }, + { + "code": "F126", + "name": "PaginationDotOutline10" + }, + { + "code": "F127", + "name": "PaginationDotSolid10" + }, + { + "code": "F128", + "name": "StrokeErase2" + }, + { + "code": "F129", + "name": "SmallErase" + }, + { + "code": "F12A", + "name": "LargeErase" + }, + { + "code": "F12B", + "name": "FolderHorizontal" + }, + { + "code": "F12E", + "name": "MicrophoneListening" + }, + { + "code": "F12F", + "name": "StatusExclamationCircle7 " + }, + { + "code": "F131", + "name": "Video360" + }, + { + "code": "F133", + "name": "GiftboxOpen" + }, + { + "code": "F136", + "name": "StatusCircleOuter" + }, + { + "code": "F137", + "name": "StatusCircleInner" + }, + { + "code": "F138", + "name": "StatusCircleRing" + }, + { + "code": "F139", + "name": "StatusTriangleOuter" + }, + { + "code": "F13A", + "name": "StatusTriangleInner" + }, + { + "code": "F13B", + "name": "StatusTriangleExclamation" + }, + { + "code": "F13C", + "name": "StatusCircleExclamation" + }, + { + "code": "F13D", + "name": "StatusCircleErrorX" + }, + { + "code": "F13E", + "name": "StatusCircleCheckmark" + }, + { + "code": "F13F", + "name": "StatusCircleInfo" + }, + { + "code": "F140", + "name": "StatusCircleBlock" + }, + { + "code": "F141", + "name": "StatusCircleBlock2" + }, + { + "code": "F142", + "name": "StatusCircleQuestionMark" + }, + { + "code": "F143", + "name": "StatusCircleSync" + }, + { + "code": "F146", + "name": "Dial1" + }, + { + "code": "F147", + "name": "Dial2" + }, + { + "code": "F148", + "name": "Dial3" + }, + { + "code": "F149", + "name": "Dial4" + }, + { + "code": "F14A", + "name": "Dial5" + }, + { + "code": "F14B", + "name": "Dial6" + }, + { + "code": "F14C", + "name": "Dial7" + }, + { + "code": "F14D", + "name": "Dial8" + }, + { + "code": "F14E", + "name": "Dial9" + }, + { + "code": "F14F", + "name": "Dial10" + }, + { + "code": "F150", + "name": "Dial11" + }, + { + "code": "F151", + "name": "Dial12" + }, + { + "code": "F152", + "name": "Dial13" + }, + { + "code": "F153", + "name": "Dial14" + }, + { + "code": "F154", + "name": "Dial15" + }, + { + "code": "F155", + "name": "Dial16" + }, + { + "code": "F156", + "name": "DialShape1" + }, + { + "code": "F157", + "name": "DialShape2" + }, + { + "code": "F158", + "name": "DialShape3" + }, + { + "code": "F159", + "name": "DialShape4" + }, + { + "code": "F161", + "name": "TollSolid" + }, + { + "code": "F163", + "name": "TrafficCongestionSolid" + }, + { + "code": "F164", + "name": "ExploreContentSingle" + }, + { + "code": "F165", + "name": "CollapseContent" + }, + { + "code": "F166", + "name": "CollapseContentSingle" + }, + { + "code": "F167", + "name": "InfoSolid" + }, + { + "code": "F168", + "name": "GroupList" + }, + { + "code": "F169", + "name": "CaretBottomRightSolidCenter8" + }, + { + "code": "F16A", + "name": "ProgressRingDots" + }, + { + "code": "F16B", + "name": "Checkbox14" + }, + { + "code": "F16C", + "name": "CheckboxComposite14" + }, + { + "code": "F16D", + "name": "CheckboxIndeterminateCombo14" + }, + { + "code": "F16E", + "name": "CheckboxIndeterminateCombo" + }, + { + "code": "F175", + "name": "StatusPause7" + }, + { + "code": "F17F", + "name": "CharacterAppearance" + }, + { + "code": "F180", + "name": "Lexicon " + }, + { + "code": "F182", + "name": "ScreenTime" + }, + { + "code": "F191", + "name": "HeadlessDevice" + }, + { + "code": "F193", + "name": "NetworkSharing" + }, + { + "code": "F19D", + "name": "EyeGaze" + }, + { + "code": "F1AD", + "name": "WindowsInsider" + }, + { + "code": "F1CB", + "name": "ChromeSwitch" + }, + { + "code": "F1CC", + "name": "ChromeSwitchContast" + }, + { + "code": "F1D8", + "name": "StatusCheckmark" + }, + { + "code": "F1D9", + "name": "StatusCheckmarkLeft" + }, + { + "code": "F20C", + "name": "KeyboardLeftAligned" + }, + { + "code": "F20D", + "name": "KeyboardRightAligned" + }, + { + "code": "F210", + "name": "KeyboardSettings" + }, + { + "code": "F211", + "name": "NetworkPhysical" + }, + { + "code": "F22C", + "name": "IOT" + }, + { + "code": "F22E", + "name": "UnknownMirrored" + }, + { + "code": "F246", + "name": "ViewDashboard" + }, + { + "code": "F259", + "name": "ExploitProtectionSettings" + }, + { + "code": "F260", + "name": "KeyboardNarrow" + }, + { + "code": "F261", + "name": "Keyboard12Key" + }, + { + "code": "F26B", + "name": "KeyboardDock" + }, + { + "code": "F26C", + "name": "KeyboardUndock" + }, + { + "code": "F26D", + "name": "KeyboardLeftDock" + }, + { + "code": "F26E", + "name": "KeyboardRightDock" + }, + { + "code": "F270", + "name": "Ear" + }, + { + "code": "F271", + "name": "PointerHand" + }, + { + "code": "F272", + "name": "Bullseye" + }, + { + "code": "F2B7", + "name": "LocaleLanguage" + }, + { + "code": "F32A", + "name": "PassiveAuthentication" + }, + { + "code": "F384", + "name": "NetworkOffline" + }, + { + "code": "F385", + "name": "NetworkConnected" + }, + { + "code": "F386", + "name": "NetworkConnectedCheckmark" + }, + { + "code": "F3B1", + "name": "SignOut" + }, + { + "code": "F3CC", + "name": "StatusInfo" + }, + { + "code": "F3CD", + "name": "StatusInfoLeft" + }, + { + "code": "F3E2", + "name": "NearbySharing" + }, + { + "code": "F3E7", + "name": "CtrlSpatialLeft" + }, + { + "code": "F404", + "name": "InteractiveDashboard" + }, + { + "code": "F406", + "name": "ClippingTool" + }, + { + "code": "F407", + "name": "RectangularClipping " + }, + { + "code": "F408", + "name": "FreeFormClipping" + }, + { + "code": "F413", + "name": "CopyTo" + }, + { + "code": "F439", + "name": "DynamicLock" + }, + { + "code": "F45E", + "name": "PenTips" + }, + { + "code": "F45F", + "name": "PenTipsMirrored" + }, + { + "code": "F460", + "name": "HWPJoin" + }, + { + "code": "F461", + "name": "HWPInsert" + }, + { + "code": "F462", + "name": "HWPStrikeThrough" + }, + { + "code": "F463", + "name": "HWPScratchOut" + }, + { + "code": "F464", + "name": "HWPSplit" + }, + { + "code": "F465", + "name": "HWPNewLine" + }, + { + "code": "F466", + "name": "HWPOverwrite" + }, + { + "code": "F473", + "name": "MobWifiWarning1" + }, + { + "code": "F474", + "name": "MobWifiWarning2" + }, + { + "code": "F475", + "name": "MobWifiWarning3" + }, + { + "code": "F476", + "name": "MobWifiWarning4" + }, + { + "code": "F49A", + "name": "Globe2" + }, + { + "code": "F4A9", + "name": "GIF" + }, + { + "code": "F4AA", + "name": "Sticker2" + }, + { + "code": "F4BE", + "name": "SurfaceHubSelected" + }, + { + "code": "F4BF", + "name": "HoloLensSelected" + }, + { + "code": "F4C0", + "name": "Earbud" + }, + { + "code": "F4C3", + "name": "MixVolumes" + }, + { + "code": "F540", + "name": "Safe" + }, + { + "code": "F552", + "name": "LaptopSecure" + }, + { + "code": "F56D", + "name": "PrintDefault" + }, + { + "code": "F56E", + "name": "PageMirrored" + }, + { + "code": "F56F", + "name": "LandscapeOrientationMirrored" + }, + { + "code": "F570", + "name": "ColorOff" + }, + { + "code": "F571", + "name": "PrintAllPages" + }, + { + "code": "F572", + "name": "PrintCustomRange" + }, + { + "code": "F573", + "name": "PageMarginPortraitNarrow" + }, + { + "code": "F574", + "name": "PageMarginPortraitNormal" + }, + { + "code": "F575", + "name": "PageMarginPortraitModerate" + }, + { + "code": "F576", + "name": "PageMarginPortraitWide" + }, + { + "code": "F577", + "name": "PageMarginLandscapeNarrow" + }, + { + "code": "F578", + "name": "PageMarginLandscapeNormal" + }, + { + "code": "F579", + "name": "PageMarginLandscapeModerate" + }, + { + "code": "F57A", + "name": "PageMarginLandscapeWide" + }, + { + "code": "F57B", + "name": "CollateLandscape" + }, + { + "code": "F57C", + "name": "CollatePortrait" + }, + { + "code": "F57D", + "name": "CollatePortraitSeparated" + }, + { + "code": "F57E", + "name": "DuplexLandscapeOneSided" + }, + { + "code": "F57F", + "name": "DuplexLandscapeOneSidedMirrored" + }, + { + "code": "F580", + "name": "DuplexLandscapeTwoSidedLongEdge" + }, + { + "code": "F581", + "name": "DuplexLandscapeTwoSidedLongEdgeMirrored" + }, + { + "code": "F582", + "name": "DuplexLandscapeTwoSidedShortEdge" + }, + { + "code": "F583", + "name": "DuplexLandscapeTwoSidedShortEdgeMirrored" + }, + { + "code": "F584", + "name": "DuplexPortraitOneSided" + }, + { + "code": "F585", + "name": "DuplexPortraitOneSidedMirrored" + }, + { + "code": "F586", + "name": "DuplexPortraitTwoSidedLongEdge" + }, + { + "code": "F587", + "name": "DuplexPortraitTwoSidedLongEdgeMirrored" + }, + { + "code": "F588", + "name": "DuplexPortraitTwoSidedShortEdge" + }, + { + "code": "F589", + "name": "DuplexPortraitTwoSidedShortEdgeMirrored" + }, + { + "code": "F58A", + "name": "PPSOneLandscape" + }, + { + "code": "F58B", + "name": "PPSTwoLandscape" + }, + { + "code": "F58C", + "name": "PPSTwoPortrait" + }, + { + "code": "F58D", + "name": "PPSFourLandscape" + }, + { + "code": "F58E", + "name": "PPSFourPortrait" + }, + { + "code": "F58F", + "name": "HolePunchOff" + }, + { + "code": "F590", + "name": "HolePunchPortraitLeft" + }, + { + "code": "F591", + "name": "HolePunchPortraitRight" + }, + { + "code": "F592", + "name": "HolePunchPortraitTop" + }, + { + "code": "F593", + "name": "HolePunchPortraitBottom" + }, + { + "code": "F594", + "name": "HolePunchLandscapeLeft" + }, + { + "code": "F595", + "name": "HolePunchLandscapeRight" + }, + { + "code": "F596", + "name": "HolePunchLandscapeTop" + }, + { + "code": "F597", + "name": "HolePunchLandscapeBottom" + }, + { + "code": "F598", + "name": "StaplingOff" + }, + { + "code": "F599", + "name": "StaplingPortraitTopLeft" + }, + { + "code": "F59A", + "name": "StaplingPortraitTopRight" + }, + { + "code": "F59B", + "name": "StaplingPortraitBottomRight" + }, + { + "code": "F59C", + "name": "StaplingPortraitTwoLeft" + }, + { + "code": "F59D", + "name": "StaplingPortraitTwoRight" + }, + { + "code": "F59E", + "name": "StaplingPortraitTwoTop" + }, + { + "code": "F59F", + "name": "StaplingPortraitTwoBottom" + }, + { + "code": "F5A0", + "name": "StaplingPortraitBookBinding" + }, + { + "code": "F5A1", + "name": "StaplingLandscapeTopLeft" + }, + { + "code": "F5A2", + "name": "StaplingLandscapeTopRight" + }, + { + "code": "F5A3", + "name": "StaplingLandscapeBottomLeft" + }, + { + "code": "F5A4", + "name": "StaplingLandscapeBottomRight" + }, + { + "code": "F5A5", + "name": "StaplingLandscapeTwoLeft" + }, + { + "code": "F5A6", + "name": "StaplingLandscapeTwoRight" + }, + { + "code": "F5A7", + "name": "StaplingLandscapeTwoTop" + }, + { + "code": "F5A8", + "name": "StaplingLandscapeTwoBottom" + }, + { + "code": "F5A9", + "name": "StaplingLandscapeBookBinding" + }, + { + "code": "F5AA", + "name": "StatusDataTransferRoaming" + }, + { + "code": "F5AB", + "name": "MobSIMError" + }, + { + "code": "F5AC", + "name": "CollateLandscapeSeparated" + }, + { + "code": "F5AD", + "name": "PPSOnePortrait" + }, + { + "code": "F5AE", + "name": "StaplingPortraitBottomLeft" + }, + { + "code": "F5B0", + "name": "PlaySolid" + }, + { + "code": "F5E7", + "name": "RepeatOff" + }, + { + "code": "F5ED", + "name": "Set" + }, + { + "code": "F5EE", + "name": "SetSolid" + }, + { + "code": "F5EF", + "name": "FuzzyReading" + }, + { + "code": "F5F2", + "name": "VerticalBattery0" + }, + { + "code": "F5F3", + "name": "VerticalBattery1" + }, + { + "code": "F5F4", + "name": "VerticalBattery2" + }, + { + "code": "F5F5", + "name": "VerticalBattery3" + }, + { + "code": "F5F6", + "name": "VerticalBattery4" + }, + { + "code": "F5F7", + "name": "VerticalBattery5" + }, + { + "code": "F5F8", + "name": "VerticalBattery6" + }, + { + "code": "F5F9", + "name": "VerticalBattery7" + }, + { + "code": "F5FA", + "name": "VerticalBattery8" + }, + { + "code": "F5FB", + "name": "VerticalBattery9" + }, + { + "code": "F5FC", + "name": "VerticalBattery10" + }, + { + "code": "F5FD", + "name": "VerticalBatteryCharging0" + }, + { + "code": "F5FE", + "name": "VerticalBatteryCharging1" + }, + { + "code": "F5FF", + "name": "VerticalBatteryCharging2" + }, + { + "code": "F600", + "name": "VerticalBatteryCharging3" + }, + { + "code": "F601", + "name": "VerticalBatteryCharging4" + }, + { + "code": "F602", + "name": "VerticalBatteryCharging5" + }, + { + "code": "F603", + "name": "VerticalBatteryCharging6" + }, + { + "code": "F604", + "name": "VerticalBatteryCharging7" + }, + { + "code": "F605", + "name": "VerticalBatteryCharging8" + }, + { + "code": "F606", + "name": "VerticalBatteryCharging9" + }, + { + "code": "F607", + "name": "VerticalBatteryCharging10" + }, + { + "code": "F608", + "name": "VerticalBatteryUnknown" + }, + { + "code": "F614", + "name": "DoublePortrait" + }, + { + "code": "F615", + "name": "DoubleLandscape" + }, + { + "code": "F616", + "name": "SinglePortrait" + }, + { + "code": "F617", + "name": "SingleLandscape" + }, + { + "code": "F618", + "name": "SIMError" + }, + { + "code": "F619", + "name": "SIMMissing" + }, + { + "code": "F61A", + "name": "SIMLock" + }, + { + "code": "F61B", + "name": "eSIM" + }, + { + "code": "F61C", + "name": "eSIMNoProfile" + }, + { + "code": "F61D", + "name": "eSIMLocked" + }, + { + "code": "F61E", + "name": "eSIMBusy" + }, + { + "code": "F61F", + "name": "NoiseCancelation" + }, + { + "code": "F620", + "name": "NoiseCancelationOff" + }, + { + "code": "F623", + "name": "MusicSharing" + }, + { + "code": "F624", + "name": "MusicSharingOff" + }, + { + "code": "F63C", + "name": "CircleShapeSolid" + }, + { + "code": "F657", + "name": "WifiCallBars" + }, + { + "code": "F658", + "name": "WifiCall0" + }, + { + "code": "F659", + "name": "WifiCall1" + }, + { + "code": "F65A", + "name": "WifiCall2" + }, + { + "code": "F65B", + "name": "WifiCall3" + }, + { + "code": "F65C", + "name": "WifiCall4" + }, + { + "code": "F69E", + "name": "CHTLanguageBar" + }, + { + "code": "F6BA", + "name": "EmojiTabMoreSymbols" + }, + { + "code": "F6FA", + "name": "WebSearch" + }, + { + "code": "F712", + "name": "Kiosk" + }, + { + "code": "F714", + "name": "RTTLogo" + }, + { + "code": "F715", + "name": "VoiceCall" + }, + { + "code": "F716", + "name": "GoToMessage" + }, + { + "code": "F71A", + "name": "ReturnToCall" + }, + { + "code": "F71C", + "name": "StartPresenting" + }, + { + "code": "F71D", + "name": "StopPresenting" + }, + { + "code": "F71E", + "name": "ProductivityMode" + }, + { + "code": "F738", + "name": "SetHistoryStatus" + }, + { + "code": "F739", + "name": "SetHistoryStatus2" + }, + { + "code": "F73D", + "name": "Keyboardsettings20" + }, + { + "code": "F73E", + "name": "OneHandedRight20" + }, + { + "code": "F73F", + "name": "OneHandedLeft20" + }, + { + "code": "F740", + "name": "Split20" + }, + { + "code": "F741", + "name": "Full20" + }, + { + "code": "F742", + "name": "Handwriting20" + }, + { + "code": "F743", + "name": "CheveronLeft20" + }, + { + "code": "F744", + "name": "CheveronLeft32" + }, + { + "code": "F745", + "name": "CheveronRight20" + }, + { + "code": "F746", + "name": "CheveronRight32" + }, + { + "code": "F781", + "name": "MicOff2" + }, + { + "code": "F785", + "name": "DeliveryOptimization" + }, + { + "code": "F78A", + "name": "CancelMedium" + }, + { + "code": "F78B", + "name": "SearchMedium" + }, + { + "code": "F78C", + "name": "AcceptMedium" + }, + { + "code": "F78D", + "name": "RevealPasswordMedium" + }, + { + "code": "F7AD", + "name": "DeleteWord" + }, + { + "code": "F7AE", + "name": "DeleteWordFill" + }, + { + "code": "F7AF", + "name": "DeleteLines" + }, + { + "code": "F7B0", + "name": "DeleteLinesFill" + }, + { + "code": "F7B1", + "name": "InstertWords" + }, + { + "code": "F7B2", + "name": "InstertWordsFill" + }, + { + "code": "F7B3", + "name": "JoinWords" + }, + { + "code": "F7B4", + "name": "JoinWordsFill" + }, + { + "code": "F7B5", + "name": "OverwriteWords" + }, + { + "code": "F7B6", + "name": "OverwriteWordsFill" + }, + { + "code": "F7B7", + "name": "AddNewLine" + }, + { + "code": "F7B8", + "name": "AddNewLineFill" + }, + { + "code": "F7B9", + "name": "OverwriteWordsKorean" + }, + { + "code": "F7BA", + "name": "OverwriteWordsFillKorean" + }, + { + "code": "F7BB", + "name": "EducationIcon" + }, + { + "code": "F7ED", + "name": "WindowSnipping" + }, + { + "code": "F7EE", + "name": "VideoCapture" + }, + { + "code": "F809", + "name": "StatusSecured" + }, + { + "code": "F83B", + "name": "NarratorApp" + }, + { + "code": "F83D", + "name": "PowerButtonUpdate" + }, + { + "code": "F83E", + "name": "RestartUpdate" + }, + { + "code": "F83F", + "name": "UpdateStatusDot" + }, + { + "code": "F847", + "name": "Eject" + } + ] +} diff --git a/src/ResourceModel/Assets/SystemBrushes.json b/src/ResourceModel/Assets/SystemBrushes.json new file mode 100644 index 0000000..e846a6a --- /dev/null +++ b/src/ResourceModel/Assets/SystemBrushes.json @@ -0,0 +1,414 @@ +{ + "brushes": [ + { + "x:Key": "SystemControlBackgroundAccentBrush", + "Color": "{ThemeResource SystemAccentColor}" + }, + { + "x:Key": "SystemControlBackgroundAltHighBrush", + "Color": "{StaticResource SystemAltHighColor}" + }, + { + "x:Key": "SystemControlBackgroundAltMediumHighBrush", + "Color": "{StaticResource SystemAltMediumHighColor}" + }, + { + "x:Key": "SystemControlBackgroundAltMediumBrush", + "Color": "{StaticResource SystemAltMediumColor}" + }, + { + "x:Key": "SystemControlBackgroundAltMediumLowBrush", + "Color": "{StaticResource SystemAltMediumLowColor}" + }, + { + "x:Key": "SystemControlBackgroundBaseHighBrush", + "Color": "{StaticResource SystemBaseHighColor}" + }, + { + "x:Key": "SystemControlBackgroundBaseLowBrush", + "Color": "{StaticResource SystemBaseLowColor}" + }, + { + "x:Key": "SystemControlBackgroundBaseMediumBrush", + "Color": "{StaticResource SystemBaseMediumColor}" + }, + { + "x:Key": "SystemControlBackgroundBaseMediumHighBrush", + "Color": "{StaticResource SystemBaseMediumHighColor}" + }, + { + "x:Key": "SystemControlBackgroundBaseMediumLowBrush", + "Color": "{StaticResource SystemBaseMediumLowColor}" + }, + { + "x:Key": "SystemControlBackgroundChromeBlackHighBrush", + "Color": "{StaticResource SystemChromeBlackHighColor}" + }, + { + "x:Key": "SystemControlBackgroundChromeBlackMediumBrush", + "Color": "{StaticResource SystemChromeBlackMediumColor}" + }, + { + "x:Key": "SystemControlBackgroundChromeBlackLowBrush", + "Color": "{StaticResource SystemChromeBlackLowColor}" + }, + { + "x:Key": "SystemControlBackgroundChromeBlackMediumLowBrush", + "Color": "{StaticResource SystemChromeBlackMediumLowColor}" + }, + { + "x:Key": "SystemControlBackgroundChromeMediumBrush", + "Color": "{StaticResource SystemChromeMediumColor}" + }, + { + "x:Key": "SystemControlBackgroundChromeMediumLowBrush", + "Color": "{StaticResource SystemChromeMediumLowColor}" + }, + { + "x:Key": "SystemControlBackgroundChromeWhiteBrush", + "Color": "{StaticResource SystemChromeWhiteColor}" + }, + { + "x:Key": "SystemControlBackgroundListLowBrush", + "Color": "{StaticResource SystemListLowColor}" + }, + { + "x:Key": "SystemControlBackgroundListMediumBrush", + "Color": "{StaticResource SystemListMediumColor}" + }, + { + "x:Key": "SystemControlDisabledAccentBrush", + "Color": "{ThemeResource SystemAccentColor}" + }, + { + "x:Key": "SystemControlDisabledBaseHighBrush", + "Color": "{StaticResource SystemBaseHighColor}" + }, + { + "x:Key": "SystemControlDisabledBaseLowBrush", + "Color": "{StaticResource SystemBaseLowColor}" + }, + { + "x:Key": "SystemControlDisabledBaseMediumLowBrush", + "Color": "{StaticResource SystemBaseMediumLowColor}" + }, + { + "x:Key": "SystemControlDisabledChromeDisabledHighBrush", + "Color": "{StaticResource SystemChromeDisabledHighColor}" + }, + { + "x:Key": "SystemControlDisabledChromeDisabledLowBrush", + "Color": "{StaticResource SystemChromeDisabledLowColor}" + }, + { + "x:Key": "SystemControlDisabledChromeHighBrush", + "Color": "{StaticResource SystemChromeHighColor}" + }, + { + "x:Key": "SystemControlDisabledChromeMediumLowBrush", + "Color": "{StaticResource SystemChromeMediumLowColor}" + }, + { + "x:Key": "SystemControlDisabledListMediumBrush", + "Color": "{StaticResource SystemListMediumColor}" + }, + { + "x:Key": "SystemControlDisabledTransparentBrush", + "Color": "Transparent" + }, + { + "x:Key": "SystemControlFocusVisualPrimaryBrush", + "Color": "{ThemeResource SystemBaseHighColor}" + }, + { + "x:Key": "SystemControlFocusVisualSecondaryBrush", + "Color": "{ThemeResource SystemAltMediumColor}" + }, + { + "x:Key": "SystemControlRevealFocusVisualBrush", + "Color": "{ThemeResource SystemAccentColor}" + }, + { + "x:Key": "SystemControlForegroundAccentBrush", + "Color": "{ThemeResource SystemAccentColor}" + }, + { + "x:Key": "SystemControlForegroundAltHighBrush", + "Color": "{StaticResource SystemAltHighColor}" + }, + { + "x:Key": "SystemControlForegroundAltMediumHighBrush", + "Color": "{StaticResource SystemAltMediumHighColor}" + }, + { + "x:Key": "SystemControlForegroundBaseHighBrush", + "Color": "{StaticResource SystemBaseHighColor}" + }, + { + "x:Key": "SystemControlForegroundBaseLowBrush", + "Color": "{StaticResource SystemBaseLowColor}" + }, + { + "x:Key": "SystemControlForegroundBaseMediumBrush", + "Color": "{StaticResource SystemBaseMediumColor}" + }, + { + "x:Key": "SystemControlForegroundBaseMediumHighBrush", + "Color": "{StaticResource SystemBaseMediumHighColor}" + }, + { + "x:Key": "SystemControlForegroundBaseMediumLowBrush", + "Color": "{StaticResource SystemBaseMediumLowColor}" + }, + { + "x:Key": "SystemControlForegroundChromeBlackHighBrush", + "Color": "{StaticResource SystemChromeBlackHighColor}" + }, + { + "x:Key": "SystemControlForegroundChromeHighBrush", + "Color": "{StaticResource SystemChromeHighColor}" + }, + { + "x:Key": "SystemControlForegroundChromeMediumBrush", + "Color": "{StaticResource SystemChromeMediumColor}" + }, + { + "x:Key": "SystemControlForegroundChromeWhiteBrush", + "Color": "{StaticResource SystemChromeWhiteColor}" + }, + { + "x:Key": "SystemControlForegroundChromeDisabledLowBrush", + "Color": "{StaticResource SystemChromeDisabledLowColor}" + }, + { + "x:Key": "SystemControlForegroundChromeGrayBrush", + "Color": "{StaticResource SystemChromeGrayColor}" + }, + { + "x:Key": "SystemControlForegroundListLowBrush", + "Color": "{StaticResource SystemListLowColor}" + }, + { + "x:Key": "SystemControlForegroundListMediumBrush", + "Color": "{StaticResource SystemListMediumColor}" + }, + { + "x:Key": "SystemControlForegroundTransparentBrush", + "Color": "Transparent" + }, + { + "x:Key": "SystemControlForegroundChromeBlackMediumBrush", + "Color": "{StaticResource SystemChromeBlackMediumColor}" + }, + { + "x:Key": "SystemControlForegroundChromeBlackMediumLowBrush", + "Color": "{StaticResource SystemChromeBlackMediumLowColor}" + }, + { + "x:Key": "SystemControlHighlightAccentBrush", + "Color": "{ThemeResource SystemAccentColor}" + }, + { + "x:Key": "SystemControlHighlightAltAccentBrush", + "Color": "{ThemeResource SystemAccentColor}" + }, + { + "x:Key": "SystemControlHighlightAltAltHighBrush", + "Color": "{StaticResource SystemAltHighColor}" + }, + { + "x:Key": "SystemControlHighlightAltBaseHighBrush", + "Color": "{StaticResource SystemBaseHighColor}" + }, + { + "x:Key": "SystemControlHighlightAltBaseLowBrush", + "Color": "{StaticResource SystemBaseLowColor}" + }, + { + "x:Key": "SystemControlHighlightAltBaseMediumBrush", + "Color": "{StaticResource SystemBaseMediumColor}" + }, + { + "x:Key": "SystemControlHighlightAltBaseMediumHighBrush", + "Color": "{StaticResource SystemBaseMediumHighColor}" + }, + { + "x:Key": "SystemControlHighlightAltAltMediumHighBrush", + "Color": "{StaticResource SystemAltMediumHighColor}" + }, + { + "x:Key": "SystemControlHighlightAltBaseMediumLowBrush", + "Color": "{StaticResource SystemBaseMediumLowColor}" + }, + { + "x:Key": "SystemControlHighlightAltListAccentHighBrush", + "Color": "{ThemeResource SystemAccentColor}", + "Opacity": "0.9" + }, + { + "x:Key": "SystemControlHighlightAltListAccentLowBrush", + "Color": "{ThemeResource SystemAccentColor}", + "Opacity": "0.6" + }, + { + "x:Key": "SystemControlHighlightAltListAccentMediumBrush", + "Color": "{ThemeResource SystemAccentColor}", + "Opacity": "0.8" + }, + { + "x:Key": "SystemControlHighlightAltChromeWhiteBrush", + "Color": "{StaticResource SystemChromeWhiteColor}" + }, + { + "x:Key": "SystemControlHighlightAltTransparentBrush", + "Color": "Transparent" + }, + { + "x:Key": "SystemControlHighlightBaseHighBrush", + "Color": "{StaticResource SystemBaseHighColor}" + }, + { + "x:Key": "SystemControlHighlightBaseLowBrush", + "Color": "{StaticResource SystemBaseLowColor}" + }, + { + "x:Key": "SystemControlHighlightBaseMediumBrush", + "Color": "{StaticResource SystemBaseMediumColor}" + }, + { + "x:Key": "SystemControlHighlightBaseMediumHighBrush", + "Color": "{StaticResource SystemBaseMediumHighColor}" + }, + { + "x:Key": "SystemControlHighlightBaseMediumLowBrush", + "Color": "{StaticResource SystemBaseMediumLowColor}" + }, + { + "x:Key": "SystemControlHighlightChromeAltLowBrush", + "Color": "{StaticResource SystemChromeAltLowColor}" + }, + { + "x:Key": "SystemControlHighlightChromeHighBrush", + "Color": "{StaticResource SystemChromeHighColor}" + }, + { + "x:Key": "SystemControlHighlightListAccentHighBrush", + "Color": "{ThemeResource SystemAccentColor}", + "Opacity": "0.9" + }, + { + "x:Key": "SystemControlHighlightListAccentLowBrush", + "Color": "{ThemeResource SystemAccentColor}", + "Opacity": "0.6" + }, + { + "x:Key": "SystemControlHighlightListAccentMediumBrush", + "Color": "{ThemeResource SystemAccentColor}", + "Opacity": "0.8" + }, + { + "x:Key": "SystemControlHighlightListMediumBrush", + "Color": "{StaticResource SystemListMediumColor}" + }, + { + "x:Key": "SystemControlHighlightListLowBrush", + "Color": "{StaticResource SystemListLowColor}" + }, + { + "x:Key": "SystemControlHighlightChromeWhiteBrush", + "Color": "{StaticResource SystemChromeWhiteColor}" + }, + { + "x:Key": "SystemControlHighlightTransparentBrush", + "Color": "Transparent" + }, + { + "x:Key": "SystemControlHyperlinkTextBrush", + "Color": "{ThemeResource SystemAccentColor}" + }, + { + "x:Key": "SystemControlHyperlinkBaseHighBrush", + "Color": "{StaticResource SystemBaseHighColor}" + }, + { + "x:Key": "SystemControlHyperlinkBaseMediumBrush", + "Color": "{StaticResource SystemBaseMediumColor}" + }, + { + "x:Key": "SystemControlHyperlinkBaseMediumHighBrush", + "Color": "{StaticResource SystemBaseMediumHighColor}" + }, + { + "x:Key": "SystemControlPageBackgroundAltMediumBrush", + "Color": "{StaticResource SystemAltMediumColor}" + }, + { + "x:Key": "SystemControlPageBackgroundAltHighBrush", + "Color": "{StaticResource SystemAltHighColor}" + }, + { + "x:Key": "SystemControlPageBackgroundMediumAltMediumBrush", + "Color": "{StaticResource SystemAltMediumColor}" + }, + { + "x:Key": "SystemControlPageBackgroundBaseLowBrush", + "Color": "{StaticResource SystemBaseLowColor}" + }, + { + "x:Key": "SystemControlPageBackgroundBaseMediumBrush", + "Color": "{StaticResource SystemBaseMediumColor}" + }, + { + "x:Key": "SystemControlPageBackgroundListLowBrush", + "Color": "{StaticResource SystemListLowColor}" + }, + { + "x:Key": "SystemControlPageBackgroundChromeLowBrush", + "Color": "{StaticResource SystemChromeLowColor}" + }, + { + "x:Key": "SystemControlPageBackgroundChromeMediumLowBrush", + "Color": "{StaticResource SystemChromeMediumLowColor}" + }, + { + "x:Key": "SystemControlPageBackgroundTransparentBrush", + "Color": "Transparent" + }, + { + "x:Key": "SystemControlPageTextBaseHighBrush", + "Color": "{StaticResource SystemBaseHighColor}" + }, + { + "x:Key": "SystemControlPageTextBaseMediumBrush", + "Color": "{StaticResource SystemBaseMediumColor}" + }, + { + "x:Key": "SystemControlPageTextChromeBlackMediumLowBrush", + "Color": "{StaticResource SystemChromeBlackMediumLowColor}" + }, + { + "x:Key": "SystemControlTransparentBrush", + "Color": "Transparent" + }, + { + "x:Key": "SystemControlErrorTextForegroundBrush", + "Color": "{StaticResource SystemErrorTextColor}" + }, + { + "x:Key": "SystemControlTransientBorderBrush", + "Color": "#000000", + "Opacity": "0.36" + }, + { + "x:Key": "SystemControlTransientBackgroundBrush", + "BackgroundSource": "HostBackdrop", + "TintColor": "{StaticResource SystemChromeAltHighColor}", + "TintOpacity": "0.8", + "FallbackColor": "{StaticResource SystemChromeMediumLowColor}" + }, + { + "StaticResource x:Key": "SystemControlDescriptionTextForegroundBrush", + "ResourceKey": "SystemControlPageTextBaseMediumBrush" + } + ] +} \ No newline at end of file diff --git a/src/ResourceModel/Assets/SystemColors.json b/src/ResourceModel/Assets/SystemColors.json new file mode 100644 index 0000000..5d18f90 --- /dev/null +++ b/src/ResourceModel/Assets/SystemColors.json @@ -0,0 +1,166 @@ +{ + "colors": [ + { + "key": "SystemAccentColor", + "name": "Accent", + "lightHex": "N/A", + "darkHex": "N/A" + }, + { + "key": "SystemAltHighColor", + "name": "AltHigh", + "lightHex": "#FFFFFFFF", + "darkHex": "#FF000000" + }, + { + "key": "SystemAltLowColor", + "name": "AltLow", + "lightHex": "#33FFFFFF", + "darkHex": "#33000000" + }, + { + "key": "SystemAltMediumColor", + "name": "AltMedium", + "lightHex": "#99FFFFFF", + "darkHex": "#99000000" + }, + { + "key": "SystemAltMediumHighColor", + "name": "AltMediumHigh", + "lightHex": "#CCFFFFFF", + "darkHex": "#CC000000" + }, + { + "key": "SystemAltMediumLowColor", + "name": "AltMediumLow", + "lightHex": "#66FFFFFF", + "darkHex": "#66000000" + }, + { + "key": "SystemBaseHighColor", + "name": "BaseHigh", + "lightHex": "#FF000000", + "darkHex": "#FFFFFFFF" + }, + { + "key": "SystemBaseLowColor", + "name": "BaseLow", + "lightHex": "#33000000", + "darkHex": "#33FFFFFF" + }, + { + "key": "SystemBaseMediumColor", + "name": "BaseMedium", + "lightHex": "#99000000", + "darkHex": "#99FFFFFF" + }, + { + "key": "SystemBaseMediumHighColor", + "name": "BaseMediumHigh", + "lightHex": "#CC000000", + "darkHex": "#CCFFFFFF" + }, + { + "key": "SystemBaseMediumLowColor", + "name": "BaseMediumLow", + "lightHex": "#66000000", + "darkHex": "#66FFFFFF" + }, + { + "key": "SystemChromeAltLowColor", + "name": "ChromeAltLow", + "lightHex": "#FF171717", + "darkHex": "#FFF2F2F2" + }, + { + "key": "SystemChromeBlackHighColor", + "name": "ChromeBlackHigh", + "lightHex": "#FF000000", + "darkHex": "#FF000000" + }, + { + "key": "SystemChromeBlackLowColor", + "name": "ChromeBlackLow", + "lightHex": "#33000000", + "darkHex": "#33000000" + }, + { + "key": "SystemChromeBlackMediumLowColor", + "name": "ChromeBlackMediumLow", + "lightHex": "#66000000", + "darkHex": "#66000000" + }, + { + "key": "SystemChromeBlackMediumColor", + "name": "ChromeBlackMedium", + "lightHex": "#CC000000", + "darkHex": "#CC000000" + }, + { + "key": "SystemChromeDisabledHighColor", + "name": "ChromeDisabledHigh", + "lightHex": "#FFCCCCCC", + "darkHex": "#FF333333" + }, + { + "key": "SystemChromeDisabledLowColor", + "name": "ChromeDisabledLow", + "lightHex": "#FF7A7A7A", + "darkHex": "#FF858585" + }, + { + "key": "SystemChromeGrayColor", + "name": "ChromeGray", + "lightHex": "#FF767676", + "darkHex": "#FF767676" + }, + { + "key": "SystemChromeHighColor", + "name": "ChromeHigh", + "lightHex": "#FFCCCCCC", + "darkHex": "#FF767676" + }, + { + "key": "SystemChromeLowColor", + "name": "ChromeLow", + "lightHex": "#FFF2F2F2", + "darkHex": "#FF171717" + }, + { + "key": "SystemChromeMediumColor", + "name": "ChromeMedium", + "lightHex": "#FFE6E6E6", + "darkHex": "#FF1F1F1F" + }, + { + "key": "SystemChromeMediumLowColor", + "name": "ChromeMediumLow", + "lightHex": "#FFF2F2F2", + "darkHex": "#FF2B2B2B" + }, + { + "key": "SystemChromeWhiteColor", + "name": "ChromeWhite", + "lightHex": "#FFFFFFFF", + "darkHex": "#FFFFFFFF" + }, + { + "key": "SystemErrorTextColor", + "name": "ErrorText", + "lightHex": "#FFC50500", + "darkHex": "#FFFFF000" + }, + { + "key": "SystemListLowColor", + "name": "ListLow", + "lightHex": "#19000000", + "darkHex": "#19FFFFFF" + }, + { + "key": "SystemListMediumColor", + "name": "ListMedium", + "lightHex": "#33000000", + "darkHex": "#33FFFFFF" + } + ] +} \ No newline at end of file diff --git a/src/ResourceModel/Brush/SystemColor.cs b/src/ResourceModel/Brush/SystemColor.cs new file mode 100644 index 0000000..9770f4c --- /dev/null +++ b/src/ResourceModel/Brush/SystemColor.cs @@ -0,0 +1,56 @@ +using System.Linq; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Markup; +using Windows.UI.Xaml.Media; + +namespace UWPResourcesGallery.Model.Brush +{ + public class SystemColor : IFilterable + { + public string Key { get; private set; } + + public string Name { get; private set; } + + public string LightHex { get; private set; } + public string DarkHex { get; private set; } + + public SolidColorBrush LightThemeBrush { get; private set; } + public SolidColorBrush DarkThemeBrush { get; private set; } + + public string ThemeResourceString => "{ThemeResource " + Key + "}"; + + public SystemColor(string key, string name, string lightHEX, string darkHEX) + { + Key = key; + Name = name; + LightHex = lightHEX; + DarkHex = darkHEX; + + // Generating SolidColorBrush from XAML code! + // Light theme brush + var grid = XamlReader.Load(@"<Border xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' + RequestedTheme='Light' + Background='{ThemeResource " + Key + "}'></Border>") as Border; + LightThemeBrush = grid.Background as SolidColorBrush; + + // Dark theme brush + grid = XamlReader.Load(@"<Border xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' + RequestedTheme='Dark' + Background='{ThemeResource " + Key + "}'></Border>") as Border; + DarkThemeBrush = grid.Background as SolidColorBrush; + } + + public bool FitsFilter(string[] filter) + { + return filter.All(entry => + Key.Contains(entry, System.StringComparison.CurrentCultureIgnoreCase) + || Name.Contains(entry, System.StringComparison.CurrentCultureIgnoreCase) + || LightHex.Contains(entry, System.StringComparison.CurrentCultureIgnoreCase) + || DarkHex.Contains(entry, System.StringComparison.CurrentCultureIgnoreCase) + || ThemeResourceString.Contains(entry,System.StringComparison.CurrentCultureIgnoreCase) + ); + } + + } +} diff --git a/src/ResourceModel/Brush/SystemColorsItemSource.cs b/src/ResourceModel/Brush/SystemColorsItemSource.cs new file mode 100644 index 0000000..c6071de --- /dev/null +++ b/src/ResourceModel/Brush/SystemColorsItemSource.cs @@ -0,0 +1,25 @@ +using System.Threading.Tasks; +using Windows.Data.Json; + +namespace UWPResourcesGallery.Model.Brush +{ + public class SystemColorsItemSource : GenericItemsSource<SystemColor> + { + public static void LoadSystemColors() + { + var file = GetJSONFile("/ResourceModel/Assets/SystemColors.json"); + var list = file["colors"].GetArray(); + foreach (JsonValue entry in list) + { + JsonObject entryObject = entry.GetObject(); + var brush = new SystemColor( + entryObject["key"].GetString(), + entryObject["name"].GetString(), + entryObject["lightHex"].GetString(), + entryObject["darkHex"].GetString() + ); + Items.Add(brush); + } + } + } +} diff --git a/src/ResourceModel/GenericItemsSource.cs b/src/ResourceModel/GenericItemsSource.cs new file mode 100644 index 0000000..9eac880 --- /dev/null +++ b/src/ResourceModel/GenericItemsSource.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Threading.Tasks; +using Windows.Data.Json; +using Windows.Storage; + +namespace UWPResourcesGallery.Model +{ + /// <summary> + /// Creates a generic data source, capable of: + /// - storing item list + /// - filtering items and storing result in <see cref="FilteredItems"/> + /// - Loading JSON object from file (<see cref="GetJSONFile(string)"/> + /// </summary> + /// <typeparam name="T"></typeparam> + public abstract class GenericItemsSource<T> where T : IFilterable + { + /// <summary> + /// List containing all items + /// </summary> + public static IList<T> Items { get; } = new List<T>(); + + /// <summary> + /// List containg a filtered list. Gets updated when calling <see cref="Filter(string)"/> + /// </summary> + public ObservableCollection<T> FilteredItems { get; } = new ObservableCollection<T>(); + + protected GenericItemsSource() + { + foreach (T item in Items) + { + FilteredItems.Add(item); + } + } + + /// <summary> + /// Loads the json file from the apps assets + /// </summary> + /// <param name="fileName">The name of the file (e.g. Items.json) </param> + /// <returns>The JSON object stored in the document</returns> + protected static JsonObject GetJSONFile(string fileName) + { + Uri iconListJson = new Uri("ms-appx://" + fileName); + var task = StorageFile.GetFileFromApplicationUriAsync(iconListJson).AsTask(); + StorageFile iconFile = task.Result; + var fileTask = FileIO.ReadTextAsync(iconFile).AsTask(); + string jsonText = fileTask.Result; + + return JsonObject.Parse(jsonText); + } + + /// <summary> + /// Filters the items and updates the <see cref="FilteredItems"/> to only contain the items that are applicable for the filter + /// </summary> + /// <param name="search">The search filter</param> + public void Filter(string search) + { + string[] filter = search?.Split(" "); + + FilteredItems.Clear(); + + foreach (T item in Items) + { + if (item.FitsFilter(filter)) + { + FilteredItems.Add(item); + } + } + } + } +} diff --git a/src/ResourceModel/IFilterable.cs b/src/ResourceModel/IFilterable.cs new file mode 100644 index 0000000..c4b6c8c --- /dev/null +++ b/src/ResourceModel/IFilterable.cs @@ -0,0 +1,15 @@ +namespace UWPResourcesGallery.Model +{ + /// <summary> + /// Interface used for filtering items + /// </summary> + public interface IFilterable + { + /// <summary> + /// Method called to check if an object fits a filter or not + /// </summary> + /// <param name="keywords">The string of keywords that the object must fulfill</param> + /// <returns>True if the object meets the filter</returns> + bool FitsFilter(string[] keywords); + } +} diff --git a/src/ResourceModel/Icon/IconItem.cs b/src/ResourceModel/Icon/IconItem.cs new file mode 100644 index 0000000..87855e0 --- /dev/null +++ b/src/ResourceModel/Icon/IconItem.cs @@ -0,0 +1,33 @@ +using System; +using System.Linq; +using Windows.UI.Xaml.Controls; + +namespace UWPResourcesGallery.Model.Icon +{ + public class IconItem : IFilterable + { + public string Code { get; private set; } + public string Name { get; private set; } + + public string Character { get; private set; } + + public string StringGlyph { get { return "&#x" + Code + ";"; } } + + public bool IsSymbol { get; } + + public IconItem(string code, string description) + { + Code = code; + Name = description; + Character = char.ConvertFromUtf32(Convert.ToInt32(Code, 16)); + IsSymbol = Enum.IsDefined(typeof(Symbol), description); + + } + + public bool FitsFilter(string[] filter) + { + return filter.All(entry => Code.Contains(entry, System.StringComparison.CurrentCultureIgnoreCase) + || Name.Contains(entry, System.StringComparison.CurrentCultureIgnoreCase)); + } + } +} diff --git a/src/ResourceModel/Icon/IconItemSource.cs b/src/ResourceModel/Icon/IconItemSource.cs new file mode 100644 index 0000000..dd3883f --- /dev/null +++ b/src/ResourceModel/Icon/IconItemSource.cs @@ -0,0 +1,28 @@ +using System.Threading.Tasks; +using Windows.Data.Json; + +namespace UWPResourcesGallery.Model.Icon +{ + public class IconItemSource : GenericItemsSource<IconItem> + { + + public static void LoadIconsList() + { + var file = GetJSONFile("/ResourceModel/Assets/IconList.json"); + var list = file["icons"].GetArray(); + lock (Items) + { + foreach (JsonValue entry in list) + { + JsonObject entryObject = entry.GetObject(); + IconItem icon = new IconItem( + entryObject["code"].GetString(), + entryObject["name"].GetString() + ); + Items.Add(icon); + } + } + } + + } +} diff --git a/src/ResourceModel/Properties/AssemblyInfo.cs b/src/ResourceModel/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..bedd43a --- /dev/null +++ b/src/ResourceModel/Properties/AssemblyInfo.cs @@ -0,0 +1,28 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ResourceModel")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ResourceModel")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: ComVisible(false)] \ No newline at end of file diff --git a/src/ResourceModel/Properties/ResourceModel.rd.xml b/src/ResourceModel/Properties/ResourceModel.rd.xml new file mode 100644 index 0000000..ffc05b3 --- /dev/null +++ b/src/ResourceModel/Properties/ResourceModel.rd.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + This file contains Runtime Directives, specifications about types your application accesses + through reflection and other dynamic code patterns. Runtime Directives are used to control the + .NET Native optimizer and ensure that it does not remove code accessed by your library. If your + library does not do any reflection, then you generally do not need to edit this file. However, + if your library reflects over types, especially types passed to it or derived from its types, + then you should write Runtime Directives. + + The most common use of reflection in libraries is to discover information about types passed + to the library. Runtime Directives have three ways to express requirements on types passed to + your library. + + 1. Parameter, GenericParameter, TypeParameter, TypeEnumerableParameter + Use these directives to reflect over types passed as a parameter. + + 2. SubTypes + Use a SubTypes directive to reflect over types derived from another type. + + 3. AttributeImplies + Use an AttributeImplies directive to indicate that your library needs to reflect over + types or methods decorated with an attribute. + + For more information on writing Runtime Directives for libraries, please visit + https://go.microsoft.com/fwlink/?LinkID=391919 +--> +<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata"> + <Library Name="ResourceModel"> + + <!-- add directives for your library here --> + + </Library> +</Directives> diff --git a/src/ResourceModel/ResourceModel.csproj b/src/ResourceModel/ResourceModel.csproj new file mode 100644 index 0000000..a67bc0c --- /dev/null +++ b/src/ResourceModel/ResourceModel.csproj @@ -0,0 +1,147 @@ +<?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)' == '' ">AnyCPU</Platform> + <ProjectGuid>{957B1E0E-D863-41E3-8042-7FAC37A512DD}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>UWPResourcesGallery.Model</RootNamespace> + <AssemblyName>ResourceModel</AssemblyName> + <DefaultLanguage>en-US</DefaultLanguage> + <TargetPlatformIdentifier>UAP</TargetPlatformIdentifier> + <TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.18362.0</TargetPlatformVersion> + <TargetPlatformMinVersion>10.0.17134.0</TargetPlatformMinVersion> + <MinimumVisualStudioVersion>14</MinimumVisualStudioVersion> + <FileAlignment>512</FileAlignment> + <ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <PlatformTarget>AnyCPU</PlatformTarget> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> + <PlatformTarget>x86</PlatformTarget> + <DebugSymbols>true</DebugSymbols> + <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> + <NoWarn>;2008</NoWarn> + <DebugType>full</DebugType> + <UseVSHostingProcess>false</UseVSHostingProcess> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> + <PlatformTarget>x86</PlatformTarget> + <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> + <Optimize>true</Optimize> + <NoWarn>;2008</NoWarn> + <DebugType>pdbonly</DebugType> + <UseVSHostingProcess>false</UseVSHostingProcess> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'"> + <PlatformTarget>ARM</PlatformTarget> + <DebugSymbols>true</DebugSymbols> + <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> + <NoWarn>;2008</NoWarn> + <DebugType>full</DebugType> + <UseVSHostingProcess>false</UseVSHostingProcess> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'"> + <PlatformTarget>ARM</PlatformTarget> + <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> + <Optimize>true</Optimize> + <NoWarn>;2008</NoWarn> + <DebugType>pdbonly</DebugType> + <UseVSHostingProcess>false</UseVSHostingProcess> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM64'"> + <PlatformTarget>ARM64</PlatformTarget> + <DebugSymbols>true</DebugSymbols> + <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> + <NoWarn>;2008</NoWarn> + <DebugType>full</DebugType> + <UseVSHostingProcess>false</UseVSHostingProcess> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM64'"> + <PlatformTarget>ARM64</PlatformTarget> + <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> + <Optimize>true</Optimize> + <NoWarn>;2008</NoWarn> + <DebugType>pdbonly</DebugType> + <UseVSHostingProcess>false</UseVSHostingProcess> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'"> + <PlatformTarget>x64</PlatformTarget> + <DebugSymbols>true</DebugSymbols> + <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> + <NoWarn>;2008</NoWarn> + <DebugType>full</DebugType> + <UseVSHostingProcess>false</UseVSHostingProcess> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'"> + <PlatformTarget>x64</PlatformTarget> + <DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants> + <Optimize>true</Optimize> + <NoWarn>;2008</NoWarn> + <DebugType>pdbonly</DebugType> + <UseVSHostingProcess>false</UseVSHostingProcess> + <ErrorReport>prompt</ErrorReport> + </PropertyGroup> + <PropertyGroup> + <RestoreProjectStyle>PackageReference</RestoreProjectStyle> + </PropertyGroup> + <ItemGroup> + <Compile Include="Brush\SystemColor.cs" /> + <Compile Include="Brush\SystemColorsItemSource.cs" /> + <Compile Include="GenericItemsSource.cs" /> + <Compile Include="Icon\IconItem.cs" /> + <Compile Include="Icon\IconItemSource.cs" /> + <Compile Include="IFilterable.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <EmbeddedResource Include="Properties\ResourceModel.rd.xml" /> + </ItemGroup> + <ItemGroup> + <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform"> + <Version>6.2.9</Version> + </PackageReference> + </ItemGroup> + <ItemGroup> + <Content Include="Assets\IconList.json" /> + </ItemGroup> + <ItemGroup> + <Content Include="Assets\SystemColors.json" /> + </ItemGroup> + <ItemGroup> + <Content Include="Assets\SystemBrushes.json" /> + </ItemGroup> + <PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0' "> + <VisualStudioVersion>14.0</VisualStudioVersion> + </PropertyGroup> + <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.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> \ No newline at end of file diff --git a/src/UWPResourcesGallery/App.xaml b/src/UWPResourcesGallery/App.xaml new file mode 100644 index 0000000..1cf5756 --- /dev/null +++ b/src/UWPResourcesGallery/App.xaml @@ -0,0 +1,54 @@ +<Application + x:Class="UWPResourcesGallery.App" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:contract7Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract, 7)" + xmlns:contract7NotPresent="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractNotPresent(Windows.Foundation.UniversalApiContract,7)" + xmlns:local="using:UWPResourcesGallery" + xmlns:common="using:UWPResourcesGallery.Common" + xmlns:muxm="using:Microsoft.UI.Xaml.Media" + xmlns:muxc="using:Microsoft.UI.Xaml.Controls" + xmlns:primitives="using:Microsoft.UI.Xaml.Controls.Primitives"> + <Application.Resources> + + <ResourceDictionary> + <!-- WinUI components --> + <ResourceDictionary.MergedDictionaries> + <XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls"/> + </ResourceDictionary.MergedDictionaries> + + <common:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"/> + <common:StringValueToVisibilityConverter x:Key="StringValueToVisibilityConverter"/> + + <!-- "Copy text" - Button style--> + <Style x:Key="CopyButtonStyle" TargetType="Button"> + <Setter Property="Margin" Value="15,5,0,5"/> + <Setter Property="Padding" Value="3" /> + <Setter Property="Height" Value="30" /> + <Setter Property="Grid.Column" Value="4" /> + <Setter Property="ContentTemplate" > + <Setter.Value> + <DataTemplate> + <SymbolIcon Symbol="Copy"/> + </DataTemplate> + </Setter.Value> + </Setter> + <Setter Property="ToolTipService.ToolTip"> + <Setter.Value> + <ToolTip contract7Present:PlacementRect="0,0,40,0"> + Copy text to clipboard + </ToolTip> + </Setter.Value> + </Setter> + <Setter Property="ToolTipService.Placement" Value="Right" /> + </Style> + + <!-- Section header style --> + <Style x:Key="SectionHeader" TargetType="TextBlock"> + <Setter Property="FontSize" Value="20"/> + <Setter Property="HorizontalAlignment" Value="Left"/> + <Setter Property="Margin" Value="0,0,0,10" /> + </Style> + </ResourceDictionary> + </Application.Resources> +</Application> diff --git a/src/UWPResourcesGallery/App.xaml.cs b/src/UWPResourcesGallery/App.xaml.cs new file mode 100644 index 0000000..31ed0d6 --- /dev/null +++ b/src/UWPResourcesGallery/App.xaml.cs @@ -0,0 +1,141 @@ +using System; +using System.Threading.Tasks; +using UWPResourcesGallery.Common; +using UWPResourcesGallery.Model.Brush; +using UWPResourcesGallery.Model.Icon; +using Windows.ApplicationModel; +using Windows.ApplicationModel.Activation; +using Windows.ApplicationModel.Core; +using Windows.UI.Input; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Input; +using Windows.UI.Xaml.Navigation; + +namespace UWPResourcesGallery +{ + /// <summary> + /// Provides application-specific behavior to supplement the default Application class. + /// </summary> + sealed partial class App : Application + { + /// <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(); + Suspending += OnSuspending; + } + + /// <summary> + /// Invoked when the application is launched normally by the end user. Other entry points + /// will be used such as when the application is launched to open a specific file. + /// </summary> + /// <param name="e">Details about the launch request and process.</param> + protected override void OnLaunched(LaunchActivatedEventArgs e) + { + if(e == null) + { + return; + } + // Do not repeat app initialization when the Window already has content, + // just ensure that the window is active + if (!(Window.Current.Content is Frame rootFrame)) + { + // Create a Frame to act as the navigation context and navigate to the first page + rootFrame = new Frame(); + + rootFrame.NavigationFailed += OnNavigationFailed; + + // Place the frame in the current Window + Window.Current.Content = rootFrame; + } + + if (e!= null && e.PrelaunchActivated == false) + { + 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 + rootFrame.Navigate(typeof(AppNavigation), e.Arguments); + } + // Ensure the current window is active + Window.Current.Activate(); + } + EnsureWindow(); + + ThemeHelper.Initialize(); + + CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true; + Windows.UI.Core.SystemNavigationManager.GetForCurrentView().BackRequested += App_BackRequested; + rootFrame.PointerPressed += On_PointerPressed; + } + + /// <summary> + /// Invoked when AppNavigation to a certain page fails + /// </summary> + /// <param name="sender">The Frame which failed navigation</param> + /// <param name="e">Details about the navigation failure</param> + void OnNavigationFailed(object sender, NavigationFailedEventArgs e) + { + throw new Exception("Failed to load Page " + e.SourcePageType.FullName); + } + + /// <summary> + /// Invoked when application execution is being suspended. Application state is saved + /// without knowing whether the application will be terminated or resumed with the contents + /// of memory still intact. + /// </summary> + /// <param name="sender">The source of the suspend request.</param> + /// <param name="e">Details about the suspend request.</param> + private void OnSuspending(object sender, SuspendingEventArgs e) + { + var deferral = e.SuspendingOperation.GetDeferral(); + deferral.Complete(); + } + + /// <summary> + /// All code related to loading data when app starts + /// </summary> + /// <param name="e"></param> + /// <returns></returns> + private void EnsureWindow() + { + // Load all lists since we will need them anyway + // This must block as the app can not resume without this data being loaded + IconItemSource.LoadIconsList(); + SystemColorsItemSource.LoadSystemColors(); + } + + + private void App_BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e) + { + e.Handled = On_BackRequested(); + } + + private void On_PointerPressed(object sender, PointerRoutedEventArgs e) + { + bool isXButton1Pressed = + e.GetCurrentPoint(sender as UIElement).Properties.PointerUpdateKind == PointerUpdateKind.XButton1Pressed; + + if (isXButton1Pressed) + { + e.Handled = On_BackRequested(); + } + } + + private static bool On_BackRequested() + { + Frame rootFrame = Window.Current.Content as Frame; + if (rootFrame.CanGoBack) + { + rootFrame.GoBack(); + return true; + } + return false; + } + } +} diff --git a/src/UWPResourcesGallery/AppNavigation.xaml b/src/UWPResourcesGallery/AppNavigation.xaml new file mode 100644 index 0000000..bbe6503 --- /dev/null +++ b/src/UWPResourcesGallery/AppNavigation.xaml @@ -0,0 +1,100 @@ +<Page + x:Class="UWPResourcesGallery.AppNavigation" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:muxc="using:Microsoft.UI.Xaml.Controls" + xmlns:Windows10version1809="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract, 7)" + mc:Ignorable="d" + Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> + + <Page.Resources> + </Page.Resources> + + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition /> + </Grid.ColumnDefinitions> + + <!-- App title bar --> + <Grid x:Name="AppTitleBar" VerticalAlignment="Top" + Background="Transparent" Canvas.ZIndex="1" + Height="32" Grid.Column="1" IsHitTestVisible="True" + Margin="40,3,0,0"> + + <Grid.RowDefinitions> + <RowDefinition Height="Auto"/> + </Grid.RowDefinitions> + + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="*"/> + </Grid.ColumnDefinitions> + + <Windows10version1809:Grid.TranslationTransition> + <Windows10version1809:Vector3Transition /> + </Windows10version1809:Grid.TranslationTransition> + + + <!-- App title --> + <TextBlock x:Name="AppTitle" + Text="UWP Resources Gallery" + VerticalAlignment="Center" + Style="{StaticResource CaptionTextBlockStyle}"/> + + <!-- Compact overlay button --> + <Button x:Name="SwitchCompactOverlayModeButton" Click="SwitchCompactOverlayModeButton_Click" + IsHitTestVisible="True" Canvas.ZIndex="20" Grid.Column="1" + Background="Transparent" Style="{ThemeResource ButtonRevealStyle}" + AutomationProperties.Name="Switch to overlay mode" + Margin="8,2,0,0" Height="30" ToolTipService.ToolTip="Switch to overlay mode"> + <Grid> + <FontIcon Glyph="" FontSize="16"/> + <!-- Names to enabling/disabling the correct icon based on state --> + <FontIcon x:Name="CompactOverlayArrowsMinimizeIcon" Glyph="" FontSize="14"/> + <FontIcon x:Name="CompactOverlayArrowsMaximizeIcon" Glyph="" FontSize="14" Visibility="Collapsed"/> + </Grid> + </Button> + + <!-- Grid to enable dragging of window using the AppTitleBar --> + <Grid x:Name="WindowDraggingArea" Height="30" Background="Transparent" Canvas.ZIndex="2" + IsHitTestVisible="True" Grid.ColumnSpan="3"/> + </Grid> + <muxc:NavigationView x:Name="RootNavigation" + AutomationProperties.Name="Mainnavigation" + Grid.Column="1" + ItemInvoked="RootNavigation_ItemInvoked" + PaneOpening="RootNavigation_PaneOpening" + PaneClosing="RootNavigation_PaneClosing" + DisplayModeChanged="RootNavigation_DisplayModeChanged" + IsTitleBarAutoPaddingEnabled="False"> + <muxc:NavigationView.MenuItems> + <muxc:NavigationViewItem x:Name="_StartPage" Content="Start" IsSelected="True"> + <muxc:NavigationViewItem.Icon> + <FontIcon Glyph=""/> + </muxc:NavigationViewItem.Icon> + </muxc:NavigationViewItem> + <muxc:NavigationViewItem Content="Icons" x:Name="_IconsListPage"> + <muxc:NavigationViewItem.Icon> + <FontIcon Glyph="" /> + </muxc:NavigationViewItem.Icon> + </muxc:NavigationViewItem> + <muxc:NavigationViewItem Content="Systemcolors" x:Name="_SystemColorsPage"> + <muxc:NavigationViewItem.Icon> + <FontIcon Glyph="" /> + </muxc:NavigationViewItem.Icon> + </muxc:NavigationViewItem> + </muxc:NavigationView.MenuItems> + <Frame x:Name="RootFrame" Padding="0,40,0,0"> + <Frame.ContentTransitions> + <TransitionCollection> + <NavigationThemeTransition /> + </TransitionCollection> + </Frame.ContentTransitions> + </Frame> + </muxc:NavigationView> + </Grid> +</Page> diff --git a/src/UWPResourcesGallery/AppNavigation.xaml.cs b/src/UWPResourcesGallery/AppNavigation.xaml.cs new file mode 100644 index 0000000..c2b2491 --- /dev/null +++ b/src/UWPResourcesGallery/AppNavigation.xaml.cs @@ -0,0 +1,187 @@ +using System; +using UWPResourcesGallery.Pages; +using Windows.ApplicationModel.Core; +using Windows.Foundation.Metadata; +using Windows.UI; +using Windows.UI.ViewManagement; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Automation; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Navigation; +using MUXC = Microsoft.UI.Xaml.Controls; + +namespace UWPResourcesGallery +{ + /// <summary> + /// This is the root page of the application + /// </summary> + public sealed partial class AppNavigation : Page + { + + private static AppNavigation Instance; + + public AppNavigation() + { + InitializeComponent(); + Instance = this; + + Window.Current.SetTitleBar(WindowDraggingArea); + + RootFrame.Navigate(typeof(StartPage)); + + Loaded += delegate (object sender, RoutedEventArgs e) + { + ApplicationViewTitleBar titleBar = ApplicationView.GetForCurrentView().TitleBar; + + titleBar.ButtonBackgroundColor = Colors.Transparent; + titleBar.ButtonInactiveBackgroundColor = Colors.Transparent; + + RootFrame.Navigated += RootFrame_Navigated; + RootNavigation.BackRequested += RootNavigation_BackRequested; + }; + } + + public static void NavigateToPageType(Type pageType) + { + Instance.RootFrame.Navigate(pageType); + } + + public static void NavigateToIconsListPage() + { + Instance._IconsListPage.IsSelected = true; + Instance.RootFrame.Navigate(typeof(IconsListPage)); + } + + private void RootNavigation_BackRequested(MUXC.NavigationView sender, MUXC.NavigationViewBackRequestedEventArgs args) + { + if (RootFrame.CanGoBack) + { + RootFrame.GoBack(); + } + RootNavigation.IsBackEnabled = RootFrame.CanGoBack; + } + + private void RootFrame_Navigated(object sender, NavigationEventArgs e) + { + RootNavigation.IsBackEnabled = RootFrame.CanGoBack; + if (RootFrame.CurrentSourcePageType == typeof(SettingsPage)) + { + RootNavigation.SelectedItem = RootNavigation.SettingsItem; + } + if (RootFrame.CurrentSourcePageType == typeof(StartPage)) + { + RootNavigation.SelectedItem = _StartPage; + } + if (RootFrame.CurrentSourcePageType == typeof(IconsListPage)) + { + RootNavigation.SelectedItem = _IconsListPage; + } + if (RootFrame.CurrentSourcePageType == typeof(SystemColorsPage)) + { + RootNavigation.SelectedItem = _SystemColorsPage; + } + } + + private void RootNavigation_ItemInvoked(MUXC.NavigationView sender, MUXC.NavigationViewItemInvokedEventArgs args) + { + if (args.IsSettingsInvoked) + { + RootFrame.Navigate(typeof(SettingsPage)); + return; + } + var selectedItem = sender.SelectedItem; + if (selectedItem == _StartPage) + { + RootFrame.Navigate(typeof(StartPage)); + } + if (selectedItem == _IconsListPage) + { + RootFrame.Navigate(typeof(IconsListPage)); + } + if (selectedItem == _SystemColorsPage) + { + RootFrame.Navigate(typeof(SystemColorsPage)); + } + } + + // App title code + private void UpdateAppTitleBarPosition(float offSet) + { + // We need to check if translations are available to update + if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 7)) + { + // They are available, use smooth transitions + AppTitleBar.Translation = new System.Numerics.Vector3(offSet, 0, 0); + } + else + { + // They are not, use margin + AppTitleBar.Margin = new Thickness(45 + offSet, 5, 0, 0); + } + } + + private void RootNavigation_PaneClosing(MUXC.NavigationView sender, MUXC.NavigationViewPaneClosingEventArgs args) + { + if (sender.DisplayMode != MUXC.NavigationViewDisplayMode.Minimal) + { + UpdateAppTitleBarPosition(15); + } + } + + private void RootNavigation_PaneOpening(MUXC.NavigationView sender, object args) + { + if (sender.DisplayMode != MUXC.NavigationViewDisplayMode.Minimal) + { + UpdateAppTitleBarPosition(0); + } + } + + private void RootNavigation_DisplayModeChanged(MUXC.NavigationView sender, MUXC.NavigationViewDisplayModeChangedEventArgs args) + { + switch (sender.DisplayMode) + { + case MUXC.NavigationViewDisplayMode.Minimal: + UpdateAppTitleBarPosition((float)sender.CompactPaneLength + 5); + break; + case MUXC.NavigationViewDisplayMode.Compact: + UpdateAppTitleBarPosition(20); + break; + case MUXC.NavigationViewDisplayMode.Expanded: + if (sender.IsPaneOpen) + { + UpdateAppTitleBarPosition(0); + } + else + { + UpdateAppTitleBarPosition(20); + } + break; + } + } + + private async void SwitchCompactOverlayModeButton_Click(object sender, RoutedEventArgs e) + { + if(ApplicationView.GetForCurrentView().ViewMode == ApplicationViewMode.Default) + { + bool modeSwitched = await ApplicationView.GetForCurrentView().TryEnterViewModeAsync(ApplicationViewMode.CompactOverlay); + if(modeSwitched){ + SwitchCompactOverlayModeButton.SetValue(AutomationProperties.NameProperty, "Switch to normal mode"); + ToolTipService.SetToolTip(SwitchCompactOverlayModeButton, "Switch to normal mode"); + CompactOverlayArrowsMinimizeIcon.Visibility = Visibility.Collapsed; + CompactOverlayArrowsMaximizeIcon.Visibility = Visibility.Visible; + } + } + else + { + bool modeSwitched = await ApplicationView.GetForCurrentView().TryEnterViewModeAsync(ApplicationViewMode.Default); + if (modeSwitched) + { + SwitchCompactOverlayModeButton.SetValue(AutomationProperties.NameProperty, "Switch to overlay mode"); + ToolTipService.SetToolTip(SwitchCompactOverlayModeButton, "Switch to overlay mode"); + CompactOverlayArrowsMinimizeIcon.Visibility = Visibility.Visible; + CompactOverlayArrowsMaximizeIcon.Visibility = Visibility.Collapsed; + } + } + } + } +} diff --git a/src/UWPResourcesGallery/Assets/Tiles/LargeTile.scale-100.png b/src/UWPResourcesGallery/Assets/Tiles/LargeTile.scale-100.png new file mode 100644 index 0000000..61b13dd Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/LargeTile.scale-100.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/LargeTile.scale-125.png b/src/UWPResourcesGallery/Assets/Tiles/LargeTile.scale-125.png new file mode 100644 index 0000000..3bf3379 Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/LargeTile.scale-125.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/LargeTile.scale-150.png b/src/UWPResourcesGallery/Assets/Tiles/LargeTile.scale-150.png new file mode 100644 index 0000000..654f4d3 Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/LargeTile.scale-150.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/LargeTile.scale-200.png b/src/UWPResourcesGallery/Assets/Tiles/LargeTile.scale-200.png new file mode 100644 index 0000000..0fe464d Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/LargeTile.scale-200.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/LargeTile.scale-400.png b/src/UWPResourcesGallery/Assets/Tiles/LargeTile.scale-400.png new file mode 100644 index 0000000..a19c79d Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/LargeTile.scale-400.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/Logo.png b/src/UWPResourcesGallery/Assets/Tiles/Logo.png new file mode 100644 index 0000000..b70857b Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/Logo.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/SmallTile.scale-100.png b/src/UWPResourcesGallery/Assets/Tiles/SmallTile.scale-100.png new file mode 100644 index 0000000..03d2817 Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/SmallTile.scale-100.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/SmallTile.scale-125.png b/src/UWPResourcesGallery/Assets/Tiles/SmallTile.scale-125.png new file mode 100644 index 0000000..5834fdd Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/SmallTile.scale-125.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/SmallTile.scale-150.png b/src/UWPResourcesGallery/Assets/Tiles/SmallTile.scale-150.png new file mode 100644 index 0000000..92c4c5e Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/SmallTile.scale-150.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/SmallTile.scale-200.png b/src/UWPResourcesGallery/Assets/Tiles/SmallTile.scale-200.png new file mode 100644 index 0000000..49ef2d1 Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/SmallTile.scale-200.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/SmallTile.scale-400.png b/src/UWPResourcesGallery/Assets/Tiles/SmallTile.scale-400.png new file mode 100644 index 0000000..6bf9d21 Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/SmallTile.scale-400.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/SplashScreen.scale-100.png b/src/UWPResourcesGallery/Assets/Tiles/SplashScreen.scale-100.png new file mode 100644 index 0000000..009853b Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/SplashScreen.scale-100.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/SplashScreen.scale-125.png b/src/UWPResourcesGallery/Assets/Tiles/SplashScreen.scale-125.png new file mode 100644 index 0000000..9ed1d52 Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/SplashScreen.scale-125.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/SplashScreen.scale-150.png b/src/UWPResourcesGallery/Assets/Tiles/SplashScreen.scale-150.png new file mode 100644 index 0000000..4885df4 Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/SplashScreen.scale-150.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/SplashScreen.scale-200.png b/src/UWPResourcesGallery/Assets/Tiles/SplashScreen.scale-200.png new file mode 100644 index 0000000..4eb478b Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/SplashScreen.scale-200.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/SplashScreen.scale-400.png b/src/UWPResourcesGallery/Assets/Tiles/SplashScreen.scale-400.png new file mode 100644 index 0000000..023b59a Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/SplashScreen.scale-400.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/Square150x150Logo.scale-100.png b/src/UWPResourcesGallery/Assets/Tiles/Square150x150Logo.scale-100.png new file mode 100644 index 0000000..f6e5be6 Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/Square150x150Logo.scale-100.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/Square150x150Logo.scale-125.png b/src/UWPResourcesGallery/Assets/Tiles/Square150x150Logo.scale-125.png new file mode 100644 index 0000000..d716df1 Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/Square150x150Logo.scale-125.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/Square150x150Logo.scale-150.png b/src/UWPResourcesGallery/Assets/Tiles/Square150x150Logo.scale-150.png new file mode 100644 index 0000000..f739d77 Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/Square150x150Logo.scale-150.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/Square150x150Logo.scale-200.png b/src/UWPResourcesGallery/Assets/Tiles/Square150x150Logo.scale-200.png new file mode 100644 index 0000000..06be700 Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/Square150x150Logo.scale-200.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/Square150x150Logo.scale-400.png b/src/UWPResourcesGallery/Assets/Tiles/Square150x150Logo.scale-400.png new file mode 100644 index 0000000..227c5ff Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/Square150x150Logo.scale-400.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.altform-lightunplated_targetsize-16.png b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.altform-lightunplated_targetsize-16.png new file mode 100644 index 0000000..61c56f7 Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.altform-lightunplated_targetsize-16.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.altform-lightunplated_targetsize-24.png b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.altform-lightunplated_targetsize-24.png new file mode 100644 index 0000000..2977bbf Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.altform-lightunplated_targetsize-24.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.altform-lightunplated_targetsize-256.png b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.altform-lightunplated_targetsize-256.png new file mode 100644 index 0000000..bf4ae83 Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.altform-lightunplated_targetsize-256.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.altform-lightunplated_targetsize-32.png b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.altform-lightunplated_targetsize-32.png new file mode 100644 index 0000000..4a0c4e0 Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.altform-lightunplated_targetsize-32.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.altform-lightunplated_targetsize-48.png b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.altform-lightunplated_targetsize-48.png new file mode 100644 index 0000000..93cd02a Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.altform-lightunplated_targetsize-48.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.altform-unplated_targetsize-16.png b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.altform-unplated_targetsize-16.png new file mode 100644 index 0000000..61c56f7 Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.altform-unplated_targetsize-16.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.altform-unplated_targetsize-24.png b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.altform-unplated_targetsize-24.png new file mode 100644 index 0000000..2977bbf Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.altform-unplated_targetsize-24.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.altform-unplated_targetsize-256.png b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.altform-unplated_targetsize-256.png new file mode 100644 index 0000000..bf4ae83 Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.altform-unplated_targetsize-256.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.altform-unplated_targetsize-32.png b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.altform-unplated_targetsize-32.png new file mode 100644 index 0000000..4a0c4e0 Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.altform-unplated_targetsize-32.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.altform-unplated_targetsize-48.png b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.altform-unplated_targetsize-48.png new file mode 100644 index 0000000..93cd02a Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.altform-unplated_targetsize-48.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.scale-100.png b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.scale-100.png new file mode 100644 index 0000000..3c71a09 Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.scale-100.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.scale-125.png b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.scale-125.png new file mode 100644 index 0000000..29af2c5 Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.scale-125.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.scale-150.png b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.scale-150.png new file mode 100644 index 0000000..d93ceab Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.scale-150.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.scale-200.png b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.scale-200.png new file mode 100644 index 0000000..5106f01 Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.scale-200.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.scale-400.png b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.scale-400.png new file mode 100644 index 0000000..544e1bf Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.scale-400.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.targetsize-16.png b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.targetsize-16.png new file mode 100644 index 0000000..d078f3c Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.targetsize-16.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.targetsize-24.png b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.targetsize-24.png new file mode 100644 index 0000000..a51ea6f Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.targetsize-24.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.targetsize-256.png b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.targetsize-256.png new file mode 100644 index 0000000..68c8794 Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.targetsize-256.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.targetsize-32.png b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.targetsize-32.png new file mode 100644 index 0000000..a9e19d9 Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.targetsize-32.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.targetsize-48.png b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.targetsize-48.png new file mode 100644 index 0000000..0d9412d Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/Square44x44Logo.targetsize-48.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/StoreLogo.scale-100.png b/src/UWPResourcesGallery/Assets/Tiles/StoreLogo.scale-100.png new file mode 100644 index 0000000..a7260b2 Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/StoreLogo.scale-100.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/StoreLogo.scale-125.png b/src/UWPResourcesGallery/Assets/Tiles/StoreLogo.scale-125.png new file mode 100644 index 0000000..a8d2238 Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/StoreLogo.scale-125.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/StoreLogo.scale-150.png b/src/UWPResourcesGallery/Assets/Tiles/StoreLogo.scale-150.png new file mode 100644 index 0000000..0d1e1f2 Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/StoreLogo.scale-150.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/StoreLogo.scale-200.png b/src/UWPResourcesGallery/Assets/Tiles/StoreLogo.scale-200.png new file mode 100644 index 0000000..82a7b3f Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/StoreLogo.scale-200.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/StoreLogo.scale-400.png b/src/UWPResourcesGallery/Assets/Tiles/StoreLogo.scale-400.png new file mode 100644 index 0000000..039ff28 Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/StoreLogo.scale-400.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/Wide310x150Logo.scale-100.png b/src/UWPResourcesGallery/Assets/Tiles/Wide310x150Logo.scale-100.png new file mode 100644 index 0000000..4f51902 Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/Wide310x150Logo.scale-100.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/Wide310x150Logo.scale-125.png b/src/UWPResourcesGallery/Assets/Tiles/Wide310x150Logo.scale-125.png new file mode 100644 index 0000000..0c7cd91 Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/Wide310x150Logo.scale-125.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/Wide310x150Logo.scale-150.png b/src/UWPResourcesGallery/Assets/Tiles/Wide310x150Logo.scale-150.png new file mode 100644 index 0000000..d149556 Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/Wide310x150Logo.scale-150.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/Wide310x150Logo.scale-200.png b/src/UWPResourcesGallery/Assets/Tiles/Wide310x150Logo.scale-200.png new file mode 100644 index 0000000..009853b Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/Wide310x150Logo.scale-200.png differ diff --git a/src/UWPResourcesGallery/Assets/Tiles/Wide310x150Logo.scale-400.png b/src/UWPResourcesGallery/Assets/Tiles/Wide310x150Logo.scale-400.png new file mode 100644 index 0000000..4eb478b Binary files /dev/null and b/src/UWPResourcesGallery/Assets/Tiles/Wide310x150Logo.scale-400.png differ diff --git a/src/UWPResourcesGallery/Common/SampleTemplateProvider.cs b/src/UWPResourcesGallery/Common/SampleTemplateProvider.cs new file mode 100644 index 0000000..3fe8c9c --- /dev/null +++ b/src/UWPResourcesGallery/Common/SampleTemplateProvider.cs @@ -0,0 +1,26 @@ +namespace UWPResourcesGallery.Common +{ + static class SampleTemplateProvider + { + private const string FontIconWithGlyph = + "<FontIcon Glyph=\"${Glyph}\"/>"; + + private const string SymbolIconWithGlyph = + "<SymbolIcon Symbol=\"${Symbol}\"/>"; + + public static string GetFontIconCodeFromGlyph(string glyph) + { + return FontIconWithGlyph.Replace("${Glyph}", glyph,System.StringComparison.Ordinal); + } + + internal static string GetSymbolIconCodeFromGlyph(string name) + { + return SymbolIconWithGlyph.Replace("${Symbol}", name, System.StringComparison.Ordinal); + } + + internal static string GetCustomizedFontIconCode(string glyph,string color,string size) + { + return $"<FontIcon Glyph=\"{glyph}\"\n Foreground=\"{color}\"\n FontSize=\"{size}\"/>"; + } + } +} diff --git a/src/UWPResourcesGallery/Common/StandardConverter.cs b/src/UWPResourcesGallery/Common/StandardConverter.cs new file mode 100644 index 0000000..92f376c --- /dev/null +++ b/src/UWPResourcesGallery/Common/StandardConverter.cs @@ -0,0 +1,34 @@ +using System; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Data; + +namespace UWPResourcesGallery.Common +{ + + public class StringValueToVisibilityConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, string language) + { + string stringValue = (string)value; + return !string.IsNullOrEmpty(stringValue) ? Visibility.Visible : Visibility.Collapsed; + } + + public object ConvertBack(object value, Type targetType, object parameter, string language) + { + throw new NotImplementedException("Converting Visibility to string is not encouraged and implemented with this converter."); + } + } + + public class BoolToVisibilityConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, string language) + { + return ((bool)value) ? Visibility.Visible : Visibility.Collapsed; + } + + public object ConvertBack(object value, Type targetType, object parameter, string language) + { + return ((Visibility)value) == Visibility.Visible; + } + } +} diff --git a/src/UWPResourcesGallery/Common/ThemeHelper.cs b/src/UWPResourcesGallery/Common/ThemeHelper.cs new file mode 100644 index 0000000..d200fe8 --- /dev/null +++ b/src/UWPResourcesGallery/Common/ThemeHelper.cs @@ -0,0 +1,99 @@ +using System; +using Windows.Storage; +using Windows.UI; +using Windows.UI.Core; +using Windows.UI.ViewManagement; +using Windows.UI.Xaml; + +namespace UWPResourcesGallery.Common +{ + public static class ThemeHelper + { + private const string SelectedAppThemeKey = "SelectedAppTheme"; + private static Window ApplicationWindow = null; + + private static UISettings uiSettings; + public static ElementTheme AppTheme + { + get + { + if (Window.Current.Content is FrameworkElement rootElement) + { + return rootElement.RequestedTheme; + } + return ElementTheme.Default; + } + + set + { + ApplicationData.Current.LocalSettings.Values[SelectedAppThemeKey] = value.ToString(); + + if (Window.Current.Content is FrameworkElement rootElement) + { + rootElement.RequestedTheme = value; + } + + UpdateTitleBarButtonColors(); + } + } + + public static bool IsDarkTheme() + { + if (AppTheme == ElementTheme.Default && + App.Current.RequestedTheme == ApplicationTheme.Dark) + { + return true; + } + return AppTheme == ElementTheme.Dark; + } + + internal static void Initialize() + { + ApplicationWindow = Window.Current; + var savedTheme = ApplicationData.Current.LocalSettings.Values[SelectedAppThemeKey]; + if (savedTheme != null) + { + if (Window.Current.Content is FrameworkElement rootElement) + { + rootElement.RequestedTheme = ElementThemeFromName(savedTheme.ToString()); + } + + UpdateTitleBarButtonColors(); + } + + uiSettings = new UISettings(); + uiSettings.ColorValuesChanged += UiSettings_ColorValuesChanged; + } + + private static async void UiSettings_ColorValuesChanged(UISettings sender, object args) + { + if (ApplicationWindow != null) + { + await ApplicationWindow.Dispatcher.RunAsync(CoreDispatcherPriority.High, () => + { + UpdateTitleBarButtonColors(); + }); + } + } + + public static void UpdateTitleBarButtonColors() + { + ApplicationViewTitleBar titleBar = ApplicationView.GetForCurrentView().TitleBar; + if (IsDarkTheme()) + { + // Darktheme, set tilebar buttons to white + titleBar.ButtonForegroundColor = Colors.White; + } + else + { + // Lighttheme, set titlebar buttons to black + titleBar.ButtonForegroundColor = Colors.Black; + } + } + + public static ElementTheme ElementThemeFromName(string name) + { + return (ElementTheme)Enum.Parse(typeof(ElementTheme), name); + } + } +} diff --git a/src/UWPResourcesGallery/Controls/Common/CodeSample.xaml b/src/UWPResourcesGallery/Controls/Common/CodeSample.xaml new file mode 100644 index 0000000..f4f9185 --- /dev/null +++ b/src/UWPResourcesGallery/Controls/Common/CodeSample.xaml @@ -0,0 +1,35 @@ +<UserControl + x:Class="UWPResourcesGallery.Controls.Common.CodeSample" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="using:UWPResourcesGallery.Controls.Common" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"> + + <UserControl.Resources> + <x:Double x:Key="CodeFontSize">14</x:Double> + </UserControl.Resources> + + <Grid Margin="0" HorizontalAlignment="Stretch" + Background="{ThemeResource SystemChromeMediumColor}" + BorderBrush="{ThemeResource SystemControlBackgroundListLowBrush}" + BorderThickness="1"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="1*" /> + <ColumnDefinition Width="Auto" /> + </Grid.ColumnDefinitions> + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + </Grid.RowDefinitions> + <Grid + VerticalAlignment="Stretch" Padding="0,5,0,5"> + <RichTextBlock Name="CodeBlock" TextWrapping="Wrap" Margin="5,0,5,2" + FontFamily="Consolas" IsTextSelectionEnabled="True" + FontSize="{ThemeResource CodeFontSize}" + HorizontalAlignment="Left" VerticalAlignment="Center"/> + </Grid> + <Button x:Name="CopyButton" Click="Copy_Click" + VerticalAlignment="Top" Grid.Column="1" + Style="{ThemeResource CopyButtonStyle}" Margin="5,0,0,0"/> + </Grid> +</UserControl> diff --git a/src/UWPResourcesGallery/Controls/Common/CodeSample.xaml.cs b/src/UWPResourcesGallery/Controls/Common/CodeSample.xaml.cs new file mode 100644 index 0000000..dfbd9cd --- /dev/null +++ b/src/UWPResourcesGallery/Controls/Common/CodeSample.xaml.cs @@ -0,0 +1,150 @@ +using ColorCode; +using ColorCode.Common; +using UWPResourcesGallery.Common; +using Windows.ApplicationModel.DataTransfer; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Documents; + +// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236 + +namespace UWPResourcesGallery.Controls.Common +{ + public sealed partial class CodeSample : UserControl + { + + #region Code property + public static readonly DependencyProperty CodeProperty = + DependencyProperty.Register( + "Code", + typeof(string), + typeof(CodeSample), + new PropertyMetadata(default(string), new PropertyChangedCallback(OnCodeDependencyPropertyChanged))); + + public string Code + { + get + { + return (string)GetValue(CodeProperty); + } + set + { + SetValue(CodeProperty, value); + CodeChanged(); + } + } + + private static void OnCodeDependencyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + var sampleObject = (d as CodeSample); + sampleObject.CodeChanged(); + } + + #endregion + + #region IsSyntaxHighlightingEnabled + + public bool IsSyntaxHighlightingEnabled + { + get + { + return (bool)GetValue(IsSyntaxHighlightingEnabledProperty); + } + set + { + SetValue(IsSyntaxHighlightingEnabledProperty, value); + CodeChanged(); + } + } + + public static readonly DependencyProperty IsSyntaxHighlightingEnabledProperty = + DependencyProperty.Register( + "IsSyntaxHighlightingEnabled", + typeof(bool), + typeof(CodeSample), + new PropertyMetadata(false, new PropertyChangedCallback(OnCodeDependencyPropertyChanged))); + #endregion + + public CodeSample() + { + InitializeComponent(); + } + + private void CodeChanged() + { + CodeBlock.Blocks.Clear(); + if (Code == null) + { + return; + } + if (IsSyntaxHighlightingEnabled) + { + var formatter = new RichTextBlockFormatter(ThemeHelper.AppTheme); + if (ThemeHelper.IsDarkTheme()) + { + UpdateFormatterDarkThemeColors(formatter); + } + formatter.FormatRichTextBlock(Code, Languages.Xml, CodeBlock); + } + else + { + Run r = new Run + { + Text = Code + }; + Paragraph p = new Paragraph(); + p.Inlines.Add(r); + CodeBlock.Blocks.Add(p); + } + } + + private static void UpdateFormatterDarkThemeColors(RichTextBlockFormatter formatter) + { + // Replace the default dark theme resources with ones that more closely align to VS Code dark theme. + formatter.Styles.Remove(formatter.Styles[ScopeName.XmlAttribute]); + formatter.Styles.Remove(formatter.Styles[ScopeName.XmlAttributeQuotes]); + formatter.Styles.Remove(formatter.Styles[ScopeName.XmlAttributeValue]); + formatter.Styles.Remove(formatter.Styles[ScopeName.HtmlComment]); + formatter.Styles.Remove(formatter.Styles[ScopeName.XmlDelimiter]); + formatter.Styles.Remove(formatter.Styles[ScopeName.XmlName]); + + formatter.Styles.Add(new ColorCode.Styling.Style(ScopeName.XmlAttribute) + { + Foreground = "#FF87CEFA", + ReferenceName = "xmlAttribute" + }); + formatter.Styles.Add(new ColorCode.Styling.Style(ScopeName.XmlAttributeQuotes) + { + Foreground = "#FFFFA07A", + ReferenceName = "xmlAttributeQuotes" + }); + formatter.Styles.Add(new ColorCode.Styling.Style(ScopeName.XmlAttributeValue) + { + Foreground = "#FFFFA07A", + ReferenceName = "xmlAttributeValue" + }); + formatter.Styles.Add(new ColorCode.Styling.Style(ScopeName.HtmlComment) + { + Foreground = "#FF6B8E23", + ReferenceName = "htmlComment" + }); + formatter.Styles.Add(new ColorCode.Styling.Style(ScopeName.XmlDelimiter) + { + Foreground = "#FF808080", + ReferenceName = "xmlDelimiter" + }); + formatter.Styles.Add(new ColorCode.Styling.Style(ScopeName.XmlName) + { + Foreground = "#FF5F82E8", + ReferenceName = "xmlName" + }); + } + + private void Copy_Click(object sender, RoutedEventArgs e) + { + DataPackage package = new DataPackage(); + package.SetText(Code); + Clipboard.SetContent(package); + } + } +} diff --git a/src/UWPResourcesGallery/Controls/Common/DualThemePresenter.cs b/src/UWPResourcesGallery/Controls/Common/DualThemePresenter.cs new file mode 100644 index 0000000..6af057b --- /dev/null +++ b/src/UWPResourcesGallery/Controls/Common/DualThemePresenter.cs @@ -0,0 +1,84 @@ +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; + +// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236 + +namespace UWPResourcesGallery.Controls.Common +{ + public sealed partial class DualThemePresenter : UserControl + { + + #region LightThemeContent property + public FrameworkElement LightThemeContent + { + get + { + return (FrameworkElement)GetValue(LightThemeContentProperty); + } + set + { + SetValue(LightThemeContentProperty, value); + ThemedContentChanged(); + } + } + public static readonly DependencyProperty LightThemeContentProperty = DependencyProperty.Register( + "LightThemeContent", + typeof(FrameworkElement), + typeof(DualThemePresenter), + new PropertyMetadata(default(FrameworkElement), ThemedContentPropertyChanged) + ); + #endregion + + #region DarkThemeContent property + public FrameworkElement DarkThemeContent + { + get + { + return (FrameworkElement)GetValue(DarkThemeContentProperty); + } + set + { + SetValue(DarkThemeContentProperty, value); + ThemedContentChanged(); + } + } + public static readonly DependencyProperty DarkThemeContentProperty = DependencyProperty.Register( + "DarkThemeContent", + typeof(FrameworkElement), + typeof(DualThemePresenter), + new PropertyMetadata(default(FrameworkElement), ThemedContentPropertyChanged) + ); + #endregion + + #region ContentOrientation property + public Orientation ContentOrientation + { + get { return (Orientation)GetValue(ContentOrientationProperty); } + set { SetValue(ContentOrientationProperty, value); } + } + + // Using a DependencyProperty as the backing store for MyProperty. This enables animation, styling, binding, etc... + public static readonly DependencyProperty ContentOrientationProperty = + DependencyProperty.Register("MyProperty", typeof(Orientation), typeof(DualThemePresenter), new PropertyMetadata(0)); + #endregion + + public DualThemePresenter() + { + InitializeComponent(); + } + + private void ThemedContentChanged() + { + Bindings.Update(); + } + + public static void ThemedContentPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + if(d== null) + { + return; + } + (d as DualThemePresenter).ThemedContentChanged(); + } + } +} diff --git a/src/UWPResourcesGallery/Controls/Common/DualThemePresenter.xaml b/src/UWPResourcesGallery/Controls/Common/DualThemePresenter.xaml new file mode 100644 index 0000000..746c25e --- /dev/null +++ b/src/UWPResourcesGallery/Controls/Common/DualThemePresenter.xaml @@ -0,0 +1,35 @@ +<UserControl + x:Class="UWPResourcesGallery.Controls.Common.DualThemePresenter" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="using:UWPResourcesGallery.Controls.Common" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + mc:Ignorable="d" + d:DesignHeight="300" + d:DesignWidth="400"> + + + <StackPanel Orientation="{x:Bind ContentOrientation,Mode=OneWay}"> + + <!-- Light theme content --> + <Grid Grid.Column="0" RequestedTheme="Light" + BorderThickness="1" + BorderBrush="{ThemeResource SystemControlBackgroundListLowBrush}" + Background="{ThemeResource SystemControlBackgroundAltHighBrush}"> + <ContentPresenter Content="{x:Bind LightThemeContent}"/> + </Grid> + + <!-- Adding some spacing --> + <Border Margin="5,5,5,5"/> + + <!-- Dark theme content --> + <Grid Grid.Column="2" RequestedTheme="Dark" + BorderThickness="1" + BorderBrush="{ThemeResource SystemControlBackgroundListLowBrush}" + Background="{ThemeResource SystemControlBackgroundAltHighBrush}"> + <ContentPresenter Content="{x:Bind DarkThemeContent}"/> + </Grid> + + </StackPanel> +</UserControl> diff --git a/src/UWPResourcesGallery/Controls/Common/PageHeader.xaml b/src/UWPResourcesGallery/Controls/Common/PageHeader.xaml new file mode 100644 index 0000000..0625c0f --- /dev/null +++ b/src/UWPResourcesGallery/Controls/Common/PageHeader.xaml @@ -0,0 +1,17 @@ +<UserControl + x:Class="UWPResourcesGallery.Controls.Common.PageHeader" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="using:UWPResourcesGallery.Controls.Common" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + mc:Ignorable="d" + d:DesignHeight="300" + d:DesignWidth="400"> + + <StackPanel> + <TextBlock Text="{x:Bind PageName,Mode=OneWay}" FontSize="28" AutomationProperties.HeadingLevel="1" TextWrapping="Wrap"/> + <TextBlock Text="{x:Bind PageDescription,Mode=OneWay}" FontSize="18" AutomationProperties.HeadingLevel="2" + TextWrapping="Wrap" Visibility="{x:Bind PageDescription,Mode=OneWay,Converter={StaticResource StringValueToVisibilityConverter}}"/> + </StackPanel> +</UserControl> diff --git a/src/UWPResourcesGallery/Controls/Common/PageHeader.xaml.cs b/src/UWPResourcesGallery/Controls/Common/PageHeader.xaml.cs new file mode 100644 index 0000000..4fd51fc --- /dev/null +++ b/src/UWPResourcesGallery/Controls/Common/PageHeader.xaml.cs @@ -0,0 +1,41 @@ +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; + +// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236 + +namespace UWPResourcesGallery.Controls.Common +{ + public sealed partial class PageHeader : UserControl + { + + + #region PageName property + public string PageName + { + get { return (string)GetValue(PageNameProperty); } + set { SetValue(PageNameProperty, value); } + } + + // Using a DependencyProperty as the backing store for PageName. + public static readonly DependencyProperty PageNameProperty = + DependencyProperty.Register("PageName", typeof(string), typeof(PageHeader), new PropertyMetadata(default(string))); + #endregion + + #region PageDescription property + public string PageDescription + { + get { return (string)GetValue(PageDescriptionProperty); } + set { SetValue(PageDescriptionProperty, value); } + } + + // Using a DependencyProperty as the backing store for PageDescription. + public static readonly DependencyProperty PageDescriptionProperty = + DependencyProperty.Register("PageDescription", typeof(string), typeof(PageHeader), new PropertyMetadata(default(string))); + #endregion + + public PageHeader() + { + InitializeComponent(); + } + } +} diff --git a/src/UWPResourcesGallery/Controls/Templates/IconItemControl.xaml b/src/UWPResourcesGallery/Controls/Templates/IconItemControl.xaml new file mode 100644 index 0000000..219f528 --- /dev/null +++ b/src/UWPResourcesGallery/Controls/Templates/IconItemControl.xaml @@ -0,0 +1,64 @@ +<UserControl + x:Class="UWPResourcesGallery.Controls.Templates.IconItemControl" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + mc:Ignorable="d" + d:DesignHeight="50" + HorizontalAlignment="Stretch" + d:DesignWidth="200"> + + <Grid x:Name="IconControlRootGrid" Background="{ThemeResource SystemControlBackgroundListLowBrush}" MinWidth="240" MaxWidth="240" MinHeight="120"> + <!-- Default layout is designed for small sizes. For larger sizes increase space --> + <VisualStateManager.VisualStateGroups> + <VisualStateGroup> + <VisualState> + <VisualState.Setters> + <Setter Target="IconControlRootGrid.MinWidth" Value="260"/> + <Setter Target="IconControlRootGrid.MaxWidth" Value="300"/> + </VisualState.Setters> + + <VisualState.StateTriggers> + <AdaptiveTrigger MinWindowWidth="600"/> + </VisualState.StateTriggers> + </VisualState> + </VisualStateGroup> + </VisualStateManager.VisualStateGroups> + + <Grid.RowDefinitions> + <RowDefinition Height="*" /> + </Grid.RowDefinitions> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="*" /> + </Grid.ColumnDefinitions> + + <!-- Icon and hex code --> + <StackPanel VerticalAlignment="Center"> + <Viewbox Grid.Column="0" Height="50" Width="50" Margin="4,10,0,0" x:Name="IconView"> + <FontIcon Margin="0,10" Glyph="{x:Bind Icon.Character}" + FontFamily="{StaticResource SymbolThemeFontFamily}" + Grid.Row="1"/> + </Viewbox> + <TextBlock Text="{x:Bind Icon.Code}" HorizontalAlignment="Center" Margin="4,0,0,20" + VerticalAlignment="Center" Foreground="{ThemeResource SystemControlForegroundBaseMediumBrush}"/> + </StackPanel> + + <!-- Icon name/descriptor --> + <TextBlock Text="{x:Bind Icon.Name}" Margin="5,0,5,0" x:Name="IconName" + Grid.Column="1" HorizontalAlignment="Center" TextWrapping="Wrap" VerticalAlignment="Center" + FontSize="18" Foreground="{ThemeResource SystemControlForegroundAccentBrush}"/> + + <!-- Is symbol badge --> + <Grid Grid.ColumnSpan="2" + Visibility="{x:Bind Icon.IsSymbol,Converter={StaticResource BoolToVisibilityConverter}}" + VerticalAlignment="Top" HorizontalAlignment="Right"> + <Rectangle Fill="{ThemeResource SystemAccentColor}" Opacity=".5" /> + <StackPanel Orientation="Horizontal" Margin="4,2,4,4" > + <FontIcon Glyph="" FontSize="16" Margin="0,0,4,0"/> + <TextBlock Text="Symbol" /> + </StackPanel> + </Grid> + </Grid> +</UserControl> diff --git a/src/UWPResourcesGallery/Controls/Templates/IconItemControl.xaml.cs b/src/UWPResourcesGallery/Controls/Templates/IconItemControl.xaml.cs new file mode 100644 index 0000000..5ffbe37 --- /dev/null +++ b/src/UWPResourcesGallery/Controls/Templates/IconItemControl.xaml.cs @@ -0,0 +1,53 @@ +using UWPResourcesGallery.Model.Icon; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; + +namespace UWPResourcesGallery.Controls.Templates +{ + public partial class IconItemControl : UserControl + { + + public UIElement IconViewPresenter + { + get { return IconView; } + } + + #region IconItem property + public static readonly DependencyProperty IconProperty = + DependencyProperty.Register( + "Icon", + typeof(IconItem), + typeof(IconItemControl), + new PropertyMetadata(default(IconItem), new PropertyChangedCallback(OnIconDependencyPropertyChanged))); + + public IconItem Icon + { + get + { + return (IconItem)GetValue(IconProperty); + } + set + { + SetValue(IconProperty, value); + IconChanged(); + } + } + + private static void OnIconDependencyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + IconItemControl control = d as IconItemControl; + control.IconChanged(); + } + #endregion + + public IconItemControl() + { + InitializeComponent(); + } + + private void IconChanged() + { + Bindings.Update(); + } + } +} diff --git a/src/UWPResourcesGallery/Controls/Templates/SystemColorPresenter.xaml b/src/UWPResourcesGallery/Controls/Templates/SystemColorPresenter.xaml new file mode 100644 index 0000000..02d10d3 --- /dev/null +++ b/src/UWPResourcesGallery/Controls/Templates/SystemColorPresenter.xaml @@ -0,0 +1,80 @@ +<UserControl + x:Class="UWPResourcesGallery.Controls.Templates.SystemColorPresenter" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="using:UWPResourcesGallery.Controls.Templates" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:common="using:UWPResourcesGallery.Controls.Common" + mc:Ignorable="d" + d:DesignHeight="300" + d:DesignWidth="400"> + + <Grid Padding="8" Width="480" Background="{ThemeResource SystemControlBackgroundListLowBrush}"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="16"/> + <ColumnDefinition Width="*"/> + </Grid.ColumnDefinitions> + + <common:DualThemePresenter Width="102" Grid.Row="0" Grid.RowSpan="4"> + <common:DualThemePresenter.LightThemeContent> + <StackPanel Width="102"> + <TextBlock Margin="4,0,0,0" Text="Light theme"/> + <Border Width="90" Margin="2,0,8,6" BorderThickness="0"> + <!--White and black background for opaque colors--> + <Border.Background> + <LinearGradientBrush StartPoint="0,0" EndPoint="1,0"> + <GradientStop Color="White" Offset="0.0" /> + <GradientStop Color="White" Offset="0.5" /> + <GradientStop Color="Black" Offset="0.5" /> + <GradientStop Color="Black" Offset="1" /> + </LinearGradientBrush> + </Border.Background> + <Grid Background="{x:Bind SystemColor.LightThemeBrush}" Height="24" + BorderThickness="1" Margin="4" + BorderBrush="Gray"> + </Grid> + </Border> + </StackPanel> + </common:DualThemePresenter.LightThemeContent> + + <common:DualThemePresenter.DarkThemeContent> + <StackPanel Width="102"> + <TextBlock Margin="4,0,0,0" Text="Dark theme"/> + <Border Width="90" Margin="2,0,8,6" BorderThickness="0"> + <!--Black and white background for opaque colors--> + <Border.Background> + <LinearGradientBrush StartPoint="1,0" EndPoint="0,0"> + <GradientStop Color="White" Offset="0.0" /> + <GradientStop Color="White" Offset="0.5" /> + <GradientStop Color="Black" Offset="0.5" /> + <GradientStop Color="Black" Offset="1" /> + </LinearGradientBrush> + </Border.Background> + <Grid Background="{x:Bind SystemColor.DarkThemeBrush}" Height="24" + BorderThickness="1" Margin="4" + BorderBrush="Gray"> + </Grid> + </Border> + </StackPanel> + </common:DualThemePresenter.DarkThemeContent> + </common:DualThemePresenter> + + <Grid Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> + <Grid.RowDefinitions> + <RowDefinition Height="Auto"/> + <RowDefinition Height="*"/> + <RowDefinition Height="Auto"/> + <RowDefinition Height="Auto"/> + </Grid.RowDefinitions> + + <TextBlock x:Name="BrushName" Text="{x:Bind SystemColor.Key}" FontSize="20" Foreground="{ThemeResource SystemAccentColor}" + HorizontalAlignment="Center" Margin="0,8,0,16" VerticalAlignment="Stretch" IsTextSelectionEnabled="True" + Grid.Row="0" Grid.RowSpan="2"/> + + <TextBlock Grid.Row="2" HorizontalAlignment="Stretch" Margin="0,8,0,4" Text="Themeresource snippet"/> + <common:CodeSample Grid.Row="3" HorizontalAlignment="Stretch" IsSyntaxHighlightingEnabled="True" Code="{x:Bind SystemColor.ThemeResourceString}"/> + </Grid> + </Grid> +</UserControl> diff --git a/src/UWPResourcesGallery/Controls/Templates/SystemColorPresenter.xaml.cs b/src/UWPResourcesGallery/Controls/Templates/SystemColorPresenter.xaml.cs new file mode 100644 index 0000000..061f893 --- /dev/null +++ b/src/UWPResourcesGallery/Controls/Templates/SystemColorPresenter.xaml.cs @@ -0,0 +1,47 @@ +using UWPResourcesGallery.Model.Brush; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; + +namespace UWPResourcesGallery.Controls.Templates +{ + public sealed partial class SystemColorPresenter : UserControl + { + + #region SystemColorItem property + public static readonly DependencyProperty SystemColorItemDependencyProperty = DependencyProperty.Register( + "SystemColor", + typeof(SystemColor), + typeof(SystemColorPresenter), + new PropertyMetadata(default(SystemColor), new PropertyChangedCallback(SystemColorItemChanged)) + ); + + public SystemColor SystemColor + { + get + { + return (SystemColor)GetValue(SystemColorItemDependencyProperty); + } + set + { + SetValue(SystemColorItemDependencyProperty, value); + SystemColorChanged(); + } + } + + private static void SystemColorItemChanged(object sender, object e) + { + (sender as SystemColorPresenter).SystemColorChanged(); + } + #endregion + + public SystemColorPresenter() + { + InitializeComponent(); + } + + private void SystemColorChanged() + { + Bindings.Update(); + } + } +} diff --git a/src/UWPResourcesGallery/Package.appxmanifest b/src/UWPResourcesGallery/Package.appxmanifest new file mode 100644 index 0000000..53f3ff8 --- /dev/null +++ b/src/UWPResourcesGallery/Package.appxmanifest @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="utf-8"?> + +<Package + xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" + xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" + xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" + IgnorableNamespaces="uap mp"> + + <Identity + Name="UWP-Resourcess-Gallery" + Publisher="CN=Marcel Wagner" + Version="1.0.0.0" /> + + <mp:PhoneIdentity PhoneProductId="6245fa1a-e391-413d-9b02-a4ae1f060713" PhonePublisherId="00000000-0000-0000-0000-000000000000"/> + + <Properties> + <DisplayName>UWP Resources Gallery</DisplayName> + <PublisherDisplayName>Marcel Wagner</PublisherDisplayName> + <Logo>Assets\Tiles\StoreLogo.png</Logo> + </Properties> + + <Dependencies> + <TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" /> + </Dependencies> + + <Resources> + <Resource Language="x-generate"/> + </Resources> + + <Applications> + <Application Id="App" + Executable="$targetnametoken$.exe" + EntryPoint="UWP_Resources_Gallery.App"> + <uap:VisualElements + DisplayName="UWP Resources Gallery" + Square150x150Logo="Assets\Tiles\Square150x150Logo.png" + Square44x44Logo="Assets\Tiles\Square44x44Logo.png" + Description="This app displays common resources that are available for UWP Apps such as the Segoe icons and color resources." + BackgroundColor="#0084f0"> + <uap:DefaultTile Wide310x150Logo="Assets\Tiles\Wide310x150Logo.png" Square71x71Logo="Assets\Tiles\SmallTile.png" Square310x310Logo="Assets\Tiles\LargeTile.png" > + <uap:ShowNameOnTiles> + <uap:ShowOn Tile="wide310x150Logo"/> + <uap:ShowOn Tile="square150x150Logo"/> + <uap:ShowOn Tile="square310x310Logo"/> + </uap:ShowNameOnTiles> + </uap:DefaultTile > + <uap:SplashScreen Image="Assets\Tiles\SplashScreen.png" BackgroundColor="#0084f0"/> + <uap:InitialRotationPreference> + <uap:Rotation Preference="landscape"/> + <uap:Rotation Preference="portrait"/></uap:InitialRotationPreference> + </uap:VisualElements> + </Application> + </Applications> +</Package> \ No newline at end of file diff --git a/src/UWPResourcesGallery/Pages/IconDetailPage.xaml b/src/UWPResourcesGallery/Pages/IconDetailPage.xaml new file mode 100644 index 0000000..bbb515d --- /dev/null +++ b/src/UWPResourcesGallery/Pages/IconDetailPage.xaml @@ -0,0 +1,167 @@ +<Page + x:Class="UWPResourcesGallery.Pages.IconDetailPage" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:common="using:UWPResourcesGallery.Controls.Common" + xmlns:muxc="using:Microsoft.UI.Xaml.Controls" + mc:Ignorable="d"> + + <Page.Resources> + <Style x:Key="CodeNameTextBlock" TargetType="common:CodeSample"> + <Setter Property="Grid.Column" Value="2" /> + <Setter Property="VerticalAlignment" Value="Center" /> + <Setter Property="HorizontalAlignment" Value="Stretch" /> + </Style> + + </Page.Resources> + <ScrollViewer> + <VisualStateManager.VisualStateGroups> + <VisualStateGroup> + <VisualState> + <VisualState.Setters> + <Setter Target="RootFontIconPageContent.Orientation" Value="Horizontal" /> + </VisualState.Setters> + <VisualState.StateTriggers> + <AdaptiveTrigger MinWindowWidth="1500"/> + </VisualState.StateTriggers> + </VisualState> + </VisualStateGroup> + <VisualStateGroup> + <VisualState> + <VisualState.Setters> + <Setter Target="CustomFontIconPanelContent.Orientation" Value="Horizontal" /> + <Setter Target="CustomFontIconPanelContent.MaxWidth" Value="1000" /> + </VisualState.Setters> + <VisualState.StateTriggers> + <AdaptiveTrigger MinWindowWidth="750"/> + </VisualState.StateTriggers> + </VisualState> + </VisualStateGroup> + </VisualStateManager.VisualStateGroups> + + <StackPanel Padding="25,10"> + <!-- Header --> + <StackPanel x:Name="TransitionReceiver" Orientation="Horizontal" Margin="0,0,0,16" > + <Viewbox> + <FontIcon x:Name="IconDisplay" Glyph="{x:Bind icon.Character}" + Height="42" Width="42" FontSize="42"/> + </Viewbox> + <TextBlock VerticalAlignment="Center" Margin="16,0,0,0" + FontSize="24" Text="{x:Bind icon.Name}"/> + </StackPanel> + + <!-- Content --> + <StackPanel x:Name="RootFontIconPageContent" Orientation="Vertical"> + <!-- Standard code samples --> + <StackPanel MaxWidth="700" HorizontalAlignment="Left"> + <!-- Info title --> + <TextBlock Style="{ThemeResource SectionHeader}" Margin="0,0,0,4">Info</TextBlock> + + <!-- Info panel --> + <Grid HorizontalAlignment="Stretch" Padding="11" + BorderBrush="{ThemeResource SystemBaseLowColor}" BorderThickness="1" > + <Grid.RowDefinitions> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + <RowDefinition Height="Auto" /> + </Grid.RowDefinitions> + + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="5"/> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="*"/> + </Grid.ColumnDefinitions> + + <TextBlock Text="Icon name" Margin="0,0,10,0" FontSize="16" + Grid.Row="0" Grid.Column="0" VerticalAlignment="Center"/> + <common:CodeSample Code="{x:Bind icon.Name}" Grid.Row="0" + Margin="0,5" Style="{ThemeResource CodeNameTextBlock}"/> + + <TextBlock Text="Unicode point" Margin="0,0,10,0" FontSize="16" + Grid.Row="1" Grid.Column="0" VerticalAlignment="Center"/> + <common:CodeSample Code="{x:Bind icon.Code}" Grid.Row="1" + Margin="0,5" Style="{ThemeResource CodeNameTextBlock}"/> + + <TextBlock Text="Text glyph" Margin="0,0,10,0" FontSize="16" + Grid.Row="2" Grid.Column="0" VerticalAlignment="Center"/> + <common:CodeSample Code="{x:Bind icon.StringGlyph}" Grid.Row="2" + Margin="0,5" Style="{ThemeResource CodeNameTextBlock}"/> + </Grid> + + <!--Normal code sample(s)--> + <TextBlock Margin="0,16,0,0" Style="{ThemeResource SectionHeader}">Icon as control</TextBlock> + + <!-- SymbolIcon (only show when icon is present in Symbol enum) --> + <StackPanel HorizontalAlignment="Stretch" Visibility="{x:Bind icon.IsSymbol,Converter={StaticResource BoolToVisibilityConverter}}"> + <TextBlock Margin="0,4,0,4" FontSize="16">Symbolicon</TextBlock> + <common:CodeSample x:Name="SymbolIconCodeSample" Margin="0,0,0,4" + HorizontalAlignment="Stretch" IsSyntaxHighlightingEnabled="True"/> + </StackPanel> + + <!-- Font icon--> + <TextBlock HorizontalAlignment="Stretch" FontSize="16" Margin="0,0,0,4">FontIcon</TextBlock> + <common:CodeSample HorizontalAlignment="Stretch" x:Name="FontIconCodeSample" IsSyntaxHighlightingEnabled="True"/> + </StackPanel> + + <!-- Separator --> + <Border Margin="35,8,35,8" + BorderBrush="{ThemeResource SystemBaseLowColor}" + BorderThickness="0"/> + + <!-- Customized FontIcon --> + <StackPanel x:Name="CustomFontIconPanel"> + <!--Header--> + <TextBlock Style="{ThemeResource SectionHeader}" Margin="0,0,0,4">Custom FontIcon</TextBlock> + + <!--Customization panel--> + <StackPanel x:Name="CustomFontIconPanelContent" Orientation="Vertical" + HorizontalAlignment="Left" MaxWidth="320"> + <!--Left pane--> + <StackPanel Grid.Column="0" Grid.Row="1" HorizontalAlignment="Left" MaxWidth="350"> + <common:DualThemePresenter Grid.ColumnSpan="2" Grid.Row="1" + VerticalAlignment="Top" HorizontalAlignment="Left" ContentOrientation="Horizontal" + Height="150" Width="320"> + <common:DualThemePresenter.LightThemeContent> + <FontIcon x:Name="LightThemeIcon" Glyph="{x:Bind icon.Character}" MinWidth="150" FontSize="{x:Bind CustomIconFontSize.Value,Mode=OneWay}" Foreground="#FFFF0000"/> + </common:DualThemePresenter.LightThemeContent> + + <common:DualThemePresenter.DarkThemeContent> + <FontIcon x:Name="DarkThemeIcon" Glyph="{x:Bind icon.Character}" MinWidth="150" FontSize="{x:Bind CustomIconFontSize.Value,Mode=OneWay}" Foreground="#FFFF0000"/> + </common:DualThemePresenter.DarkThemeContent> + </common:DualThemePresenter> + + <TextBlock FontSize="16" Margin="0,8,0,4">Source code</TextBlock> + <common:CodeSample x:Name="CustomIconCode" MaxWidth="320" + IsSyntaxHighlightingEnabled="True"/> + + <TextBlock FontSize="16" Margin="0,4,0,4">Fontsize</TextBlock> + <muxc:NumberBox x:Name="CustomIconFontSize" ValueChanged="Size_ValueChanged" + Minimum="1" Maximum="100" SmallChange="1" Value="20" + SpinButtonPlacementMode="Inline" ValidationMode="InvalidInputOverwritten"/> + </StackPanel> + + <!--Separator--> + <Border Margin="10" /> + + <!--Colorpicker--> + <muxc:ColorPicker + x:Name="FontIconColorPicker" + HorizontalAlignment="Center" + IsMoreButtonVisible="True" + IsColorSliderVisible="True" + IsColorChannelTextInputVisible="True" + IsHexInputVisible="True" + IsAlphaEnabled="True" + Color="#FFFF0000" + IsAlphaSliderVisible="True" + ColorChanged="ColorPicker_ColorChanged" + IsAlphaTextInputVisible="True" /> + </StackPanel> + </StackPanel> + </StackPanel> + </StackPanel> + </ScrollViewer> +</Page> \ No newline at end of file diff --git a/src/UWPResourcesGallery/Pages/IconDetailPage.xaml.cs b/src/UWPResourcesGallery/Pages/IconDetailPage.xaml.cs new file mode 100644 index 0000000..62c8698 --- /dev/null +++ b/src/UWPResourcesGallery/Pages/IconDetailPage.xaml.cs @@ -0,0 +1,71 @@ +using System; +using System.Threading.Tasks; +using UWPResourcesGallery.Common; +using UWPResourcesGallery.Model.Icon; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Media; +using Windows.UI.Xaml.Media.Animation; +using Windows.UI.Xaml.Navigation; + +namespace UWPResourcesGallery.Pages +{ + public sealed partial class IconDetailPage : Page + { + private IconItem icon; + private string fontIconCode; + + public IconDetailPage() + { + InitializeComponent(); + } + + protected override void OnNavigatedTo(NavigationEventArgs e) + { + if(e == null) + { + return; + } + base.OnNavigatedTo(e); + var anim = ConnectedAnimationService.GetForCurrentView().GetAnimation("ForwardConnectedAnimation"); + if (anim != null) + { + anim.TryStart(TransitionReceiver); + } + if (e.Parameter is IconItem ownIcon) + { + icon = ownIcon; + fontIconCode = SampleTemplateProvider.GetFontIconCodeFromGlyph(icon.StringGlyph); + FontIconCodeSample.Code = fontIconCode; + CustomIconCode.Code = SampleTemplateProvider.GetCustomizedFontIconCode(icon.StringGlyph, FontIconColorPicker.Color.ToString(), ((int)CustomIconFontSize.Value).ToString()); + SymbolIconCodeSample.Code = SampleTemplateProvider.GetSymbolIconCodeFromGlyph(icon.Name); + Bindings.Update(); + } + } + + private void ColorPicker_ColorChanged(Microsoft.UI.Xaml.Controls.ColorPicker sender, Microsoft.UI.Xaml.Controls.ColorChangedEventArgs args) + { + LightThemeIcon.Foreground = new SolidColorBrush(args.NewColor); + DarkThemeIcon.Foreground = new SolidColorBrush(args.NewColor); + + if (icon == null) + { + return; + } + CustomIconCode.Code = SampleTemplateProvider.GetCustomizedFontIconCode(icon.StringGlyph + , args.NewColor.ToString() + , ((int)CustomIconFontSize.Value).ToString()); + } + + private void Size_ValueChanged(Microsoft.UI.Xaml.Controls.NumberBox sender, Microsoft.UI.Xaml.Controls.NumberBoxValueChangedEventArgs args) + { + if (icon == null) + { + return; + } + CustomIconCode.Code = SampleTemplateProvider.GetCustomizedFontIconCode(icon.StringGlyph + , FontIconColorPicker.Color.ToString() + , ((int)CustomIconFontSize.Value).ToString()); + } + } +} diff --git a/src/UWPResourcesGallery/Pages/IconsListPage.xaml b/src/UWPResourcesGallery/Pages/IconsListPage.xaml new file mode 100644 index 0000000..792217e --- /dev/null +++ b/src/UWPResourcesGallery/Pages/IconsListPage.xaml @@ -0,0 +1,90 @@ +<Page + xmlns:pages="using:UWPResourcesGallery.Pages" + x:Class="UWPResourcesGallery.Pages.IconsListPage" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:controls="using:UWPResourcesGallery.Controls.Templates" + xmlns:common="using:UWPResourcesGallery.Controls.Common" + mc:Ignorable="d" + Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> + + <Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch"> + <!-- Increase spacing among icon items when we have enough vertical space --> + <VisualStateManager.VisualStateGroups> + <VisualStateGroup> + <VisualState> + <VisualState.Setters> + <Setter Target="ItemsGridView.Padding" Value="10"/> + <Setter Target="ItemsGridView.ItemContainerStyle"> + <Setter.Value> + <Style x:Name="StandardGridViewItemStyle" TargetType="GridViewItem"> + <Setter Property="Margin" Value="6"/> + <Setter Property="MinHeight" Value="80" /> + </Style> + </Setter.Value> + </Setter> + </VisualState.Setters> + <VisualState.StateTriggers> + <AdaptiveTrigger MinWindowWidth="600"/> + </VisualState.StateTriggers> + </VisualState> + </VisualStateGroup> + + </VisualStateManager.VisualStateGroups> + + <Grid.RowDefinitions> + <RowDefinition Height="Auto"/> + <RowDefinition Height="50"/> + <RowDefinition Height="*"/> + </Grid.RowDefinitions> + + <Grid.ColumnDefinitions> + <ColumnDefinition Width="*"/> + </Grid.ColumnDefinitions> + + <common:PageHeader PageName="Segoe MDL2 Icons" Margin="15,0,0,0"/> + + <Grid Grid.Row="1"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="15" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="*" /> + <ColumnDefinition Width="14" /> + </Grid.ColumnDefinitions> + <TextBlock x:Name="SearchIconsLabel" Margin="0,0,10,1" Grid.Column="1" Text="Search icons:" VerticalAlignment="Center"/> + <TextBox Grid.Column="2" MinWidth="250" VerticalAlignment="Center" Margin="0,1,0,1" TextChanged="SearchTextBox_TextChanged" AutomationProperties.LabeledBy="{x:Bind SearchIconsLabel}"/> + <Border VerticalAlignment="Bottom" BorderThickness="1" BorderBrush="{ThemeResource SystemBaseMediumLowColor}" Grid.ColumnSpan="100"/> + </Grid> + + <GridView x:Name="ItemsGridView" + AutomationProperties.Name="Icons list" + SelectionMode="None" + IsItemClickEnabled="True" + ItemClick="ItemsGridView_ItemClick" + Padding="0" + Grid.Row="2"> + <GridView.Transitions> + <TransitionCollection> + <EntranceThemeTransition/> + </TransitionCollection> + </GridView.Transitions> + <GridView.ItemContainerStyle> + <Style TargetType="GridViewItem"> + <Setter Property="HorizontalAlignment" Value="Stretch"/> + <Setter Property="Margin" Value="2"/> + <Setter Property="MinHeight" Value="80" /> + <Setter Property="MaxWidth" Value="240" /> + </Style> + </GridView.ItemContainerStyle> + + <GridView.ItemTemplate> + <DataTemplate> + <controls:IconItemControl Icon="{Binding}" HorizontalAlignment="Stretch"/> + </DataTemplate> + </GridView.ItemTemplate> + </GridView> + </Grid> +</Page> \ No newline at end of file diff --git a/src/UWPResourcesGallery/Pages/IconsListPage.xaml.cs b/src/UWPResourcesGallery/Pages/IconsListPage.xaml.cs new file mode 100644 index 0000000..48dedbf --- /dev/null +++ b/src/UWPResourcesGallery/Pages/IconsListPage.xaml.cs @@ -0,0 +1,55 @@ +using System.Diagnostics; +using System.Threading.Tasks; +using UWPResourcesGallery.Controls.Templates; +using UWPResourcesGallery.Model.Icon; +using Windows.Foundation.Metadata; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Media.Animation; +using Windows.UI.Xaml.Navigation; + +namespace UWPResourcesGallery.Pages +{ + /// <summary> + /// Page displaying list of icons + /// </summary> + public sealed partial class IconsListPage : Page + { + private readonly IconItemSource source = new IconItemSource(); + + public IconsListPage() + { + InitializeComponent(); + + Loaded += LoadIcons; + } + + private void LoadIcons(object sender, Windows.UI.Xaml.RoutedEventArgs e) + { + // Delegate loading of icons, so we have smooth navigating to this page + // and not unecessarly block UI Thread + Task.Run(delegate () + { + _ = Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.High, () => + { + ItemsGridView.ItemsSource = source.FilteredItems; + }); + }); + } + + private void SearchTextBox_TextChanged(object sender, TextChangedEventArgs args) + { + source.Filter((sender as TextBox).Text); + } + + private void ItemsGridView_ItemClick(object sender, ItemClickEventArgs e) + { + var container = ((sender as GridView).ContainerFromItem(e.ClickedItem) as GridViewItem).ContentTemplateRoot as IconItemControl; + var animation = ConnectedAnimationService.GetForCurrentView().PrepareToAnimate("ForwardConnectedAnimation", container); + if(animation != null && ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 7)) + { + animation.Configuration = new BasicConnectedAnimationConfiguration(); + } + Frame.Navigate(typeof(IconDetailPage), e.ClickedItem as IconItem, new DrillInNavigationTransitionInfo()); + } + } +} diff --git a/src/UWPResourcesGallery/Pages/SettingsPage.xaml b/src/UWPResourcesGallery/Pages/SettingsPage.xaml new file mode 100644 index 0000000..71f1b36 --- /dev/null +++ b/src/UWPResourcesGallery/Pages/SettingsPage.xaml @@ -0,0 +1,40 @@ +<Page + x:Class="UWPResourcesGallery.Pages.SettingsPage" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="using:UWPResourcesGallery.Pages" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:common="using:UWPResourcesGallery.Controls.Common" + mc:Ignorable="d" + Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> + + <Page.Resources> + <Style x:Key="SectionPanel" TargetType="StackPanel"> + <Setter Property="Padding" Value="20,10,20,10"/> + </Style> + </Page.Resources> + + <StackPanel> + <common:PageHeader PageName="Settings" Margin="20,0,0,0"/> + + <StackPanel x:Name="ThemePanel" Style="{ThemeResource SectionPanel}"> + <TextBlock Text="Choose theme" Padding="0,10,0,10" FontSize="22"/> + <RadioButton Tag="Light" Content="Light" x:Name="Light" Checked="OnThemeButton_Checked"></RadioButton> + <RadioButton Tag="Dark" Content="Dark" x:Name="Dark" Checked="OnThemeButton_Checked"></RadioButton> + <RadioButton Tag="Default" Content="Use system setting" Checked="OnThemeButton_Checked" x:Name="Default"></RadioButton> + </StackPanel> + + <StackPanel Style="{ThemeResource SectionPanel}"> + <TextBlock Text="Dependencies" Padding="0,10,0,10" FontSize="22" /> + <RichTextBlock> + <Paragraph Margin="0,10,0,10"> + <Hyperlink NavigateUri="https://github.com/microsoft/microsoft-ui-xaml">WinUI (Windows UI Library)</Hyperlink> + </Paragraph> + <Paragraph Margin="0,10,0,10"> + <Hyperlink NavigateUri="https://github.com/WilliamABradley/ColorCode-Universal">ColorCode-Universal</Hyperlink> + </Paragraph> + </RichTextBlock> + </StackPanel> + </StackPanel> +</Page> diff --git a/src/UWPResourcesGallery/Pages/SettingsPage.xaml.cs b/src/UWPResourcesGallery/Pages/SettingsPage.xaml.cs new file mode 100644 index 0000000..2e9274d --- /dev/null +++ b/src/UWPResourcesGallery/Pages/SettingsPage.xaml.cs @@ -0,0 +1,41 @@ +using UWPResourcesGallery.Common; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; + + +namespace UWPResourcesGallery.Pages +{ + /// <summary> + /// Settings page for the application + /// </summary> + public sealed partial class SettingsPage : Page + { + public SettingsPage() + { + InitializeComponent(); + + foreach (FrameworkElement element in ThemePanel.Children) + { + + if (element is RadioButton radioButton) + { + if (radioButton.Tag?.ToString() == ThemeHelper.AppTheme.ToString()) + { + radioButton.IsChecked = true; + } + } + } + + } + + private void OnThemeButton_Checked(object sender, RoutedEventArgs e) + { + string themeString = (sender as RadioButton).Tag.ToString(); + + if (themeString != null) + { + ThemeHelper.AppTheme = ThemeHelper.ElementThemeFromName(themeString); + } + } + } +} diff --git a/src/UWPResourcesGallery/Pages/StartPage.xaml b/src/UWPResourcesGallery/Pages/StartPage.xaml new file mode 100644 index 0000000..d0853a6 --- /dev/null +++ b/src/UWPResourcesGallery/Pages/StartPage.xaml @@ -0,0 +1,78 @@ +<Page + x:Class="UWPResourcesGallery.Pages.StartPage" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:common="using:UWPResourcesGallery.Controls.Common" + xmlns:contract7Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract, 7)" + mc:Ignorable="d" + x:Name="StartPageReference" + Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> + + <Page.Resources> + <Style x:Key="NavigatingButtonStyle" TargetType="Button" BasedOn="{StaticResource ButtonRevealStyle}"> + <Setter Property="HorizontalAlignment" Value="Center" /> + <Setter Property="VerticalAlignment" Value="Stretch" /> + <Setter Property="Width" Value="370" /> + <Setter Property="Margin" Value="5,5,5,5" /> + </Style> + </Page.Resources> + + <Grid VerticalAlignment="Center" Margin="2,0,2,0"> + <ScrollViewer x:Name="MainScrollViewer" VerticalScrollBarVisibility="Auto"> + <StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Center"> + + <common:PageHeader Margin="5,5,5,5" + PageName="Welcome to the UWP Resources Gallery" + PageDescription="This app contains a list of UWP resources, such as system colors and the Segoe MDL2 icons."/> + + <!-- Navigation --> + <VariableSizedWrapGrid MaximumRowsOrColumns="2" Orientation="Horizontal"> + <Button Style="{ThemeResource NavigatingButtonStyle}" Click="NavigateToIconListPage_Click" + contract7Present:CornerRadius="0"> + <Grid VerticalAlignment="Stretch" Height="80" Padding="4,0,8,0"> + <Grid.RowDefinitions> + <RowDefinition Height="Auto"/> + <RowDefinition Height="*"/> + </Grid.RowDefinitions> + + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="*"/> + </Grid.ColumnDefinitions> + + <FontIcon Grid.RowSpan="2" Margin="4,8,16,0" Glyph="" FontSize="36" VerticalAlignment="Top"/> + <TextBlock Grid.Column="1" FontSize="24" Foreground="{ThemeResource SystemControlForegroundAccentBrush}" Text="Icon list" /> + <TextBlock Grid.Column="1" Grid.Row="1" Margin="0,4,0,0" TextWrapping="WrapWholeWords" MaxWidth="300" + Text="List of all Segoe MDL2 icons that are available across all versions of Windows 10."/> + </Grid> + </Button> + + <Button Style="{ThemeResource NavigatingButtonStyle}" Click="NavigateToSystemBrushesPage_Click" + contract7Present:CornerRadius="0"> + <Grid VerticalAlignment="Stretch" Height="80" Padding="4,0,8,0"> + <Grid.RowDefinitions> + <RowDefinition Height="Auto"/> + <RowDefinition Height="*"/> + </Grid.RowDefinitions> + + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="Auto"/> + <ColumnDefinition Width="*"/> + </Grid.ColumnDefinitions> + + <FontIcon Grid.RowSpan="2" Margin="4,8,16,0" Glyph="" FontSize="36" VerticalAlignment="Top"/> + <TextBlock Grid.Column="1" FontSize="24" Foreground="{ThemeResource SystemControlForegroundAccentBrush}" Text="Systemcolors"/> + <TextBlock Grid.Column="1" Grid.Row="1" Margin="0,4,0,0" TextWrapping="WrapWholeWords" MaxWidth="300" + Text="Collection of system colors which are provided by Windows 10." /> + </Grid> + </Button> + </VariableSizedWrapGrid> + </StackPanel> + </ScrollViewer> + + </Grid> +</Page> diff --git a/src/UWPResourcesGallery/Pages/StartPage.xaml.cs b/src/UWPResourcesGallery/Pages/StartPage.xaml.cs new file mode 100644 index 0000000..a507b6f --- /dev/null +++ b/src/UWPResourcesGallery/Pages/StartPage.xaml.cs @@ -0,0 +1,28 @@ +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; + +// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238 + +namespace UWPResourcesGallery.Pages +{ + /// <summary> + /// An empty page that can be used on its own or navigated to within a Frame. + /// </summary> + public sealed partial class StartPage : Page + { + public StartPage() + { + InitializeComponent(); + } + + private void NavigateToIconListPage_Click(object sender, RoutedEventArgs e) + { + AppNavigation.NavigateToIconsListPage(); + } + + private void NavigateToSystemBrushesPage_Click(object sender, RoutedEventArgs e) + { + AppNavigation.NavigateToPageType(typeof(SystemColorsPage)); + } + } +} diff --git a/src/UWPResourcesGallery/Pages/SystemColorsPage.xaml b/src/UWPResourcesGallery/Pages/SystemColorsPage.xaml new file mode 100644 index 0000000..a3263c1 --- /dev/null +++ b/src/UWPResourcesGallery/Pages/SystemColorsPage.xaml @@ -0,0 +1,52 @@ +<Page + x:Class="UWPResourcesGallery.Pages.SystemColorsPage" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="using:UWPResourcesGallery.Pages" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:scc="using:UWPResourcesGallery.Controls.Templates" + xmlns:common="using:UWPResourcesGallery.Controls.Common" + mc:Ignorable="d" + Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> + <Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch"> + <Grid.RowDefinitions> + <RowDefinition Height="Auto"/> + <RowDefinition Height="50"/> + <RowDefinition Height="*"/> + </Grid.RowDefinitions> + + <Grid.ColumnDefinitions> + <ColumnDefinition Width="*"/> + </Grid.ColumnDefinitions> + + <common:PageHeader PageName="Systemcolors" Margin="15,0,0,0"/> + + <Grid Grid.Row="1"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="15" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="Auto" /> + <ColumnDefinition Width="*" /> + <ColumnDefinition Width="14" /> + </Grid.ColumnDefinitions> + <TextBlock Margin="0,0,10,1" Grid.Column="1" Text="Search system colors:" VerticalAlignment="Center"/> + <TextBox Grid.Column="2" MinWidth="250" VerticalAlignment="Center" Margin="0,1,0,1" TextChanged="SearchTextBox_TextChanged"></TextBox> + <Border VerticalAlignment="Bottom" BorderThickness="1" BorderBrush="{ThemeResource SystemBaseMediumLowColor}" Grid.ColumnSpan="100"/> + </Grid> + + <GridView x:Name="SystemColorsPresenter" Grid.Row="2" SelectionMode="None" Padding="10"> + <GridView.Resources> + <Style TargetType="GridViewItem"> + <Setter Property="Margin" Value="6"/> + <Setter Property="MinHeight" Value="80" /> + </Style> + </GridView.Resources> + <GridView.ItemTemplate> + <DataTemplate> + <scc:SystemColorPresenter SystemColor="{Binding}"/> + </DataTemplate> + </GridView.ItemTemplate> + </GridView> + </Grid> +</Page> diff --git a/src/UWPResourcesGallery/Pages/SystemColorsPage.xaml.cs b/src/UWPResourcesGallery/Pages/SystemColorsPage.xaml.cs new file mode 100644 index 0000000..d7bcaa8 --- /dev/null +++ b/src/UWPResourcesGallery/Pages/SystemColorsPage.xaml.cs @@ -0,0 +1,42 @@ +using System.Threading.Tasks; +using UWPResourcesGallery.Model.Brush; +using Windows.UI.Xaml.Controls; + +// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238 + +namespace UWPResourcesGallery.Pages +{ + /// <summary> + /// An empty page that can be used on its own or navigated to within a Frame. + /// </summary> + public sealed partial class SystemColorsPage : Page + { + + private readonly SystemColorsItemSource source = new SystemColorsItemSource(); + + public SystemColorsPage() + { + InitializeComponent(); + Loaded += LoadSystemColors; + } + + private void LoadSystemColors(object sender, Windows.UI.Xaml.RoutedEventArgs e) + { + // Delegate loading of system colors, so we have smooth navigating to this page + // and not unecessarly block UI Thread + Task.Run(delegate () + { + _ = Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.High, () => + { + SystemColorsPresenter.ItemsSource = source.FilteredItems; + }); + }); + } + + private void SearchTextBox_TextChanged(object sender, TextChangedEventArgs args) + { + source.Filter((sender as TextBox).Text); + } + + } +} diff --git a/src/UWPResourcesGallery/Properties/AssemblyInfo.cs b/src/UWPResourcesGallery/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..5a15b93 --- /dev/null +++ b/src/UWPResourcesGallery/Properties/AssemblyInfo.cs @@ -0,0 +1,28 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Segoe Icons Gallery")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Segoe Icons Gallery")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: ComVisible(false)] \ No newline at end of file diff --git a/src/UWPResourcesGallery/Properties/Default.rd.xml b/src/UWPResourcesGallery/Properties/Default.rd.xml new file mode 100644 index 0000000..af00722 --- /dev/null +++ b/src/UWPResourcesGallery/Properties/Default.rd.xml @@ -0,0 +1,31 @@ +<!-- + This file contains Runtime Directives used by .NET Native. The defaults here are suitable for most + developers. However, you can modify these parameters to modify the behavior of the .NET Native + optimizer. + + Runtime Directives are documented at https://go.microsoft.com/fwlink/?LinkID=391919 + + To fully enable reflection for App1.MyClass and all of its public/private members + <Type Name="App1.MyClass" Dynamic="Required All"/> + + To enable dynamic creation of the specific instantiation of AppClass<T> over System.Int32 + <TypeInstantiation Name="App1.AppClass" Arguments="System.Int32" Activate="Required Public" /> + + Using the Namespace directive to apply reflection policy to all the types in a particular namespace + <Namespace Name="DataClasses.ViewModels" Serialize="All" /> +--> + +<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata"> + <Application> + <!-- + An Assembly element with Name="*Application*" applies to all assemblies in + the application package. The asterisks are not wildcards. + --> + <Assembly Name="*Application*" Dynamic="Required All" /> + + + <!-- Add your application specific runtime directives here. --> + + + </Application> +</Directives> \ No newline at end of file diff --git a/src/UWPResourcesGallery/UWPResourcesGallery.csproj b/src/UWPResourcesGallery/UWPResourcesGallery.csproj new file mode 100644 index 0000000..757bf08 --- /dev/null +++ b/src/UWPResourcesGallery/UWPResourcesGallery.csproj @@ -0,0 +1,310 @@ +<?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>{45C7F2FE-580E-4A64-BD5F-DFF8E21F2EE6}</ProjectGuid> + <OutputType>AppContainerExe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>UWPResourcesGallery</RootNamespace> + <AssemblyName>UWP Resources Gallery</AssemblyName> + <DefaultLanguage>en-US</DefaultLanguage> + <TargetPlatformIdentifier>UAP</TargetPlatformIdentifier> + <TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.18362.0</TargetPlatformVersion> + <TargetPlatformMinVersion>10.0.17134.0</TargetPlatformMinVersion> + <MinimumVisualStudioVersion>14</MinimumVisualStudioVersion> + <FileAlignment>512</FileAlignment> + <ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + <WindowsXamlEnableOverview>true</WindowsXamlEnableOverview> + <AppxPackageSigningEnabled>True</AppxPackageSigningEnabled> + <GenerateAppInstallerFile>True</GenerateAppInstallerFile> + <AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm> + <AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision> + <GenerateTestArtifacts>True</GenerateTestArtifacts> + <AppxBundle>Always</AppxBundle> + <AppxBundlePlatforms>x86|x64</AppxBundlePlatforms> + <AppInstallerUri>\\test\</AppInstallerUri> + <HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks> + <PackageCertificateThumbprint>0c306b7f34fa4dab66fdde1cdad54e520cd74c1a</PackageCertificateThumbprint> + <PackageCertificateKeyFile>UWPResourcesGallery_TemporaryKey.pfx</PackageCertificateKeyFile> + <AppxSymbolPackageEnabled>False</AppxSymbolPackageEnabled> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> + <DebugSymbols>true</DebugSymbols> + <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'"> + <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> + <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'"> + <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> + <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'"> + <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> + <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'"> + <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> + <RestoreProjectStyle>PackageReference</RestoreProjectStyle> + </PropertyGroup> + <ItemGroup> + <Compile Include="App.xaml.cs"> + <DependentUpon>App.xaml</DependentUpon> + </Compile> + <Compile Include="Common\StandardConverter.cs" /> + <Compile Include="Common\SampleTemplateProvider.cs" /> + <Compile Include="Controls\Templates\SystemColorPresenter.xaml.cs"> + <DependentUpon>SystemColorPresenter.xaml</DependentUpon> + </Compile> + <Compile Include="Controls\Common\CodeSample.xaml.cs"> + <DependentUpon>CodeSample.xaml</DependentUpon> + </Compile> + <Compile Include="Controls\Common\DualThemePresenter.cs"> + <DependentUpon>DualThemePresenter.xaml</DependentUpon> + </Compile> + <Compile Include="Controls\Common\PageHeader.xaml.cs"> + <DependentUpon>PageHeader.xaml</DependentUpon> + </Compile> + <Compile Include="Pages\IconDetailPage.xaml.cs"> + <DependentUpon>IconDetailPage.xaml</DependentUpon> + </Compile> + <Compile Include="Controls\Templates\IconItemControl.xaml.cs"> + <DependentUpon>IconItemControl.xaml</DependentUpon> + </Compile> + <Compile Include="Common\ThemeHelper.cs" /> + <Compile Include="Pages\IconsListPage.xaml.cs"> + <DependentUpon>IconsListPage.xaml</DependentUpon> + </Compile> + <Compile Include="Pages\SettingsPage.xaml.cs"> + <DependentUpon>SettingsPage.xaml</DependentUpon> + </Compile> + <Compile Include="Pages\StartPage.xaml.cs"> + <DependentUpon>StartPage.xaml</DependentUpon> + </Compile> + <Compile Include="Pages\SystemColorsPage.xaml.cs"> + <DependentUpon>SystemColorsPage.xaml</DependentUpon> + </Compile> + <Compile Include="AppNavigation.xaml.cs"> + <DependentUpon>AppNavigation.xaml</DependentUpon> + </Compile> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <ItemGroup> + <AppxManifest Include="Package.appxmanifest"> + <SubType>Designer</SubType> + </AppxManifest> + </ItemGroup> + <ItemGroup> + <Content Include="Assets\Tiles\LargeTile.scale-100.png" /> + <Content Include="Assets\Tiles\LargeTile.scale-125.png" /> + <Content Include="Assets\Tiles\LargeTile.scale-150.png" /> + <Content Include="Assets\Tiles\LargeTile.scale-200.png" /> + <Content Include="Assets\Tiles\LargeTile.scale-400.png" /> + <Content Include="Assets\Tiles\Logo.png" /> + <Content Include="Assets\Tiles\SmallTile.scale-100.png" /> + <Content Include="Assets\Tiles\SmallTile.scale-125.png" /> + <Content Include="Assets\Tiles\SmallTile.scale-150.png" /> + <Content Include="Assets\Tiles\SmallTile.scale-200.png" /> + <Content Include="Assets\Tiles\SmallTile.scale-400.png" /> + <Content Include="Assets\Tiles\SplashScreen.scale-100.png" /> + <Content Include="Assets\Tiles\SplashScreen.scale-125.png" /> + <Content Include="Assets\Tiles\SplashScreen.scale-150.png" /> + <Content Include="Assets\Tiles\SplashScreen.scale-200.png" /> + <Content Include="Assets\Tiles\SplashScreen.scale-400.png" /> + <Content Include="Assets\Tiles\Square150x150Logo.scale-100.png" /> + <Content Include="Assets\Tiles\Square150x150Logo.scale-125.png" /> + <Content Include="Assets\Tiles\Square150x150Logo.scale-150.png" /> + <Content Include="Assets\Tiles\Square150x150Logo.scale-200.png" /> + <Content Include="Assets\Tiles\Square150x150Logo.scale-400.png" /> + <Content Include="Assets\Tiles\Square44x44Logo.altform-lightunplated_targetsize-16.png" /> + <Content Include="Assets\Tiles\Square44x44Logo.altform-lightunplated_targetsize-24.png" /> + <Content Include="Assets\Tiles\Square44x44Logo.altform-lightunplated_targetsize-256.png" /> + <Content Include="Assets\Tiles\Square44x44Logo.altform-lightunplated_targetsize-32.png" /> + <Content Include="Assets\Tiles\Square44x44Logo.altform-lightunplated_targetsize-48.png" /> + <Content Include="Assets\Tiles\Square44x44Logo.altform-unplated_targetsize-16.png" /> + <Content Include="Assets\Tiles\Square44x44Logo.altform-unplated_targetsize-24.png" /> + <Content Include="Assets\Tiles\Square44x44Logo.altform-unplated_targetsize-256.png" /> + <Content Include="Assets\Tiles\Square44x44Logo.altform-unplated_targetsize-32.png" /> + <Content Include="Assets\Tiles\Square44x44Logo.altform-unplated_targetsize-48.png" /> + <Content Include="Assets\Tiles\Square44x44Logo.scale-100.png" /> + <Content Include="Assets\Tiles\Square44x44Logo.scale-125.png" /> + <Content Include="Assets\Tiles\Square44x44Logo.scale-150.png" /> + <Content Include="Assets\Tiles\Square44x44Logo.scale-200.png" /> + <Content Include="Assets\Tiles\Square44x44Logo.scale-400.png" /> + <Content Include="Assets\Tiles\Square44x44Logo.targetsize-16.png" /> + <Content Include="Assets\Tiles\Square44x44Logo.targetsize-24.png" /> + <Content Include="Assets\Tiles\Square44x44Logo.targetsize-256.png" /> + <Content Include="Assets\Tiles\Square44x44Logo.targetsize-32.png" /> + <Content Include="Assets\Tiles\Square44x44Logo.targetsize-48.png" /> + <Content Include="Assets\Tiles\StoreLogo.scale-100.png" /> + <Content Include="Assets\Tiles\StoreLogo.scale-125.png" /> + <Content Include="Assets\Tiles\StoreLogo.scale-150.png" /> + <Content Include="Assets\Tiles\StoreLogo.scale-200.png" /> + <Content Include="Assets\Tiles\StoreLogo.scale-400.png" /> + <Content Include="Assets\Tiles\Wide310x150Logo.scale-100.png" /> + <Content Include="Assets\Tiles\Wide310x150Logo.scale-125.png" /> + <Content Include="Assets\Tiles\Wide310x150Logo.scale-150.png" /> + <Content Include="Assets\Tiles\Wide310x150Logo.scale-200.png" /> + <Content Include="Assets\Tiles\Wide310x150Logo.scale-400.png" /> + <Content Include="Properties\Default.rd.xml" /> + </ItemGroup> + <ItemGroup> + <ApplicationDefinition Include="App.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </ApplicationDefinition> + <Page Include="Controls\Templates\SystemColorPresenter.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Controls\Common\CodeSample.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Controls\Common\DualThemePresenter.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Controls\Common\PageHeader.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Pages\IconDetailPage.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Controls\Templates\IconItemControl.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Pages\IconsListPage.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Pages\SettingsPage.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Pages\StartPage.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Pages\SystemColorsPage.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="AppNavigation.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> + </ItemGroup> + <ItemGroup> + <PackageReference Include="ColorCode.Core"> + <Version>2.0.6</Version> + </PackageReference> + <PackageReference Include="ColorCode.UWP"> + <Version>2.0.6</Version> + </PackageReference> + <PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers"> + <Version>2.9.3</Version> + </PackageReference> + <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform"> + <Version>6.2.9</Version> + </PackageReference> + <PackageReference Include="Microsoft.UI.Xaml"> + <Version>2.4.0-prerelease.191217001</Version> + </PackageReference> + </ItemGroup> + <ItemGroup> + <None Include="UWPResourcesGallery_TemporaryKey.pfx" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\ResourceModel\ResourceModel.csproj"> + <Project>{957b1e0e-d863-41e3-8042-7fac37a512dd}</Project> + <Name>ResourceModel</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup /> + <PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0' "> + <VisualStudioVersion>14.0</VisualStudioVersion> + </PropertyGroup> + <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.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> \ No newline at end of file diff --git a/src/UWPResourcesGallery/UWPResourcesGallery_TemporaryKey.pfx b/src/UWPResourcesGallery/UWPResourcesGallery_TemporaryKey.pfx new file mode 100644 index 0000000..263e071 Binary files /dev/null and b/src/UWPResourcesGallery/UWPResourcesGallery_TemporaryKey.pfx differ diff --git a/tests/AppInteractionTests/AppInteractionTests.csproj b/tests/AppInteractionTests/AppInteractionTests.csproj new file mode 100644 index 0000000..38f7bc3 --- /dev/null +++ b/tests/AppInteractionTests/AppInteractionTests.csproj @@ -0,0 +1,17 @@ +<Project Sdk="Microsoft.NET.Sdk"> + + <PropertyGroup> + <TargetFramework>netcoreapp3.0</TargetFramework> + <RootNamespace>AppInteractionTests</RootNamespace> + + <IsPackable>false</IsPackable> + </PropertyGroup> + + <ItemGroup> + <PackageReference Include="Appium.WebDriver" Version="4.0.0" /> + <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" /> + <PackageReference Include="MSTest.TestAdapter" Version="1.4.0" /> + <PackageReference Include="MSTest.TestFramework" Version="1.4.0" /> + </ItemGroup> + +</Project> diff --git a/tests/AppInteractionTests/TestHelper.cs b/tests/AppInteractionTests/TestHelper.cs new file mode 100644 index 0000000..719b4c5 --- /dev/null +++ b/tests/AppInteractionTests/TestHelper.cs @@ -0,0 +1,81 @@ +using OpenQA.Selenium; +using OpenQA.Selenium.Appium.MultiTouch; +using OpenQA.Selenium.Appium.Windows; +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Text; + +namespace AppInteractionTests +{ + class TestHelper + { + + public static ICollection<WindowsElement> GetElementsOfType(string elementType) + { + return TestRunInitializer.Session.FindElementsByTagName(elementType); + } + + public static List<WindowsElement> GetElementsOfTypeWithContent(string elementType, string content) + { + return GetItemsWithContent(GetElementsOfType(elementType), content); + } + + public static List<WindowsElement> GetItemsWithContent(ICollection<WindowsElement> elements, string content) + { + var elementsToReturn = new List<WindowsElement>(); + foreach (var element in elements) + { + if (element.Text.Contains(content, StringComparison.OrdinalIgnoreCase)) + { + elementsToReturn.Add(element); + continue; + } + // Check children if we did not find it in the items name + var children = element.FindElementsByTagName("Text"); + foreach (var child in children) + { + if (child.Text.Contains(content, StringComparison.OrdinalIgnoreCase)) + { + elementsToReturn.Add(element); + continue; + } + } + } + return elementsToReturn; + } + + public static void WaitMilli(int milliSeconds) + { + System.Threading.Thread.Sleep(milliSeconds); + } + + public static void InvokeButton(string text,int buttonIndex) + { + List<WindowsElement> buttons = GetElementsOfTypeWithContent("Button", text); + + buttons[buttonIndex].Click(); + } + + public static void NavigateToPage(string name) + { + var container = TestRunInitializer.Session.FindElementByName("Mainnavigation"); + container.FindElementByName(name).Click(); + } + + public static string CurrentPageInNavigation() + { + var container = TestRunInitializer.Session.FindElementByName("Mainnavigation"); + var listItems = container.FindElementsByTagName("ListItem"); + foreach(var item in listItems) + { + if (item.Selected) + { + return item.Text; + } + } + return ""; + } + } +} diff --git a/tests/AppInteractionTests/TestRunInitializer.cs b/tests/AppInteractionTests/TestRunInitializer.cs new file mode 100644 index 0000000..ac2d1df --- /dev/null +++ b/tests/AppInteractionTests/TestRunInitializer.cs @@ -0,0 +1,72 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using OpenQA.Selenium.Appium; +using OpenQA.Selenium.Appium.Windows; +using System; +using System.Diagnostics; +using System.Threading; + +namespace AppInteractionTests +{ + class TestRunInitializer + { + private const string WindowsApplicationDriverUrl = "http://127.0.0.1:4723"; + private const string AppUIBasicAppId = "UWP-Resourcess-Gallery_d9qrpd3r6ja58!App"; + + private static WindowsDriver<WindowsElement> _session; + public static WindowsDriver<WindowsElement> Session { + get + { + if(_session == null) + { + CreateSession(); + } + return _session; + } + } + + private static void CreateSession() + { + if (_session == null) + { + var appiumOptions = new AppiumOptions(); + appiumOptions.AddAdditionalCapability("app", AppUIBasicAppId); + try + { + _session = new WindowsDriver<WindowsElement>(new Uri(WindowsApplicationDriverUrl), appiumOptions); + } + catch (OpenQA.Selenium.WebDriverException) { } + Thread.Sleep(3000); + if (_session == null) + { + // WinAppDriver is probably not running, so lets start it! + Process.Start(@"C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe"); + + Thread.Sleep(10000); + _session = new WindowsDriver<WindowsElement>(new Uri(WindowsApplicationDriverUrl), appiumOptions); + } + Assert.IsNotNull(_session); + Assert.IsNotNull(_session.SessionId); + + // Dismiss the disclaimer window that may pop up on the very first application launch + // If the disclaimer is not find, this throws an exception, so lets catch that + try + { + _session.FindElementByName("Disclaimer").FindElementByName("Accept").Click(); + } + catch (OpenQA.Selenium.WebDriverException) { } + + // Wait if something is still animating in the visual tree + _session.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5); + } + } + + public static void TearDown() + { + if (_session != null) + { + _session.Quit(); + _session = null; + } + } + } +} diff --git a/tests/AppInteractionTests/Tests/BasePageTest.cs b/tests/AppInteractionTests/Tests/BasePageTest.cs new file mode 100644 index 0000000..fbdc372 --- /dev/null +++ b/tests/AppInteractionTests/Tests/BasePageTest.cs @@ -0,0 +1,25 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Collections.Generic; +using System.Text; + +namespace AppInteractionTests.Tests +{ + [TestClass] + public abstract class BasePageTest + { + public abstract string NavigationName + { + get; + } + + [TestInitialize] + public void PageSetup() + { + if (!TestHelper.CurrentPageInNavigation().Equals(NavigationName,StringComparison.InvariantCulture)) + { + TestHelper.NavigateToPage(NavigationName); + } + } + } +} diff --git a/tests/AppInteractionTests/Tests/GeneralAppTests.cs b/tests/AppInteractionTests/Tests/GeneralAppTests.cs new file mode 100644 index 0000000..e758119 --- /dev/null +++ b/tests/AppInteractionTests/Tests/GeneralAppTests.cs @@ -0,0 +1,45 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace AppInteractionTests.Tests +{ + [TestClass] + public class GeneralAppTests + { + [TestMethod] + public void SessionGetsInitialized() + { + Assert.IsNotNull(TestRunInitializer.Session); + + Assert.AreEqual("UWP Resources Gallery" + , TestRunInitializer.Session.FindElementsByTagName("Text")[0].Text); + } + + + [TestMethod] + public void VerifyCompactOverlayBehavior() + { + var compactOverlayButton = TestHelper.GetElementsOfTypeWithContent( + "Button", "Switch to overlay mode")[0]; + Assert.IsNotNull(compactOverlayButton); + + // Switch to CompactOverlay + compactOverlayButton.Click(); + TestHelper.WaitMilli(2000); + + // Get new button with updated text + compactOverlayButton = TestHelper.GetElementsOfTypeWithContent( + "Button", "Switch to normal mode")[0]; + Assert.IsNotNull(compactOverlayButton); + + // Switch to normal + compactOverlayButton.Click(); + TestHelper.WaitMilli(2000); + + // Check if button has updated correctly + compactOverlayButton = TestHelper.GetElementsOfTypeWithContent( + "Button", "Switch to overlay mode")[0]; + Assert.IsNotNull(compactOverlayButton); + } + + } +} diff --git a/tests/AppInteractionTests/Tests/IconsPageTests.cs b/tests/AppInteractionTests/Tests/IconsPageTests.cs new file mode 100644 index 0000000..396bcf8 --- /dev/null +++ b/tests/AppInteractionTests/Tests/IconsPageTests.cs @@ -0,0 +1,58 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Collections.Generic; +using System.Text; + +namespace AppInteractionTests.Tests +{ + [TestClass] + public class IconsPageTests : BasePageTest + { + public override string NavigationName => "Icons"; + + [TestMethod] + public void RendersItems() + { + // Clear search before test! + var searchIconsBox = TestRunInitializer.Session.FindElementsByName("Search icons:")[1]; + searchIconsBox.Clear(); + TestHelper.WaitMilli(500); + + var listItems = TestHelper.GetElementsOfType("ListItem"); + + // Just checking a few + Assert.IsTrue(0 < TestHelper.GetItemsWithContent(listItems, "GlobalNavigationButton").Count); + Assert.IsTrue(0 < TestHelper.GetItemsWithContent(listItems, "E700").Count); + Assert.IsTrue(0 < TestHelper.GetItemsWithContent(listItems, "Wifi").Count); + Assert.IsTrue(0 < TestHelper.GetItemsWithContent(listItems, "E701").Count); + Assert.IsTrue(0 < TestHelper.GetItemsWithContent(listItems, "Bluetooth").Count); + Assert.IsTrue(0 < TestHelper.GetItemsWithContent(listItems, "E702").Count); + } + + + [TestMethod] + public void FilterWorks() + { + string[] iconsToTest = new string[] { "AdjustHologram", "A", "DataSenseBar", "EmojiTabCelebrationObjects", "ED55" }; + + var searchIconsBox = TestRunInitializer.Session.FindElementsByName("Search icons:")[1]; + + Assert.IsNotNull(searchIconsBox); + Assert.IsTrue(searchIconsBox.Displayed); + Assert.IsTrue(searchIconsBox.Enabled); + + foreach (string icon in iconsToTest) + { + searchIconsBox.Clear(); + TestHelper.WaitMilli(500); + + searchIconsBox.SendKeys(icon); + TestHelper.WaitMilli(500); + + Assert.IsTrue(0 < TestHelper.GetElementsOfTypeWithContent("ListItem", icon).Count); + Assert.IsTrue(TestHelper.GetElementsOfTypeWithContent("ListItem", icon)[0].Displayed); + } + + } + } +} diff --git a/tests/AppInteractionTests/Tests/StartPageTests.cs b/tests/AppInteractionTests/Tests/StartPageTests.cs new file mode 100644 index 0000000..0aeeea9 --- /dev/null +++ b/tests/AppInteractionTests/Tests/StartPageTests.cs @@ -0,0 +1,41 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Collections.Generic; +using System.Text; + +namespace AppInteractionTests.Tests +{ + [TestClass] + public class StartPageTests : BasePageTest + { + public override string NavigationName => "Start"; + + [TestMethod] + public void RendersButtonsAndText() + { + // Verifying start page text + Assert.AreEqual(1, TestHelper.GetElementsOfTypeWithContent("Text", "Welcome to").Count); + Assert.AreEqual(1, TestHelper.GetElementsOfTypeWithContent("Text", "This app contains").Count); + + // Verifying buttons exist + Assert.AreEqual(1, TestHelper.GetElementsOfTypeWithContent("Button", "Icon list").Count); + Assert.AreEqual(1, TestHelper.GetElementsOfTypeWithContent("Button", "Systemcolors").Count); + } + + [TestMethod] + public void VerifyIconNavigation() + { + TestHelper.InvokeButton("Icon list", 0); + + Assert.AreEqual("Icons", TestHelper.CurrentPageInNavigation()); + } + + [TestMethod] + public void VerifySystemColorsNavigation() + { + TestHelper.InvokeButton("Systemcolors", 0); + + Assert.AreEqual("Systemcolors", TestHelper.CurrentPageInNavigation()); + } + } +} diff --git a/tests/ControlTests/Assets/LockScreenLogo.scale-200.png b/tests/ControlTests/Assets/LockScreenLogo.scale-200.png new file mode 100644 index 0000000..735f57a Binary files /dev/null and b/tests/ControlTests/Assets/LockScreenLogo.scale-200.png differ diff --git a/tests/ControlTests/Assets/SplashScreen.scale-200.png b/tests/ControlTests/Assets/SplashScreen.scale-200.png new file mode 100644 index 0000000..023e7f1 Binary files /dev/null and b/tests/ControlTests/Assets/SplashScreen.scale-200.png differ diff --git a/tests/ControlTests/Assets/Square150x150Logo.scale-200.png b/tests/ControlTests/Assets/Square150x150Logo.scale-200.png new file mode 100644 index 0000000..af49fec Binary files /dev/null and b/tests/ControlTests/Assets/Square150x150Logo.scale-200.png differ diff --git a/tests/ControlTests/Assets/Square44x44Logo.scale-200.png b/tests/ControlTests/Assets/Square44x44Logo.scale-200.png new file mode 100644 index 0000000..ce342a2 Binary files /dev/null and b/tests/ControlTests/Assets/Square44x44Logo.scale-200.png differ diff --git a/tests/ControlTests/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/tests/ControlTests/Assets/Square44x44Logo.targetsize-24_altform-unplated.png new file mode 100644 index 0000000..f6c02ce Binary files /dev/null and b/tests/ControlTests/Assets/Square44x44Logo.targetsize-24_altform-unplated.png differ diff --git a/tests/ControlTests/Assets/StoreLogo.png b/tests/ControlTests/Assets/StoreLogo.png new file mode 100644 index 0000000..7385b56 Binary files /dev/null and b/tests/ControlTests/Assets/StoreLogo.png differ diff --git a/tests/ControlTests/Assets/Wide310x150Logo.scale-200.png b/tests/ControlTests/Assets/Wide310x150Logo.scale-200.png new file mode 100644 index 0000000..288995b Binary files /dev/null and b/tests/ControlTests/Assets/Wide310x150Logo.scale-200.png differ diff --git a/tests/ControlTests/CodeBehindTests/ConverterTests.cs b/tests/ControlTests/CodeBehindTests/ConverterTests.cs new file mode 100644 index 0000000..ed6d387 --- /dev/null +++ b/tests/ControlTests/CodeBehindTests/ConverterTests.cs @@ -0,0 +1,31 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using UWPResourcesGallery.Common; +using Windows.UI.Xaml; + +namespace ControlTests.CodeBehindTests +{ + [TestClass] + public class ConverterTests + { + [TestMethod] + public void BoolToVisibilityConverterTest() + { + var converter = new BoolToVisibilityConverter(); + + Assert.AreEqual(Visibility.Collapsed, converter.Convert(false, null, null, null)); + Assert.AreEqual(Visibility.Visible, converter.Convert(true, null, null, null)); + } + + + [TestMethod] + public void StringValueToVisibilityConverterTest() + { + var converter = new StringValueToVisibilityConverter(); + + Assert.AreEqual(Visibility.Collapsed, converter.Convert("", null, null, null)); + Assert.AreEqual(Visibility.Collapsed, converter.Convert(null, null, null, null)); + Assert.AreEqual(Visibility.Visible, converter.Convert("This is text", null, null, null)); + } + + } +} diff --git a/tests/ControlTests/ControlTests.csproj b/tests/ControlTests/ControlTests.csproj new file mode 100644 index 0000000..ff6e96e --- /dev/null +++ b/tests/ControlTests/ControlTests.csproj @@ -0,0 +1,189 @@ +<?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>{40FCF2F6-2D83-4D02-94FF-57F52A73B462}</ProjectGuid> + <OutputType>AppContainerExe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>ControlTests</RootNamespace> + <AssemblyName>ControlTests</AssemblyName> + <DefaultLanguage>en-US</DefaultLanguage> + <TargetPlatformIdentifier>UAP</TargetPlatformIdentifier> + <TargetPlatformVersion>10.0.18362.0</TargetPlatformVersion> + <TargetPlatformMinVersion>10.0.17134.0</TargetPlatformMinVersion> + <MinimumVisualStudioVersion>14</MinimumVisualStudioVersion> + <FileAlignment>512</FileAlignment> + <ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + <UnitTestPlatformVersion Condition="'$(UnitTestPlatformVersion)' == ''">$(VisualStudioVersion)</UnitTestPlatformVersion> + <AppxPackageSigningEnabled>True</AppxPackageSigningEnabled> + <PackageCertificateThumbprint>622592251BBCFE0F98B0753BA71132FA59A5AD41</PackageCertificateThumbprint> + <PackageCertificateKeyFile>ControlTests_TemporaryKey.pfx</PackageCertificateKeyFile> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> + <DebugSymbols>true</DebugSymbols> + <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'"> + <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> + <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'"> + <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> + <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'"> + <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> + <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'"> + <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> + <RestoreProjectStyle>PackageReference</RestoreProjectStyle> + </PropertyGroup> + <ItemGroup> + <SDKReference Include="TestPlatform.Universal, Version=$(UnitTestPlatformVersion)" /> + </ItemGroup> + <ItemGroup> + <Compile Include="CodeBehindTests\ConverterTests.cs" /> + <Compile Include="ControlsTestPage.xaml.cs"> + <DependentUpon>ControlsTestPage.xaml</DependentUpon> + </Compile> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="UITests\CodeSampleTests.cs" /> + <Compile Include="UITests\PageHeaderTests.cs" /> + <Compile Include="UnitTestApp.xaml.cs"> + <DependentUpon>UnitTestApp.xaml</DependentUpon> + </Compile> + <Compile Include="UITests\DualThemePresenterTests.cs" /> + </ItemGroup> + <ItemGroup> + <ApplicationDefinition Include="UnitTestApp.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </ApplicationDefinition> + </ItemGroup> + <ItemGroup> + <AppxManifest Include="Package.appxmanifest"> + <SubType>Designer</SubType> + </AppxManifest> + </ItemGroup> + <ItemGroup> + <Content Include="Properties\TestsDefault.rd.xml" /> + <Content Include="Assets\LockScreenLogo.scale-200.png" /> + <Content Include="Assets\SplashScreen.scale-200.png" /> + <Content Include="Assets\Square150x150Logo.scale-200.png" /> + <Content Include="Assets\Square44x44Logo.scale-200.png" /> + <Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" /> + <Content Include="Assets\StoreLogo.png" /> + <Content Include="Assets\Wide310x150Logo.scale-200.png" /> + </ItemGroup> + <ItemGroup> + <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform"> + <Version>6.2.9</Version> + </PackageReference> + <PackageReference Include="Microsoft.UI.Xaml"> + <Version>2.4.0-prerelease.191217001</Version> + </PackageReference> + <PackageReference Include="MSTest.TestAdapter"> + <Version>1.4.0</Version> + </PackageReference> + <PackageReference Include="MSTest.TestFramework"> + <Version>1.4.0</Version> + </PackageReference> + </ItemGroup> + <ItemGroup> + <Page Include="ControlsTestPage.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\src\UWPResourcesGallery\UWPResourcesGallery.csproj"> + <Project>{45c7f2fe-580e-4a64-bd5f-dff8e21f2ee6}</Project> + <Name>UWP Resources Gallery</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <None Include="ControlTests_TemporaryKey.pfx" /> + </ItemGroup> + <PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0' "> + <VisualStudioVersion>14.0</VisualStudioVersion> + </PropertyGroup> + <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.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> \ No newline at end of file diff --git a/tests/ControlTests/ControlTests_TemporaryKey.pfx b/tests/ControlTests/ControlTests_TemporaryKey.pfx new file mode 100644 index 0000000..50c147e Binary files /dev/null and b/tests/ControlTests/ControlTests_TemporaryKey.pfx differ diff --git a/tests/ControlTests/ControlsTestPage.xaml b/tests/ControlTests/ControlsTestPage.xaml new file mode 100644 index 0000000..cc2551d --- /dev/null +++ b/tests/ControlTests/ControlsTestPage.xaml @@ -0,0 +1,50 @@ +<Page + x:Class="ControlTests.ControlsTestPage" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:common="using:UWPResourcesGallery.Controls.Common" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:Windows10version1809="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract, 7)" + mc:Ignorable="d" + Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> + + <StackPanel Margin="8"> + <StackPanel> + <common:PageHeader x:Name="StandardPageHeader" + PageName="CommonControls Test page" + PageDescription="This is the test UI for common controls of the UWP Resources Gallery"/> + + <common:PageHeader x:Name="HeaderWithoutDescription" PageName="Header without description"/> + + </StackPanel> + + <StackPanel Margin="0,12,0,0"> + <TextBlock>DualThemePresenter</TextBlock> + <common:DualThemePresenter x:Name="StandardDualThemePresenter"> + <common:DualThemePresenter.LightThemeContent> + <TextBlock x:Name="LightThemeText">Light</TextBlock> + </common:DualThemePresenter.LightThemeContent> + + <common:DualThemePresenter.DarkThemeContent> + <TextBlock x:Name="DarkThemeText">Dark</TextBlock> + </common:DualThemePresenter.DarkThemeContent> + </common:DualThemePresenter> + </StackPanel> + + <StackPanel RequestedTheme="Dark" Margin="0,12,0,0"> + <TextBlock>CodeSample</TextBlock> + <common:CodeSample x:Name="CodeSampleNormal" > + <common:CodeSample.Code> + Code + </common:CodeSample.Code> + </common:CodeSample> + <common:CodeSample x:Name="CodeSampleWithHighlighting" IsSyntaxHighlightingEnabled="True"> + <common:CodeSample.Code> + <Code /> + </common:CodeSample.Code> + </common:CodeSample> + </StackPanel> + + </StackPanel> +</Page> diff --git a/tests/ControlTests/ControlsTestPage.xaml.cs b/tests/ControlTests/ControlsTestPage.xaml.cs new file mode 100644 index 0000000..e279f93 --- /dev/null +++ b/tests/ControlTests/ControlsTestPage.xaml.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.Foundation; +using Windows.Foundation.Collections; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Controls.Primitives; +using Windows.UI.Xaml.Data; +using Windows.UI.Xaml.Input; +using Windows.UI.Xaml.Media; +using Windows.UI.Xaml.Navigation; + +// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238 + +namespace ControlTests +{ + + + /// <summary> + /// An empty page that can be used on its own or navigated to within a Frame. + /// </summary> + public sealed partial class ControlsTestPage : Page + { + + public static ControlsTestPage Instance { get; private set; } + + public ControlsTestPage() + { + InitializeComponent(); + Instance = this; + } + } +} diff --git a/tests/ControlTests/Package.appxmanifest b/tests/ControlTests/Package.appxmanifest new file mode 100644 index 0000000..88b5f48 --- /dev/null +++ b/tests/ControlTests/Package.appxmanifest @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="utf-8"?> +<Package + xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" + xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" + xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" + IgnorableNamespaces="uap mp"> + + <Identity Name="084628a4-fc91-42a6-a0e7-b16750cf4571" + Publisher="CN=Marcel" + Version="1.0.0.0" /> + + <mp:PhoneIdentity PhoneProductId="084628a4-fc91-42a6-a0e7-b16750cf4571" PhonePublisherId="00000000-0000-0000-0000-000000000000"/> + + <Properties> + <DisplayName>App UI Tests</DisplayName> + <PublisherDisplayName>Marcel</PublisherDisplayName> + <Logo>Assets\StoreLogo.png</Logo> + </Properties> + + <Dependencies> + <TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" /> + </Dependencies> + + <Resources> + <Resource Language="x-generate" /> + </Resources> + <Applications> + <Application Id="vstest.executionengine.universal.App" + Executable="$targetnametoken$.exe" + EntryPoint="App_UI_Tests.App"> + <uap:VisualElements + DisplayName="App UI Tests" + Square150x150Logo="Assets\Square150x150Logo.png" + Square44x44Logo="Assets\Square44x44Logo.png" + Description="App UI Tests" + BackgroundColor="transparent"> + <uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/> + <uap:SplashScreen Image="Assets\SplashScreen.png" /> + </uap:VisualElements> + </Application> + </Applications> + <Capabilities> + <Capability Name="internetClientServer" /> + <Capability Name="privateNetworkClientServer" /> + </Capabilities> +</Package> \ No newline at end of file diff --git a/tests/ControlTests/Properties/AssemblyInfo.cs b/tests/ControlTests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..f7835e6 --- /dev/null +++ b/tests/ControlTests/Properties/AssemblyInfo.cs @@ -0,0 +1,18 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("ControlTests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ControlTests")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: AssemblyMetadata("TargetPlatform","UAP")] + +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: ComVisible(false)] \ No newline at end of file diff --git a/tests/ControlTests/Properties/TestsDefault.rd.xml b/tests/ControlTests/Properties/TestsDefault.rd.xml new file mode 100644 index 0000000..996a839 --- /dev/null +++ b/tests/ControlTests/Properties/TestsDefault.rd.xml @@ -0,0 +1,29 @@ +<!-- + This file contains Runtime Directives used by .NET Native. The defaults here are suitable for most + developers. However, you can modify these parameters to modify the behavior of the .NET Native + optimizer. + + Runtime Directives are documented at https://go.microsoft.com/fwlink/?LinkID=391919 + + To fully enable reflection for App1.MyClass and all of its public/private members + <Type Name="App1.MyClass" Dynamic="Required All"/> + + To enable dynamic creation of the specific instantiation of AppClass<T> over System.Int32 + <TypeInstantiation Name="App1.AppClass" Arguments="System.Int32" Activate="Required Public" /> + + Using the Namespace directive to apply reflection policy to all the types in a particular namespace + <Namespace Name="DataClasses.ViewModels" Serialize="All" /> +--> + +<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata"> + <Application> + <!-- + An Assembly element with Name="*Application*" applies to all assemblies in + the application package. The asterisks are not wildcards. + --> + <Assembly Name="*Application*" Dynamic="Required All" /> + <!-- Add your application specific runtime directives here. --> + + + </Application> +</Directives> \ No newline at end of file diff --git a/tests/ControlTests/UITests/CodeSampleTests.cs b/tests/ControlTests/UITests/CodeSampleTests.cs new file mode 100644 index 0000000..ca539da --- /dev/null +++ b/tests/ControlTests/UITests/CodeSampleTests.cs @@ -0,0 +1,74 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Microsoft.VisualStudio.TestTools.UnitTesting.AppContainer; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UWPResourcesGallery.Controls.Common; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Automation.Peers; +using Windows.UI.Xaml.Automation.Provider; +using Windows.UI.Xaml; +using Windows.UI.Core; +using Windows.UI.ViewManagement; + +namespace ControlTests.UITests +{ + [TestClass] + public class CodeSampleTests + { + + [UITestMethod] + public void VerifyRenderedText() + { + var codeSampleNormal = (CodeSample)ControlsTestPage.Instance.FindName("CodeSampleNormal"); + var codeText = (RichTextBlock)codeSampleNormal.FindName("CodeBlock"); + codeText.SelectAll(); + + Assert.AreEqual("Code", codeText.SelectedText); + + var codeSampleHighlightingEnabled = (CodeSample)ControlsTestPage.Instance.FindName("CodeSampleWithHighlighting"); + codeText = (RichTextBlock)codeSampleHighlightingEnabled.FindName("CodeBlock"); + codeText.SelectAll(); + + Assert.AreEqual("<Code />", codeText.SelectedText); + } + + [UITestMethod] + public void CopiesTextCorrectly() + { + try + { + var codeSampleNormal = (CodeSample)ControlsTestPage.Instance.FindName("CodeSampleNormal"); + var copyButton = new ButtonAutomationPeer((Button)codeSampleNormal.FindName("CopyButton")); + + copyButton.Invoke(); + Assert.AreEqual("Code", GetClipBoardText()); + + var codeSampleHighlightingEnabled = (CodeSample)ControlsTestPage.Instance.FindName("CodeSampleWithHighlighting"); + copyButton = new ButtonAutomationPeer((Button)codeSampleHighlightingEnabled.FindName("CopyButton")); + + copyButton.Invoke(); + + Assert.AreEqual("<Code />", GetClipBoardText()); + }catch (UnauthorizedAccessException) + { + // Pasting to clipboard is not allowed while app is in background +#pragma warning disable CA1303 // Do not pass literals as localized parameters + Console.WriteLine("Test CopiesTextCorrectly was not run as app is not in foreground"); +#pragma warning restore CA1303 // Do not pass literals as localized parameters + } + } + + private static string GetClipBoardText(){ + var clipBoard = Windows.ApplicationModel.DataTransfer.Clipboard.GetContent(); + var task = clipBoard.GetTextAsync().AsTask(); + try + { + task.RunSynchronously(); + } catch(InvalidOperationException) { } + return task.Result; + } + } +} diff --git a/tests/ControlTests/UITests/DualThemePresenterTests.cs b/tests/ControlTests/UITests/DualThemePresenterTests.cs new file mode 100644 index 0000000..32300ad --- /dev/null +++ b/tests/ControlTests/UITests/DualThemePresenterTests.cs @@ -0,0 +1,36 @@ + +using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Microsoft.VisualStudio.TestTools.UnitTesting.AppContainer; +using UWPResourcesGallery.Controls.Common; +using Windows.UI; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Media; + +namespace ControlTests.UITests +{ + [TestClass] + public class DualThemePresenterTests + { + [UITestMethod] + public void RendersContent() + { + var dualThemePresenter = (DualThemePresenter)ControlsTestPage.Instance.FindName("StandardDualThemePresenter"); + // Test that all orientations render the text with the right font + foreach (var displayMode in Enum.GetValues(typeof(Orientation))) + { + dualThemePresenter.ContentOrientation = (Orientation)displayMode; + dualThemePresenter.UpdateLayout(); + var lightTextBox = (TextBlock)ControlsTestPage.Instance.FindName("LightThemeText"); + Assert.IsNotNull(lightTextBox); + Assert.AreEqual("Light", lightTextBox.Text); + Assert.AreEqual(Colors.Black, (lightTextBox.Foreground as SolidColorBrush).Color); + + var darkTextBox = (TextBlock)ControlsTestPage.Instance.FindName("DarkThemeText"); + Assert.IsNotNull(darkTextBox); + Assert.AreEqual("Dark", darkTextBox.Text); + Assert.AreEqual(Colors.White, (darkTextBox.Foreground as SolidColorBrush).Color); + } + } + } +} diff --git a/tests/ControlTests/UITests/PageHeaderTests.cs b/tests/ControlTests/UITests/PageHeaderTests.cs new file mode 100644 index 0000000..d6a3bec --- /dev/null +++ b/tests/ControlTests/UITests/PageHeaderTests.cs @@ -0,0 +1,71 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Microsoft.VisualStudio.TestTools.UnitTesting.AppContainer; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UWPResourcesGallery.Controls.Common; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Automation; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Media; + +namespace ControlTests.UITests +{ + [TestClass] + public class PageHeaderTests + { + private static readonly string[] HeaderTexts = new string[] { "CommonControls Test page" + , "This is the test UI for common controls of the UWP Resources Gallery" }; + + [UITestMethod] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1307:Specify StringComparison", Justification = "Testing just english strings here")] + public void RendersCorrectly() + { + var pageHeader = (PageHeader)ControlsTestPage.Instance.FindName("StandardPageHeader"); + Assert.IsNotNull(pageHeader); + + // All entries false since default(bool) = false + bool[] foundValues = new bool[HeaderTexts.Length]; + + var innerContainer = VisualTreeHelper.GetChild(pageHeader, 0); + int childCount = VisualTreeHelper.GetChildrenCount(innerContainer); + for (int childIndex = 0; childIndex < childCount; childIndex++) + { + var child = (TextBlock)VisualTreeHelper.GetChild(innerContainer, childIndex); + if (child == null) + { + continue; + } + for (int textIndex = 0; textIndex < HeaderTexts.Length; textIndex++) + { + if (child.Text.Equals(HeaderTexts[textIndex])) + { + // Verify that the heading level is correct for the given text + // HeadingLevel starts at 1 so we need to add 1 to the current index + Assert.AreEqual(textIndex + 1, (int)child.GetValue(AutomationProperties.HeadingLevelProperty)); + foundValues[textIndex] = true; + } + } + } + + // Verify all found + for (int i = 0; i < foundValues.Length; i++) + { + Assert.IsTrue(foundValues[i]); + } + } + + [UITestMethod] + public void SizingIsCorrectly() + { + var pageHeader = (PageHeader)ControlsTestPage.Instance.FindName("StandardPageHeader"); + var pageHeaderWithoutDescriptions = (PageHeader)ControlsTestPage.Instance.FindName("HeaderWithoutDescription"); + + Assert.IsTrue(pageHeader.ActualHeight > pageHeaderWithoutDescriptions.ActualHeight + 14); + } + + } +} diff --git a/tests/ControlTests/UnitTestApp.xaml b/tests/ControlTests/UnitTestApp.xaml new file mode 100644 index 0000000..aca87ab --- /dev/null +++ b/tests/ControlTests/UnitTestApp.xaml @@ -0,0 +1,9 @@ +<Application + x:Class="ControlTests.App" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="using:ControlTests"> + <Application.Resources> + <XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" /> + </Application.Resources> +</Application> diff --git a/tests/ControlTests/UnitTestApp.xaml.cs b/tests/ControlTests/UnitTestApp.xaml.cs new file mode 100644 index 0000000..756f6ca --- /dev/null +++ b/tests/ControlTests/UnitTestApp.xaml.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.ApplicationModel; +using Windows.ApplicationModel.Activation; +using Windows.Foundation; +using Windows.Foundation.Collections; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Controls.Primitives; +using Windows.UI.Xaml.Data; +using Windows.UI.Xaml.Input; +using Windows.UI.Xaml.Media; +using Windows.UI.Xaml.Navigation; + +namespace ControlTests +{ + /// <summary> + /// Provides application-specific behavior to supplement the default Application class. + /// </summary> + sealed partial class App : Application + { + /// <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(); + Suspending += OnSuspending; + } + + /// <summary> + /// Invoked when the application is launched normally by the end user. Other entry points + /// will be used such as when the application is launched to open a specific file. + /// </summary> + /// <param name="e">Details about the launch request and process.</param> + protected override void OnLaunched(LaunchActivatedEventArgs e) + { + // Do not repeat app initialization when the Window already has content, + // just ensure that the window is active + if (!(Window.Current.Content is Frame rootFrame)) + { + // Create a Frame to act as the navigation context and navigate to the first page + rootFrame = new Frame(); + + rootFrame.NavigationFailed += OnNavigationFailed; + + // Place the frame in the current Window + Window.Current.Content = rootFrame; + } + + Microsoft.VisualStudio.TestPlatform.TestExecutor.UnitTestClient.CreateDefaultUI(); + 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 + rootFrame.Navigate(typeof(ControlsTestPage), e?.Arguments); + } + // Ensure the current window is active + Window.Current.Activate(); + + Microsoft.VisualStudio.TestPlatform.TestExecutor.UnitTestClient.Run(e?.Arguments); + } + + /// <summary> + /// Invoked when AppNavigation to a certain page fails + /// </summary> + /// <param name="sender">The Frame which failed navigation</param> + /// <param name="e">Details about the navigation failure</param> + void OnNavigationFailed(object sender, NavigationFailedEventArgs e) + { + throw new Exception("Failed to load Page " + e.SourcePageType.FullName); + } + + /// <summary> + /// Invoked when application execution is being suspended. Application state is saved + /// without knowing whether the application will be terminated or resumed with the contents + /// of memory still intact. + /// </summary> + /// <param name="sender">The source of the suspend request.</param> + /// <param name="e">Details about the suspend request.</param> + private void OnSuspending(object sender, SuspendingEventArgs e) + { + var deferral = e.SuspendingOperation.GetDeferral(); + deferral.Complete(); + } + } +} diff --git a/tests/ResoureModelTests/Assets/LockScreenLogo.scale-200.png b/tests/ResoureModelTests/Assets/LockScreenLogo.scale-200.png new file mode 100644 index 0000000..735f57a Binary files /dev/null and b/tests/ResoureModelTests/Assets/LockScreenLogo.scale-200.png differ diff --git a/tests/ResoureModelTests/Assets/SplashScreen.scale-200.png b/tests/ResoureModelTests/Assets/SplashScreen.scale-200.png new file mode 100644 index 0000000..023e7f1 Binary files /dev/null and b/tests/ResoureModelTests/Assets/SplashScreen.scale-200.png differ diff --git a/tests/ResoureModelTests/Assets/Square150x150Logo.scale-200.png b/tests/ResoureModelTests/Assets/Square150x150Logo.scale-200.png new file mode 100644 index 0000000..af49fec Binary files /dev/null and b/tests/ResoureModelTests/Assets/Square150x150Logo.scale-200.png differ diff --git a/tests/ResoureModelTests/Assets/Square44x44Logo.scale-200.png b/tests/ResoureModelTests/Assets/Square44x44Logo.scale-200.png new file mode 100644 index 0000000..ce342a2 Binary files /dev/null and b/tests/ResoureModelTests/Assets/Square44x44Logo.scale-200.png differ diff --git a/tests/ResoureModelTests/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/tests/ResoureModelTests/Assets/Square44x44Logo.targetsize-24_altform-unplated.png new file mode 100644 index 0000000..f6c02ce Binary files /dev/null and b/tests/ResoureModelTests/Assets/Square44x44Logo.targetsize-24_altform-unplated.png differ diff --git a/tests/ResoureModelTests/Assets/StoreLogo.png b/tests/ResoureModelTests/Assets/StoreLogo.png new file mode 100644 index 0000000..7385b56 Binary files /dev/null and b/tests/ResoureModelTests/Assets/StoreLogo.png differ diff --git a/tests/ResoureModelTests/Assets/Wide310x150Logo.scale-200.png b/tests/ResoureModelTests/Assets/Wide310x150Logo.scale-200.png new file mode 100644 index 0000000..288995b Binary files /dev/null and b/tests/ResoureModelTests/Assets/Wide310x150Logo.scale-200.png differ diff --git a/tests/ResoureModelTests/Assets/testdata.json b/tests/ResoureModelTests/Assets/testdata.json new file mode 100644 index 0000000..5d5d6bb --- /dev/null +++ b/tests/ResoureModelTests/Assets/testdata.json @@ -0,0 +1,9 @@ +{ + "strings": [ + "Item0", + "Item1", + "Item2", + "Item3", + "Item4" + ] +} \ No newline at end of file diff --git a/tests/ResoureModelTests/BrushSourceTests.cs b/tests/ResoureModelTests/BrushSourceTests.cs new file mode 100644 index 0000000..6e83e0c --- /dev/null +++ b/tests/ResoureModelTests/BrushSourceTests.cs @@ -0,0 +1,41 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UWPResourcesGallery.Model.Brush; +using Windows.ApplicationModel.Core; + +namespace ResoureModelTests +{ + [TestClass] + public class BrushSourceTests + { + [ClassInitialize] + public static async Task ClassInitialize(TestContext context) + { + if (context is null) + { + throw new ArgumentNullException(nameof(context)); + } + + context.WriteLine("Load theme resources"); + // We need the UI thread since we use the XAML loader + await CoreApplication.MainView.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Low, () => + { + SystemColorsItemSource.LoadSystemColors(); + }); + } + + [TestMethod] + public void VerifyItemsNotNull() + { + Assert.IsTrue(SystemColorsItemSource.Items.Count > 0); + for (int i = 0; i < SystemColorsItemSource.Items.Count; i++) + { + Assert.IsNotNull(SystemColorsItemSource.Items[i]); + } + } + } +} diff --git a/tests/ResoureModelTests/GenericItemsSourceTests.cs b/tests/ResoureModelTests/GenericItemsSourceTests.cs new file mode 100644 index 0000000..3c637a9 --- /dev/null +++ b/tests/ResoureModelTests/GenericItemsSourceTests.cs @@ -0,0 +1,73 @@ + +using System; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using UWPResourcesGallery.Model; + +namespace ResoureModelTests +{ + + [TestClass] + public class GenericItemsSourceTests : GenericItemsSource<FilterableString> + { + [ClassInitialize] + public static void ClassSetup(TestContext context) + { + context?.WriteLine("Started loading test setup"); + var file = GetJSONFile("/Assets/testdata.json"); + + foreach (var element in file["strings"].GetArray()) + { + Items.Add(new FilterableString(element.GetString())); + } + context?.WriteLine("Finished test setup"); + } + + [TestMethod] + public void LoadsDataCorrectly() + { + Assert.IsTrue(Items.Count > 0); + + for (int i = 0; i < Items.Count; i++) + { + Assert.AreEqual("Item" + i, Items[i].Value); + } + } + + [TestMethod] + public void FilterWorksCorrectly() + { + Assert.IsTrue(Items.Count > 0); + + Filter(""); + + for (int i = 0; i < Items.Count; i++) + { + Filter("Item" + i); + Assert.AreEqual(1, FilteredItems.Count); + Assert.AreEqual("Item" + i, FilteredItems[0].Value); + + Filter("Item " + i); + Assert.AreEqual(1, FilteredItems.Count); + Assert.AreEqual("Item" + i, FilteredItems[0].Value); + } + + } + } + + public class FilterableString : IFilterable + { + public string Value { get; set; } + + public FilterableString(string value) + { + Value = value; + } + + public bool FitsFilter(string[] keywords) + { + return keywords.All(key => Value.Contains(key,StringComparison.InvariantCultureIgnoreCase)); + } + } +} diff --git a/tests/ResoureModelTests/IconSourceTests.cs b/tests/ResoureModelTests/IconSourceTests.cs new file mode 100644 index 0000000..e6c55ae --- /dev/null +++ b/tests/ResoureModelTests/IconSourceTests.cs @@ -0,0 +1,30 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UWPResourcesGallery.Model.Icon; + +namespace ResoureModelTests +{ + [TestClass] + public class IconSourceTests + { + [ClassInitialize] + public static void ClassInitialize(TestContext context) + { + IconItemSource.LoadIconsList(); + } + + [TestMethod] + public void VerifyItemsNotNull() + { + Assert.IsTrue(IconItemSource.Items.Count > 0); + for (int i = 0; i < IconItemSource.Items.Count; i++) + { + Assert.IsNotNull(IconItemSource.Items[i]); + } + } + } +} diff --git a/tests/ResoureModelTests/Package.appxmanifest b/tests/ResoureModelTests/Package.appxmanifest new file mode 100644 index 0000000..7968640 --- /dev/null +++ b/tests/ResoureModelTests/Package.appxmanifest @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="utf-8"?> +<Package + xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" + xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" + xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" + IgnorableNamespaces="uap mp"> + + <Identity Name="65f43dea-85d8-45f1-ac64-f863dbd8159c" + Publisher="CN=Marcel" + Version="1.0.0.0" /> + + <mp:PhoneIdentity PhoneProductId="65f43dea-85d8-45f1-ac64-f863dbd8159c" PhonePublisherId="00000000-0000-0000-0000-000000000000"/> + + <Properties> + <DisplayName>ResoureModel Tests</DisplayName> + <PublisherDisplayName>Marcel</PublisherDisplayName> + <Logo>Assets\StoreLogo.png</Logo> + </Properties> + + <Dependencies> + <TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" /> + </Dependencies> + + <Resources> + <Resource Language="x-generate" /> + </Resources> + <Applications> + <Application Id="vstest.executionengine.universal.App" + Executable="$targetnametoken$.exe" + EntryPoint="ResoureModelTests.App"> + <uap:VisualElements + DisplayName="ResoureModelTests" + Square150x150Logo="Assets\Square150x150Logo.png" + Square44x44Logo="Assets\Square44x44Logo.png" + Description="ResoureModel Tests" + BackgroundColor="transparent"> + <uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/> + <uap:SplashScreen Image="Assets\SplashScreen.png" /> + </uap:VisualElements> + </Application> + </Applications> + <Capabilities> + <Capability Name="internetClientServer" /> + <Capability Name="privateNetworkClientServer" /> + </Capabilities> +</Package> \ No newline at end of file diff --git a/tests/ResoureModelTests/Properties/AssemblyInfo.cs b/tests/ResoureModelTests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..d9d5364 --- /dev/null +++ b/tests/ResoureModelTests/Properties/AssemblyInfo.cs @@ -0,0 +1,18 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("ResoureModelTests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ResoureModelTests")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: AssemblyMetadata("TargetPlatform","UAP")] + +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: ComVisible(false)] \ No newline at end of file diff --git a/tests/ResoureModelTests/Properties/Default.rd.xml b/tests/ResoureModelTests/Properties/Default.rd.xml new file mode 100644 index 0000000..996a839 --- /dev/null +++ b/tests/ResoureModelTests/Properties/Default.rd.xml @@ -0,0 +1,29 @@ +<!-- + This file contains Runtime Directives used by .NET Native. The defaults here are suitable for most + developers. However, you can modify these parameters to modify the behavior of the .NET Native + optimizer. + + Runtime Directives are documented at https://go.microsoft.com/fwlink/?LinkID=391919 + + To fully enable reflection for App1.MyClass and all of its public/private members + <Type Name="App1.MyClass" Dynamic="Required All"/> + + To enable dynamic creation of the specific instantiation of AppClass<T> over System.Int32 + <TypeInstantiation Name="App1.AppClass" Arguments="System.Int32" Activate="Required Public" /> + + Using the Namespace directive to apply reflection policy to all the types in a particular namespace + <Namespace Name="DataClasses.ViewModels" Serialize="All" /> +--> + +<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata"> + <Application> + <!-- + An Assembly element with Name="*Application*" applies to all assemblies in + the application package. The asterisks are not wildcards. + --> + <Assembly Name="*Application*" Dynamic="Required All" /> + <!-- Add your application specific runtime directives here. --> + + + </Application> +</Directives> \ No newline at end of file diff --git a/tests/ResoureModelTests/ResoureModelTests.csproj b/tests/ResoureModelTests/ResoureModelTests.csproj new file mode 100644 index 0000000..a0ab811 --- /dev/null +++ b/tests/ResoureModelTests/ResoureModelTests.csproj @@ -0,0 +1,179 @@ +<?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>{C2B9B471-9028-46C3-A04E-37DD4B96D059}</ProjectGuid> + <OutputType>AppContainerExe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>ResoureModelTests</RootNamespace> + <AssemblyName>ResoureModelTests</AssemblyName> + <DefaultLanguage>en-US</DefaultLanguage> + <TargetPlatformIdentifier>UAP</TargetPlatformIdentifier> + <TargetPlatformVersion>10.0.18362.0</TargetPlatformVersion> + <TargetPlatformMinVersion>10.0.17134.0</TargetPlatformMinVersion> + <MinimumVisualStudioVersion>14</MinimumVisualStudioVersion> + <FileAlignment>512</FileAlignment> + <ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> + <UnitTestPlatformVersion Condition="'$(UnitTestPlatformVersion)' == ''">$(VisualStudioVersion)</UnitTestPlatformVersion> + <AppxPackageSigningEnabled>True</AppxPackageSigningEnabled> + <PackageCertificateThumbprint>09C04C3BF99ACF46B726476659E226EC41A653CB</PackageCertificateThumbprint> + <PackageCertificateKeyFile>ResoureModelTests_TemporaryKey.pfx</PackageCertificateKeyFile> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> + <DebugSymbols>true</DebugSymbols> + <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'"> + <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> + <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'"> + <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> + <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'"> + <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> + <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'"> + <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> + <RestoreProjectStyle>PackageReference</RestoreProjectStyle> + </PropertyGroup> + <ItemGroup> + <SDKReference Include="TestPlatform.Universal, Version=$(UnitTestPlatformVersion)" /> + </ItemGroup> + <ItemGroup> + <Compile Include="BrushSourceTests.cs" /> + <Compile Include="IconSourceTests.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="UnitTestApp.xaml.cs"> + <DependentUpon>UnitTestApp.xaml</DependentUpon> + </Compile> + <Compile Include="GenericItemsSourceTests.cs" /> + </ItemGroup> + <ItemGroup> + <ApplicationDefinition Include="UnitTestApp.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </ApplicationDefinition> + </ItemGroup> + <ItemGroup> + <AppxManifest Include="Package.appxmanifest"> + <SubType>Designer</SubType> + </AppxManifest> + </ItemGroup> + <ItemGroup> + <Content Include="Properties\Default.rd.xml" /> + <Content Include="Assets\LockScreenLogo.scale-200.png" /> + <Content Include="Assets\SplashScreen.scale-200.png" /> + <Content Include="Assets\Square150x150Logo.scale-200.png" /> + <Content Include="Assets\Square44x44Logo.scale-200.png" /> + <Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" /> + <Content Include="Assets\StoreLogo.png" /> + <Content Include="Assets\Wide310x150Logo.scale-200.png" /> + </ItemGroup> + <ItemGroup> + <PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform"> + <Version>6.2.9</Version> + </PackageReference> + <PackageReference Include="MSTest.TestAdapter"> + <Version>1.4.0</Version> + </PackageReference> + <PackageReference Include="MSTest.TestFramework"> + <Version>1.4.0</Version> + </PackageReference> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\src\ResourceModel\ResourceModel.csproj"> + <Project>{957b1e0e-d863-41e3-8042-7fac37a512dd}</Project> + <Name>ResourceModel</Name> + </ProjectReference> + </ItemGroup> + <ItemGroup> + <Content Include="Assets\testdata.json" /> + </ItemGroup> + <ItemGroup> + <None Include="ResoureModelTests_TemporaryKey.pfx" /> + </ItemGroup> + <PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0' "> + <VisualStudioVersion>14.0</VisualStudioVersion> + </PropertyGroup> + <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.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> \ No newline at end of file diff --git a/tests/ResoureModelTests/ResoureModelTests_TemporaryKey.pfx b/tests/ResoureModelTests/ResoureModelTests_TemporaryKey.pfx new file mode 100644 index 0000000..4e0984f Binary files /dev/null and b/tests/ResoureModelTests/ResoureModelTests_TemporaryKey.pfx differ diff --git a/tests/ResoureModelTests/UnitTestApp.xaml b/tests/ResoureModelTests/UnitTestApp.xaml new file mode 100644 index 0000000..1ca311a --- /dev/null +++ b/tests/ResoureModelTests/UnitTestApp.xaml @@ -0,0 +1,7 @@ +<Application + x:Class="ResoureModelTests.App" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="using:ResoureModelTests"> + +</Application> diff --git a/tests/ResoureModelTests/UnitTestApp.xaml.cs b/tests/ResoureModelTests/UnitTestApp.xaml.cs new file mode 100644 index 0000000..ec7f802 --- /dev/null +++ b/tests/ResoureModelTests/UnitTestApp.xaml.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.ApplicationModel; +using Windows.ApplicationModel.Activation; +using Windows.Foundation; +using Windows.Foundation.Collections; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Controls.Primitives; +using Windows.UI.Xaml.Data; +using Windows.UI.Xaml.Input; +using Windows.UI.Xaml.Media; +using Windows.UI.Xaml.Navigation; + +namespace ResoureModelTests +{ + /// <summary> + /// Provides application-specific behavior to supplement the default Application class. + /// </summary> + sealed partial class App : Application + { + /// <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(); + Suspending += OnSuspending; + } + + /// <summary> + /// Invoked when the application is launched normally by the end user. Other entry points + /// will be used such as when the application is launched to open a specific file. + /// </summary> + /// <param name="e">Details about the launch request and process.</param> + protected override void OnLaunched(LaunchActivatedEventArgs e) + { +#if DEBUG + if (System.Diagnostics.Debugger.IsAttached) + { + DebugSettings.EnableFrameRateCounter = true; + } +#endif + // Do not repeat app initialization when the Window already has content, + // just ensure that the window is active + if (!(Window.Current.Content is Frame rootFrame)) + { + // Create a Frame to act as the navigation context and navigate to the first page + rootFrame = new Frame(); + + rootFrame.NavigationFailed += OnNavigationFailed; + + // Place the frame in the current Window + Window.Current.Content = rootFrame; + } + + Microsoft.VisualStudio.TestPlatform.TestExecutor.UnitTestClient.CreateDefaultUI(); + + // Ensure the current window is active + Window.Current.Activate(); + + Microsoft.VisualStudio.TestPlatform.TestExecutor.UnitTestClient.Run(e.Arguments); + } + + /// <summary> + /// Invoked when Navigation to a certain page fails + /// </summary> + /// <param name="sender">The Frame which failed navigation</param> + /// <param name="e">Details about the navigation failure</param> + void OnNavigationFailed(object sender, NavigationFailedEventArgs e) + { + throw new Exception("Failed to load Page " + e.SourcePageType.FullName); + } + + /// <summary> + /// Invoked when application execution is being suspended. Application state is saved + /// without knowing whether the application will be terminated or resumed with the contents + /// of memory still intact. + /// </summary> + /// <param name="sender">The source of the suspend request.</param> + /// <param name="e">Details about the suspend request.</param> + private void OnSuspending(object sender, SuspendingEventArgs e) + { + var deferral = e.SuspendingOperation.GetDeferral(); + deferral.Complete(); + } + } +}