├── .gitattributes
├── .github
└── workflows
│ └── dotnet-desktop.yml
├── .gitignore
├── LICENSE
├── Logo.png
├── README.md
├── WindowsAppSDKGallery.sln
└── WindowsAppSDKGallery
├── App.xaml
├── App.xaml.cs
├── Assets
├── AdaptiveIntroVideo.mp4
├── Icon.ico
├── LargeTile.scale-100.png
├── LargeTile.scale-125.png
├── LargeTile.scale-150.png
├── LargeTile.scale-200.png
├── LargeTile.scale-400.png
├── LockScreenLogo.scale-200.png
├── SmallTile.scale-100.png
├── SmallTile.scale-125.png
├── SmallTile.scale-150.png
├── SmallTile.scale-200.png
├── SmallTile.scale-400.png
├── SplashScreen.scale-100.png
├── SplashScreen.scale-125.png
├── SplashScreen.scale-150.png
├── SplashScreen.scale-200.png
├── SplashScreen.scale-400.png
├── Square150x150Logo.scale-100.png
├── Square150x150Logo.scale-125.png
├── Square150x150Logo.scale-150.png
├── Square150x150Logo.scale-200.png
├── Square150x150Logo.scale-400.png
├── Square44x44Logo.altform-lightunplated_targetsize-16.png
├── Square44x44Logo.altform-lightunplated_targetsize-24.png
├── Square44x44Logo.altform-lightunplated_targetsize-256.png
├── Square44x44Logo.altform-lightunplated_targetsize-32.png
├── Square44x44Logo.altform-lightunplated_targetsize-48.png
├── Square44x44Logo.altform-unplated_targetsize-16.png
├── Square44x44Logo.altform-unplated_targetsize-256.png
├── Square44x44Logo.altform-unplated_targetsize-32.png
├── Square44x44Logo.altform-unplated_targetsize-48.png
├── Square44x44Logo.scale-100.png
├── Square44x44Logo.scale-125.png
├── Square44x44Logo.scale-150.png
├── Square44x44Logo.scale-200.png
├── Square44x44Logo.scale-400.png
├── Square44x44Logo.targetsize-16.png
├── Square44x44Logo.targetsize-24.png
├── Square44x44Logo.targetsize-24_altform-unplated.png
├── Square44x44Logo.targetsize-256.png
├── Square44x44Logo.targetsize-32.png
├── Square44x44Logo.targetsize-48.png
├── StoreLogo.backup.png
├── StoreLogo.scale-100.png
├── StoreLogo.scale-125.png
├── StoreLogo.scale-150.png
├── StoreLogo.scale-200.png
├── StoreLogo.scale-400.png
├── Wide310x150Logo.scale-100.png
├── Wide310x150Logo.scale-125.png
├── Wide310x150Logo.scale-150.png
├── Wide310x150Logo.scale-200.png
├── Wide310x150Logo.scale-400.png
└── chimes.wav
├── Controls
├── ApiExample.xaml
├── ApiExample.xaml.cs
├── ObjectControl.xaml
├── ObjectControl.xaml.cs
├── ObjectControlHelpers
│ ├── BaseObjectControl.xaml
│ ├── BaseObjectControl.xaml.cs
│ ├── EnumObjectControl.xaml
│ ├── EnumObjectControl.xaml.cs
│ ├── ExceptionObjectControl.xaml
│ ├── ExceptionObjectControl.xaml.cs
│ ├── ListObjectControl.xaml
│ ├── ListObjectControl.xaml.cs
│ ├── NullObjectControl.xaml
│ └── NullObjectControl.xaml.cs
├── SampleExample.xaml
└── SampleExample.xaml.cs
├── Converters
└── NotNullToVisibilityConverter.cs
├── DataModel
└── SampleInfoDataSource.cs
├── Helpers
├── AssetsHelper.cs
├── DesktopAppHelper.cs
├── MessageDialogHelpers.cs
├── NativeMethods.cs
└── WindowHelper.cs
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── Package.appxmanifest
├── Pages
├── SamplePage.xaml
└── SamplePage.xaml.cs
├── Properties
└── launchSettings.json
├── SamplePages
├── AppLifecycle
│ ├── ActivationPage.xaml
│ ├── ActivationPage.xaml.cs
│ ├── ManageInstancesPage.xaml
│ ├── ManageInstancesPage.xaml.cs
│ ├── PowerManagerPage.xaml
│ └── PowerManagerPage.xaml.cs
├── AppWindowSamples
│ ├── BasicAppWindowSamples.xaml
│ └── BasicAppWindowSamples.xaml.cs
├── AuthSamples
│ ├── CredentialLockerPage.xaml
│ └── CredentialLockerPage.xaml.cs
├── DialogSamples
│ ├── MessageDialogPage.xaml
│ └── MessageDialogPage.xaml.cs
├── MediaSamples
│ ├── PlaySoundsPage.xaml
│ ├── PlaySoundsPage.xaml.cs
│ ├── PlayVideosPage.xaml
│ └── PlayVideosPage.xaml.cs
├── NotificationsSamples
│ ├── ToastNotificationPage.xaml
│ └── ToastNotificationPage.xaml.cs
└── ShareSamples
│ ├── DataTransferManagerPage.xaml
│ └── DataTransferManagerPage.xaml.cs
├── WindowsAppSDKGallery.csproj
└── app.manifest
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/.github/workflows/dotnet-desktop.yml:
--------------------------------------------------------------------------------
1 | # This workflow uses actions that are not certified by GitHub.
2 | # They are provided by a third-party and are governed by
3 | # separate terms of service, privacy policy, and support
4 | # documentation.
5 |
6 | # This workflow will build, test, sign and package a WPF or Windows Forms desktop application
7 | # built on .NET Core.
8 | # To learn how to migrate your existing application to .NET Core,
9 | # refer to https://docs.microsoft.com/en-us/dotnet/desktop-wpf/migration/convert-project-from-net-framework
10 | #
11 | # To configure this workflow:
12 | #
13 | # 1. Configure environment variables
14 | # GitHub sets default environment variables for every workflow run.
15 | # Replace the variables relative to your project in the "env" section below.
16 | #
17 | # 2. Signing
18 | # Generate a signing certificate in the Windows Application
19 | # Packaging Project or add an existing signing certificate to the project.
20 | # Next, use PowerShell to encode the .pfx file using Base64 encoding
21 | # by running the following Powershell script to generate the output string:
22 | #
23 | # $pfx_cert = Get-Content '.\SigningCertificate.pfx' -Encoding Byte
24 | # [System.Convert]::ToBase64String($pfx_cert) | Out-File 'SigningCertificate_Encoded.txt'
25 | #
26 | # Open the output file, SigningCertificate_Encoded.txt, and copy the
27 | # string inside. Then, add the string to the repo as a GitHub secret
28 | # and name it "Base64_Encoded_Pfx."
29 | # For more information on how to configure your signing certificate for
30 | # this workflow, refer to https://github.com/microsoft/github-actions-for-desktop-apps#signing
31 | #
32 | # Finally, add the signing certificate password to the repo as a secret and name it "Pfx_Key".
33 | # See "Build the Windows Application Packaging project" below to see how the secret is used.
34 | #
35 | # For more information on GitHub Actions, refer to https://github.com/features/actions
36 | # For a complete CI/CD sample to get started with GitHub Action workflows for Desktop Applications,
37 | # refer to https://github.com/microsoft/github-actions-for-desktop-apps
38 |
39 | name: .NET Core Desktop
40 |
41 | on:
42 | push:
43 | branches: [ main ]
44 | pull_request:
45 | branches: [ main ]
46 | workflow_dispatch:
47 |
48 | jobs:
49 |
50 | build:
51 |
52 | strategy:
53 | matrix:
54 | configuration: [Release]
55 |
56 | runs-on: windows-latest # For a list of available runner types, refer to
57 | # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
58 |
59 | env:
60 | Solution_Name: WindowsAppSDKGallery # Replace with your solution name, i.e. MyWpfApp.sln.
61 | Project_Directory: WindowsAppSDKGallery
62 |
63 | steps:
64 | - name: Checkout
65 | uses: actions/checkout@v2
66 | with:
67 | fetch-depth: 0
68 |
69 | - name: File Regex Replace
70 | uses: mingjun97/file-regex-replace@v1
71 | with:
72 | regex: 'Version="([0-9\.]*)"'
73 | replacement: 'Version="0.${{ github.run_number }}.${{ github.run_attempt }}.0"'
74 | include: Package.appxmanifest
75 |
76 |
77 | # Install the .NET Core workload
78 | - name: Install .NET Core
79 | uses: actions/setup-dotnet@v1
80 | with:
81 | dotnet-version: 5.0.x
82 |
83 | # Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
84 | - name: Setup MSBuild.exe
85 | uses: microsoft/setup-msbuild@v1.0.2
86 |
87 |
88 | # Restore the application to populate the obj folder with RuntimeIdentifiers
89 | - name: Restore the application
90 | run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration
91 | env:
92 | Configuration: ${{ matrix.configuration }}
93 |
94 | # Decode the base 64 encoded pfx and save the Signing_Certificate
95 | - name: Decode the pfx
96 | run: |
97 | $pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.Base64_Encoded_Pfx }}")
98 | $certificatePath = Join-Path -Path $env:Project_Directory -ChildPath WindowsAppSDKGallery_TemporaryKey.pfx
99 | [IO.File]::WriteAllBytes("$certificatePath", $pfx_cert_byte)
100 |
101 | # Create the app package by building and packaging the Windows Application Packaging project
102 | - name: Create the app package
103 | run: msbuild $env:Solution_Name /p:AppxBundlePlatforms="$env:Appx_Bundle_Platforms" /p:Configuration=$env:Configuration /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:PackageCertificateKeyFile=WindowsAppSDKGallery_TemporaryKey.pfx /p:AppxPackageDir="$env:Appx_Package_Dir" /p:GenerateAppxPackageOnBuild=true
104 | env:
105 | Appx_Bundle: Never
106 | Appx_Bundle_Platforms: x64
107 | Appx_Package_Build_Mode: SideloadOnly
108 | Appx_Package_Dir: Packages\
109 | Configuration: ${{ matrix.configuration }}
110 |
111 | # Remove the pfx
112 | # - name: Remove the pfx
113 | # run: Remove-Item -path $env:Wap_Project_Directory\$env:Signing_Certificate
114 |
115 | # Upload the MSIX package: https://github.com/marketplace/actions/upload-a-build-artifact
116 | - name: Upload build artifacts
117 | uses: actions/upload-artifact@v2
118 | with:
119 | name: MSIX Package
120 | path: WindowsAppSDKGallery/Packages/**/WindowsAppSDKGallery*.msix
121 |
122 |
123 |
124 | # Create the unpackaged app
125 | - name: Build unpackaged app
126 | run: msbuild $env:Solution_Name /t:Publish /p:WindowsPackageType=None /p:Configuration=$env:Configuration /p:Platform=x64
127 | env:
128 | Configuration: ${{ matrix.configuration }}
129 |
130 | - name: Create ZIP of unpackaged app
131 | run: Compress-Archive WindowsAppSDKGallery/bin/x64/Release/net5.0-windows10.0.19041.0/publish/* 'WindowsAppSDKGallery-unpackaged-0.${{ github.run_number }}.${{ github.run_attempt }}.0.zip'
132 |
133 | - name: Upload unpackaged app
134 | uses: actions/upload-artifact@v2
135 | with:
136 | name: 'Unpackaged app'
137 | path: 'WindowsAppSDKGallery-unpackaged-0.${{ github.run_number }}.${{ github.run_attempt }}.0.zip'
138 |
139 |
140 | - name: Create GH release
141 | if: github.ref_name == 'main'
142 | uses: softprops/action-gh-release@v1
143 | with:
144 | draft: false
145 | prerelease: false
146 | name: '0.${{ github.run_number }}.${{ github.run_attempt }}.0'
147 | tag_name: 'v0.${{ github.run_number }}.${{ github.run_attempt }}.0'
148 | body: 'To install the MSIX version, you first have to add the certificate included in the MSIX (only need to do that once). To install the unpackaged version, you need to install the x64 WinAppRuntime Installer.'
149 | files: |
150 | WindowsAppSDKGallery/Packages/**/WindowsAppSDKGallery*.msix
151 | WindowsAppSDKGallery-unpackaged-*.zip
152 | fail_on_unmatched_files: true
153 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Build results
17 | [Dd]ebug/
18 | [Dd]ebugPublic/
19 | [Rr]elease/
20 | [Rr]eleases/
21 | x64/
22 | x86/
23 | bld/
24 | [Bb]in/
25 | [Oo]bj/
26 | [Ll]og/
27 |
28 | # Visual Studio 2015/2017 cache/options directory
29 | .vs/
30 | # Uncomment if you have tasks that create the project's static files in wwwroot
31 | #wwwroot/
32 |
33 | # Visual Studio 2017 auto generated files
34 | Generated\ Files/
35 |
36 | # MSTest test Results
37 | [Tt]est[Rr]esult*/
38 | [Bb]uild[Ll]og.*
39 |
40 | # NUNIT
41 | *.VisualState.xml
42 | TestResult.xml
43 |
44 | # Build Results of an ATL Project
45 | [Dd]ebugPS/
46 | [Rr]eleasePS/
47 | dlldata.c
48 |
49 | # Benchmark Results
50 | BenchmarkDotNet.Artifacts/
51 |
52 | # .NET Core
53 | project.lock.json
54 | project.fragment.lock.json
55 | artifacts/
56 |
57 | # StyleCop
58 | StyleCopReport.xml
59 |
60 | # Files built by Visual Studio
61 | *_i.c
62 | *_p.c
63 | *_h.h
64 | *.ilk
65 | *.meta
66 | *.obj
67 | *.iobj
68 | *.pch
69 | *.pdb
70 | *.ipdb
71 | *.pgc
72 | *.pgd
73 | *.rsp
74 | *.sbr
75 | *.tlb
76 | *.tli
77 | *.tlh
78 | *.tmp
79 | *.tmp_proj
80 | *_wpftmp.csproj
81 | *.log
82 | *.vspscc
83 | *.vssscc
84 | .builds
85 | *.pidb
86 | *.svclog
87 | *.scc
88 |
89 | # Chutzpah Test files
90 | _Chutzpah*
91 |
92 | # Visual C++ cache files
93 | ipch/
94 | *.aps
95 | *.ncb
96 | *.opendb
97 | *.opensdf
98 | *.sdf
99 | *.cachefile
100 | *.VC.db
101 | *.VC.VC.opendb
102 |
103 | # Visual Studio profiler
104 | *.psess
105 | *.vsp
106 | *.vspx
107 | *.sap
108 |
109 | # Visual Studio Trace Files
110 | *.e2e
111 |
112 | # TFS 2012 Local Workspace
113 | $tf/
114 |
115 | # Guidance Automation Toolkit
116 | *.gpState
117 |
118 | # ReSharper is a .NET coding add-in
119 | _ReSharper*/
120 | *.[Rr]e[Ss]harper
121 | *.DotSettings.user
122 |
123 | # JustCode is a .NET coding add-in
124 | .JustCode
125 |
126 | # TeamCity is a build add-in
127 | _TeamCity*
128 |
129 | # DotCover is a Code Coverage Tool
130 | *.dotCover
131 |
132 | # AxoCover is a Code Coverage Tool
133 | .axoCover/*
134 | !.axoCover/settings.json
135 |
136 | # Visual Studio code coverage results
137 | *.coverage
138 | *.coveragexml
139 |
140 | # NCrunch
141 | _NCrunch_*
142 | .*crunch*.local.xml
143 | nCrunchTemp_*
144 |
145 | # MightyMoose
146 | *.mm.*
147 | AutoTest.Net/
148 |
149 | # Web workbench (sass)
150 | .sass-cache/
151 |
152 | # Installshield output folder
153 | [Ee]xpress/
154 |
155 | # DocProject is a documentation generator add-in
156 | DocProject/buildhelp/
157 | DocProject/Help/*.HxT
158 | DocProject/Help/*.HxC
159 | DocProject/Help/*.hhc
160 | DocProject/Help/*.hhk
161 | DocProject/Help/*.hhp
162 | DocProject/Help/Html2
163 | DocProject/Help/html
164 |
165 | # Click-Once directory
166 | publish/
167 |
168 | # Publish Web Output
169 | *.[Pp]ublish.xml
170 | *.azurePubxml
171 | # Note: Comment the next line if you want to checkin your web deploy settings,
172 | # but database connection strings (with potential passwords) will be unencrypted
173 | *.pubxml
174 | *.publishproj
175 |
176 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
177 | # checkin your Azure Web App publish settings, but sensitive information contained
178 | # in these scripts will be unencrypted
179 | PublishScripts/
180 |
181 | # NuGet Packages
182 | *.nupkg
183 | # The packages folder can be ignored because of Package Restore
184 | **/[Pp]ackages/*
185 | # except build/, which is used as an MSBuild target.
186 | !**/[Pp]ackages/build/
187 | # Uncomment if necessary however generally it will be regenerated when needed
188 | #!**/[Pp]ackages/repositories.config
189 | # NuGet v3's project.json files produces more ignorable files
190 | *.nuget.props
191 | *.nuget.targets
192 |
193 | # Microsoft Azure Build Output
194 | csx/
195 | *.build.csdef
196 |
197 | # Microsoft Azure Emulator
198 | ecf/
199 | rcf/
200 |
201 | # Windows Store app package directories and files
202 | AppPackages/
203 | BundleArtifacts/
204 | Package.StoreAssociation.xml
205 | _pkginfo.txt
206 | *.appx
207 |
208 | # Visual Studio cache files
209 | # files ending in .cache can be ignored
210 | *.[Cc]ache
211 | # but keep track of directories ending in .cache
212 | !*.[Cc]ache/
213 |
214 | # Others
215 | ClientBin/
216 | ~$*
217 | *~
218 | *.dbmdl
219 | *.dbproj.schemaview
220 | *.jfm
221 | *.pfx
222 | *.publishsettings
223 | orleans.codegen.cs
224 |
225 | # Including strong name files can present a security risk
226 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
227 | #*.snk
228 |
229 | # Since there are multiple workflows, uncomment next line to ignore bower_components
230 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
231 | #bower_components/
232 |
233 | # RIA/Silverlight projects
234 | Generated_Code/
235 |
236 | # Backup & report files from converting an old project file
237 | # to a newer Visual Studio version. Backup files are not needed,
238 | # because we have git ;-)
239 | _UpgradeReport_Files/
240 | Backup*/
241 | UpgradeLog*.XML
242 | UpgradeLog*.htm
243 | ServiceFabricBackup/
244 | *.rptproj.bak
245 |
246 | # SQL Server files
247 | *.mdf
248 | *.ldf
249 | *.ndf
250 |
251 | # Business Intelligence projects
252 | *.rdl.data
253 | *.bim.layout
254 | *.bim_*.settings
255 | *.rptproj.rsuser
256 |
257 | # Microsoft Fakes
258 | FakesAssemblies/
259 |
260 | # GhostDoc plugin setting file
261 | *.GhostDoc.xml
262 |
263 | # Node.js Tools for Visual Studio
264 | .ntvs_analysis.dat
265 | node_modules/
266 |
267 | # Visual Studio 6 build log
268 | *.plg
269 |
270 | # Visual Studio 6 workspace options file
271 | *.opt
272 |
273 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
274 | *.vbw
275 |
276 | # Visual Studio LightSwitch build output
277 | **/*.HTMLClient/GeneratedArtifacts
278 | **/*.DesktopClient/GeneratedArtifacts
279 | **/*.DesktopClient/ModelManifest.xml
280 | **/*.Server/GeneratedArtifacts
281 | **/*.Server/ModelManifest.xml
282 | _Pvt_Extensions
283 |
284 | # Paket dependency manager
285 | .paket/paket.exe
286 | paket-files/
287 |
288 | # FAKE - F# Make
289 | .fake/
290 |
291 | # JetBrains Rider
292 | .idea/
293 | *.sln.iml
294 |
295 | # CodeRush personal settings
296 | .cr/personal
297 |
298 | # Python Tools for Visual Studio (PTVS)
299 | __pycache__/
300 | *.pyc
301 |
302 | # Cake - Uncomment if you are using it
303 | # tools/**
304 | # !tools/packages.config
305 |
306 | # Tabs Studio
307 | *.tss
308 |
309 | # Telerik's JustMock configuration file
310 | *.jmconfig
311 |
312 | # BizTalk build output
313 | *.btp.cs
314 | *.btm.cs
315 | *.odx.cs
316 | *.xsd.cs
317 |
318 | # OpenCover UI analysis results
319 | OpenCover/
320 |
321 | # Azure Stream Analytics local run output
322 | ASALocalRun/
323 |
324 | # MSBuild Binary and Structured Log
325 | *.binlog
326 |
327 | # NVidia Nsight GPU debugger configuration file
328 | *.nvuser
329 |
330 | # MFractors (Xamarin productivity tool) working folder
331 | .mfractor/
332 |
333 | # Local History for Visual Studio
334 | .localhistory/
335 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Andrew Leader
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/Logo.png
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # WindowsAppSDKGallery
2 | An app that demos functionality of the Windows App SDK
3 |
--------------------------------------------------------------------------------
/WindowsAppSDKGallery.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.1.31904.369
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WindowsAppSDKGallery", "WindowsAppSDKGallery\WindowsAppSDKGallery.csproj", "{1DF4D01D-EAF0-412B-AE1C-5CF74E17DF16}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|arm64 = Debug|arm64
11 | Debug|x64 = Debug|x64
12 | Debug|x86 = Debug|x86
13 | Release|arm64 = Release|arm64
14 | Release|x64 = Release|x64
15 | Release|x86 = Release|x86
16 | EndGlobalSection
17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
18 | {1DF4D01D-EAF0-412B-AE1C-5CF74E17DF16}.Debug|arm64.ActiveCfg = Debug|arm64
19 | {1DF4D01D-EAF0-412B-AE1C-5CF74E17DF16}.Debug|arm64.Build.0 = Debug|arm64
20 | {1DF4D01D-EAF0-412B-AE1C-5CF74E17DF16}.Debug|arm64.Deploy.0 = Debug|arm64
21 | {1DF4D01D-EAF0-412B-AE1C-5CF74E17DF16}.Debug|x64.ActiveCfg = Debug|x64
22 | {1DF4D01D-EAF0-412B-AE1C-5CF74E17DF16}.Debug|x64.Build.0 = Debug|x64
23 | {1DF4D01D-EAF0-412B-AE1C-5CF74E17DF16}.Debug|x64.Deploy.0 = Debug|x64
24 | {1DF4D01D-EAF0-412B-AE1C-5CF74E17DF16}.Debug|x86.ActiveCfg = Debug|x86
25 | {1DF4D01D-EAF0-412B-AE1C-5CF74E17DF16}.Debug|x86.Build.0 = Debug|x86
26 | {1DF4D01D-EAF0-412B-AE1C-5CF74E17DF16}.Debug|x86.Deploy.0 = Debug|x86
27 | {1DF4D01D-EAF0-412B-AE1C-5CF74E17DF16}.Release|arm64.ActiveCfg = Release|arm64
28 | {1DF4D01D-EAF0-412B-AE1C-5CF74E17DF16}.Release|arm64.Build.0 = Release|arm64
29 | {1DF4D01D-EAF0-412B-AE1C-5CF74E17DF16}.Release|arm64.Deploy.0 = Release|arm64
30 | {1DF4D01D-EAF0-412B-AE1C-5CF74E17DF16}.Release|x64.ActiveCfg = Release|x64
31 | {1DF4D01D-EAF0-412B-AE1C-5CF74E17DF16}.Release|x64.Build.0 = Release|x64
32 | {1DF4D01D-EAF0-412B-AE1C-5CF74E17DF16}.Release|x64.Deploy.0 = Release|x64
33 | {1DF4D01D-EAF0-412B-AE1C-5CF74E17DF16}.Release|x86.ActiveCfg = Release|x86
34 | {1DF4D01D-EAF0-412B-AE1C-5CF74E17DF16}.Release|x86.Build.0 = Release|x86
35 | {1DF4D01D-EAF0-412B-AE1C-5CF74E17DF16}.Release|x86.Deploy.0 = Release|x86
36 | EndGlobalSection
37 | GlobalSection(SolutionProperties) = preSolution
38 | HideSolutionNode = FALSE
39 | EndGlobalSection
40 | GlobalSection(ExtensibilityGlobals) = postSolution
41 | SolutionGuid = {BBF2C2B0-5850-47F5-8494-CB5203F6B9CA}
42 | EndGlobalSection
43 | EndGlobal
44 |
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/App.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Toolkit.Uwp.Notifications;
2 | using Microsoft.UI.Dispatching;
3 | using Microsoft.UI.Xaml;
4 | using Microsoft.UI.Xaml.Controls;
5 | using Microsoft.UI.Xaml.Controls.Primitives;
6 | using Microsoft.UI.Xaml.Data;
7 | using Microsoft.UI.Xaml.Input;
8 | using Microsoft.UI.Xaml.Media;
9 | using Microsoft.UI.Xaml.Navigation;
10 | using Microsoft.UI.Xaml.Shapes;
11 | using System;
12 | using System.Collections.Generic;
13 | using System.Diagnostics;
14 | using System.IO;
15 | using System.Linq;
16 | using System.Runtime.InteropServices;
17 | using System.Runtime.InteropServices.WindowsRuntime;
18 | using Windows.ApplicationModel;
19 | using Windows.ApplicationModel.Activation;
20 | using Windows.Foundation;
21 | using Windows.Foundation.Collections;
22 | using WindowsAppSDKGallery.DataModel;
23 | using WindowsAppSDKGallery.Helpers;
24 |
25 | // To learn more about WinUI, the WinUI project structure,
26 | // and more about our project templates, see: http://aka.ms/winui-project-info.
27 |
28 | namespace WindowsAppSDKGallery
29 | {
30 | ///
31 | /// Provides application-specific behavior to supplement the default Application class.
32 | ///
33 | public partial class App : Application
34 | {
35 | public static DispatcherQueue DispatcherQueue { get; private set; }
36 |
37 | ///
38 | /// Initializes the singleton application object. This is the first line of authored code
39 | /// executed, and as such is the logical equivalent of main() or WinMain().
40 | ///
41 | public App()
42 | {
43 | this.InitializeComponent();
44 | }
45 |
46 | ///
47 | /// Invoked when the application is launched normally by the end user. Other entry points
48 | /// will be used such as when the application is launched to open a specific file.
49 | ///
50 | /// Details about the launch request and process.
51 | protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
52 | {
53 | // Get the app-level dispatcher
54 | DispatcherQueue = global::Microsoft.UI.Dispatching.DispatcherQueue.GetForCurrentThread();
55 |
56 | // Register for activation redirection
57 | Microsoft.Windows.AppLifecycle.AppInstance.GetCurrent().Activated += App_Activated;
58 |
59 | // Register for toast activation
60 | ToastNotificationManagerCompat.OnActivated += ToastNotificationManagerCompat_OnActivated;
61 |
62 | // If we weren't launched by a toast, launch our window like normal
63 | // (Otherwise if launched by a toast, our OnActivated callback will be triggered)
64 | if (!ToastNotificationManagerCompat.WasCurrentProcessToastActivated())
65 | {
66 | LaunchAndBringToForegroundIfNeeded();
67 | }
68 | }
69 |
70 | private void LaunchAndBringToForegroundIfNeeded()
71 | {
72 | if (m_window == null)
73 | {
74 | m_window = new MainWindow();
75 | m_window.Activate();
76 |
77 | // Additionally we show using our helper, since if activated via a toast, it doesn't
78 | // activate the window correctly
79 | WindowHelper.ShowWindow(m_window);
80 | }
81 | else
82 | {
83 | WindowHelper.ShowWindow(m_window);
84 | }
85 | }
86 |
87 | private void App_Activated(object sender, Microsoft.Windows.AppLifecycle.AppActivationArguments e)
88 | {
89 | WindowHelper.ShowWindow(App.Window);
90 | }
91 |
92 | private void ToastNotificationManagerCompat_OnActivated(ToastNotificationActivatedEventArgsCompat e)
93 | {
94 | // Use the dispatcher from the window if present, otherwise the app dispatcher
95 | var dispatcherQueue = App.Window?.DispatcherQueue ?? App.DispatcherQueue;
96 |
97 | dispatcherQueue.TryEnqueue(delegate
98 | {
99 | HandleToastActivation(e);
100 | });
101 | }
102 |
103 | private void HandleToastActivation(ToastNotificationActivatedEventArgsCompat e)
104 | {
105 | var args = ToastArguments.Parse(e.Argument);
106 |
107 | args.TryGetValue("action", out string action);
108 | if (action == null)
109 | {
110 | action = "";
111 | }
112 |
113 | switch (action)
114 | {
115 | // Send a background message
116 | case "sendMessage":
117 | string message = e.UserInput["textBox"].ToString();
118 | new ToastContentBuilder()
119 | .AddText("Here's what you typed...")
120 | .AddText(message)
121 | .Show();
122 |
123 | // If the UI app isn't open
124 | if (App.Current == null)
125 | {
126 | // Close since we're done
127 | Process.GetCurrentProcess().Kill();
128 | }
129 |
130 | break;
131 |
132 | case "viewToastSample":
133 | LaunchAndBringToForegroundIfNeeded();
134 |
135 | // Open the toast sample
136 | App.Window.OpenSample(typeof(SamplePages.NotificationsSamples.ToastNotificationPage));
137 |
138 | break;
139 |
140 | default:
141 | LaunchAndBringToForegroundIfNeeded();
142 | break;
143 | }
144 | }
145 |
146 | private static MainWindow m_window;
147 | public static MainWindow Window => m_window;
148 | }
149 | }
150 |
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/AdaptiveIntroVideo.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/AdaptiveIntroVideo.mp4
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/Icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/Icon.ico
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/LargeTile.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/LargeTile.scale-100.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/LargeTile.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/LargeTile.scale-125.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/LargeTile.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/LargeTile.scale-150.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/LargeTile.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/LargeTile.scale-200.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/LargeTile.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/LargeTile.scale-400.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/LockScreenLogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/LockScreenLogo.scale-200.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/SmallTile.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/SmallTile.scale-100.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/SmallTile.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/SmallTile.scale-125.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/SmallTile.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/SmallTile.scale-150.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/SmallTile.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/SmallTile.scale-200.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/SmallTile.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/SmallTile.scale-400.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/SplashScreen.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/SplashScreen.scale-100.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/SplashScreen.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/SplashScreen.scale-125.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/SplashScreen.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/SplashScreen.scale-150.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/SplashScreen.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/SplashScreen.scale-200.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/SplashScreen.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/SplashScreen.scale-400.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/Square150x150Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/Square150x150Logo.scale-100.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/Square150x150Logo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/Square150x150Logo.scale-125.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/Square150x150Logo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/Square150x150Logo.scale-150.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/Square150x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/Square150x150Logo.scale-200.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/Square150x150Logo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/Square150x150Logo.scale-400.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/Square44x44Logo.altform-lightunplated_targetsize-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/Square44x44Logo.altform-lightunplated_targetsize-16.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/Square44x44Logo.altform-lightunplated_targetsize-24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/Square44x44Logo.altform-lightunplated_targetsize-24.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/Square44x44Logo.altform-lightunplated_targetsize-256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/Square44x44Logo.altform-lightunplated_targetsize-256.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/Square44x44Logo.altform-lightunplated_targetsize-32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/Square44x44Logo.altform-lightunplated_targetsize-32.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/Square44x44Logo.altform-lightunplated_targetsize-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/Square44x44Logo.altform-lightunplated_targetsize-48.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/Square44x44Logo.altform-unplated_targetsize-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/Square44x44Logo.altform-unplated_targetsize-16.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/Square44x44Logo.altform-unplated_targetsize-256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/Square44x44Logo.altform-unplated_targetsize-256.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/Square44x44Logo.altform-unplated_targetsize-32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/Square44x44Logo.altform-unplated_targetsize-32.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/Square44x44Logo.altform-unplated_targetsize-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/Square44x44Logo.altform-unplated_targetsize-48.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/Square44x44Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/Square44x44Logo.scale-100.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/Square44x44Logo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/Square44x44Logo.scale-125.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/Square44x44Logo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/Square44x44Logo.scale-150.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/Square44x44Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/Square44x44Logo.scale-200.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/Square44x44Logo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/Square44x44Logo.scale-400.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/Square44x44Logo.targetsize-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/Square44x44Logo.targetsize-16.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/Square44x44Logo.targetsize-24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/Square44x44Logo.targetsize-24.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/Square44x44Logo.targetsize-24_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/Square44x44Logo.targetsize-256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/Square44x44Logo.targetsize-256.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/Square44x44Logo.targetsize-32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/Square44x44Logo.targetsize-32.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/Square44x44Logo.targetsize-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/Square44x44Logo.targetsize-48.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/StoreLogo.backup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/StoreLogo.backup.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/StoreLogo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/StoreLogo.scale-100.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/StoreLogo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/StoreLogo.scale-125.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/StoreLogo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/StoreLogo.scale-150.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/StoreLogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/StoreLogo.scale-200.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/StoreLogo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/StoreLogo.scale-400.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/Wide310x150Logo.scale-100.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/Wide310x150Logo.scale-100.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/Wide310x150Logo.scale-125.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/Wide310x150Logo.scale-125.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/Wide310x150Logo.scale-150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/Wide310x150Logo.scale-150.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/Wide310x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/Wide310x150Logo.scale-200.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/Wide310x150Logo.scale-400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/Wide310x150Logo.scale-400.png
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Assets/chimes.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andrewleader/WindowsAppSDKGallery/0e8a4165f282e123f4b4e8c792428529248b912e/WindowsAppSDKGallery/Assets/chimes.wav
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Controls/ApiExample.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
18 |
19 |
21 |
24 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Controls/ApiExample.xaml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.UI.Xaml;
2 | using Microsoft.UI.Xaml.Controls;
3 | using Microsoft.UI.Xaml.Controls.Primitives;
4 | using Microsoft.UI.Xaml.Data;
5 | using Microsoft.UI.Xaml.Input;
6 | using Microsoft.UI.Xaml.Markup;
7 | using Microsoft.UI.Xaml.Media;
8 | using Microsoft.UI.Xaml.Navigation;
9 | using System;
10 | using System.Collections.Generic;
11 | using System.IO;
12 | using System.Linq;
13 | using System.Runtime.InteropServices.WindowsRuntime;
14 | using System.Text.RegularExpressions;
15 | using Windows.Foundation;
16 | using Windows.Foundation.Collections;
17 |
18 | // To learn more about WinUI, the WinUI project structure,
19 | // and more about our project templates, see: http://aka.ms/winui-project-info.
20 |
21 | namespace WindowsAppSDKGallery.Controls
22 | {
23 | [ContentProperty(Name = nameof(ApiExample.CustomOutput))]
24 | public sealed partial class ApiExample : UserControl
25 | {
26 | public ApiExample()
27 | {
28 | this.InitializeComponent();
29 | }
30 |
31 | public string HeaderText
32 | {
33 | get { return (string)GetValue(HeaderTextProperty); }
34 | set { SetValue(HeaderTextProperty, value); }
35 | }
36 |
37 | // Using a DependencyProperty as the backing store for HeaderText. This enables animation, styling, binding, etc...
38 | public static readonly DependencyProperty HeaderTextProperty =
39 | DependencyProperty.Register(nameof(HeaderText), typeof(string), typeof(ApiExample), new PropertyMetadata(null));
40 |
41 |
42 | ///
43 | /// The API, like AppInstance.GetCurrent().GetInstances()
44 | ///
45 | public string Api
46 | {
47 | get { return (string)GetValue(ApiProperty); }
48 | set { SetValue(ApiProperty, value); }
49 | }
50 |
51 | // Using a DependencyProperty as the backing store for Api. This enables animation, styling, binding, etc...
52 | public static readonly DependencyProperty ApiProperty =
53 | DependencyProperty.Register(nameof(Api), typeof(string), typeof(ApiExample), new PropertyMetadata(null, OnApiChanged));
54 |
55 | private static void OnApiChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
56 | {
57 | (sender as ApiExample).OnApiChanged(e);
58 | }
59 |
60 | private void OnApiChanged(DependencyPropertyChangedEventArgs e)
61 | {
62 | ApiParts.Children.Clear();
63 |
64 | if (Api == null)
65 | {
66 | return;
67 | }
68 |
69 | var remainingApi = Api;
70 |
71 | while (remainingApi.Length > 0)
72 | {
73 | var match = Regex.Match(remainingApi, @"\$\w+");
74 |
75 | if (match.Success && match.Index == 0)
76 | {
77 | var paramId = match.Value.Substring(1);
78 |
79 | ApiParts.Children.Add(new TextBox
80 | {
81 | PlaceholderText = paramId
82 | });
83 |
84 | remainingApi = remainingApi.Substring(match.Value.Length);
85 | }
86 | else
87 | {
88 | string apiText = remainingApi;
89 | if (match.Success)
90 | {
91 | apiText = remainingApi.Substring(0, match.Index);
92 | }
93 |
94 | ApiParts.Children.Add(new TextBlock
95 | {
96 | Text = apiText,
97 | VerticalAlignment = VerticalAlignment.Center
98 | });
99 |
100 | remainingApi = remainingApi.Substring(apiText.Length);
101 | }
102 | }
103 | }
104 |
105 | public event EventHandler ExecuteApi;
106 |
107 |
108 |
109 | public string Output
110 | {
111 | get { return (string)GetValue(OutputProperty); }
112 | set { SetValue(OutputProperty, value); }
113 | }
114 |
115 | // Using a DependencyProperty as the backing store for Output. This enables animation, styling, binding, etc...
116 | public static readonly DependencyProperty OutputProperty =
117 | DependencyProperty.Register(nameof(Output), typeof(string), typeof(ApiExample), new PropertyMetadata(null));
118 |
119 |
120 |
121 | public FrameworkElement CustomOutput
122 | {
123 | get { return (FrameworkElement)GetValue(CustomOutputProperty); }
124 | set { SetValue(CustomOutputProperty, value); }
125 | }
126 |
127 | // Using a DependencyProperty as the backing store for CustomOutput. This enables animation, styling, binding, etc...
128 | public static readonly DependencyProperty CustomOutputProperty =
129 | DependencyProperty.Register("CustomOutput", typeof(FrameworkElement), typeof(ApiExample), new PropertyMetadata(null));
130 |
131 |
132 |
133 |
134 | public object ReturnedObject
135 | {
136 | get { return (object)GetValue(ReturnedObjectProperty); }
137 | set { SetValue(ReturnedObjectProperty, value); }
138 | }
139 |
140 | // Using a DependencyProperty as the backing store for ReturnedObject. This enables animation, styling, binding, etc...
141 | public static readonly DependencyProperty ReturnedObjectProperty =
142 | DependencyProperty.Register("ReturnedObject", typeof(object), typeof(ApiExample), new PropertyMetadata(ObjectControl.UnsetObj));
143 |
144 |
145 |
146 |
147 | private void ButtonExecuteApi_Click(object sender, RoutedEventArgs e)
148 | {
149 | Dictionary parameters = new Dictionary();
150 |
151 | foreach (var child in ApiParts.Children.OfType())
152 | {
153 | parameters[child.PlaceholderText] = child.Text;
154 | }
155 |
156 | try
157 | {
158 | ExecuteApi?.Invoke(this, new ExecuteApiArgs(parameters));
159 | }
160 | catch (Exception ex)
161 | {
162 | ReturnedObject = ex;
163 | }
164 | }
165 | }
166 |
167 | public class ExecuteApiArgs
168 | {
169 | public ExecuteApiArgs(Dictionary parameters)
170 | {
171 | Parameters = parameters;
172 | }
173 | public Dictionary Parameters { get; private set; }
174 | }
175 | }
176 |
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Controls/ObjectControl.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Controls/ObjectControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.UI.Text;
2 | using Microsoft.UI.Xaml;
3 | using Microsoft.UI.Xaml.Controls;
4 | using Microsoft.UI.Xaml.Controls.Primitives;
5 | using Microsoft.UI.Xaml.Data;
6 | using Microsoft.UI.Xaml.Input;
7 | using Microsoft.UI.Xaml.Media;
8 | using Microsoft.UI.Xaml.Navigation;
9 | using System;
10 | using System.Collections;
11 | using System.Collections.Generic;
12 | using System.IO;
13 | using System.Linq;
14 | using System.Runtime.InteropServices.WindowsRuntime;
15 | using Windows.Foundation;
16 | using Windows.Foundation.Collections;
17 | using WindowsAppSDKGallery.Controls.ObjectControlHelpers;
18 |
19 | // To learn more about WinUI, the WinUI project structure,
20 | // and more about our project templates, see: http://aka.ms/winui-project-info.
21 |
22 | namespace WindowsAppSDKGallery.Controls
23 | {
24 | public sealed partial class ObjectControl : UserControl
25 | {
26 | public static readonly object UnsetObj = new object();
27 |
28 | public ObjectControl()
29 | {
30 | this.InitializeComponent();
31 | }
32 |
33 | public object Object
34 | {
35 | get { return (object)GetValue(ObjectProperty); }
36 | set { SetValue(ObjectProperty, value); }
37 | }
38 |
39 | // Using a DependencyProperty as the backing store for Object. This enables animation, styling, binding, etc...
40 | public static readonly DependencyProperty ObjectProperty =
41 | DependencyProperty.Register("Object", typeof(object), typeof(ObjectControl), new PropertyMetadata(UnsetObj, OnValuesChanged));
42 |
43 | private static void OnValuesChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
44 | {
45 | (sender as ObjectControl).OnValuesChanged(e);
46 | }
47 |
48 | private void OnValuesChanged(DependencyPropertyChangedEventArgs e)
49 | {
50 | if (Object == UnsetObj)
51 | {
52 | Content = null;
53 | return;
54 | }
55 |
56 | if (Object == null)
57 | {
58 | Content = new NullObjectControl();
59 | return;
60 | }
61 |
62 | if (Object.GetType().IsEnum || !Object.GetType().IsClass)
63 | {
64 | Content = new EnumObjectControl()
65 | {
66 | Object = Object
67 | };
68 | }
69 | else if (Object is IEnumerable)
70 | {
71 | Content = new ListObjectControl()
72 | {
73 | Object = Object
74 | };
75 | }
76 | else if (Object is Exception)
77 | {
78 | Content = new ExceptionObjectControl
79 | {
80 | Object = Object
81 | };
82 | }
83 | else
84 | {
85 | Content = new BaseObjectControl
86 | {
87 | Object = Object
88 | };
89 | }
90 | }
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Controls/ObjectControlHelpers/BaseObjectControl.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
21 |
26 |
27 |
28 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/WindowsAppSDKGallery/Controls/ObjectControlHelpers/BaseObjectControl.xaml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.UI.Xaml;
2 | using Microsoft.UI.Xaml.Controls;
3 | using Microsoft.UI.Xaml.Controls.Primitives;
4 | using Microsoft.UI.Xaml.Data;
5 | using Microsoft.UI.Xaml.Input;
6 | using Microsoft.UI.Xaml.Media;
7 | using Microsoft.UI.Xaml.Navigation;
8 | using System;
9 | using System.Collections.Generic;
10 | using System.IO;
11 | using System.Linq;
12 | using System.Runtime.InteropServices.WindowsRuntime;
13 | using Windows.Foundation;
14 | using Windows.Foundation.Collections;
15 | using Windows.Security.Credentials;
16 |
17 | // To learn more about WinUI, the WinUI project structure,
18 | // and more about our project templates, see: http://aka.ms/winui-project-info.
19 |
20 | namespace WindowsAppSDKGallery.Controls.ObjectControlHelpers
21 | {
22 | public static class ObjectMethodResolvers
23 | {
24 | public static Dictionary>> Resolvers { get; private set; } = new();
25 |
26 | static ObjectMethodResolvers()
27 | {
28 | AddResolver(
29 | typeof(Microsoft.Windows.AppLifecycle.AppInstance),
30 | nameof(Microsoft.Windows.AppLifecycle.AppInstance.RedirectActivationToAsync),
31 | async i =>
32 | {
33 | await (i as Microsoft.Windows.AppLifecycle.AppInstance).RedirectActivationToAsync(Microsoft.Windows.AppLifecycle.AppInstance.GetCurrent().GetActivatedEventArgs());
34 | });
35 |
36 | AddResolver(
37 | typeof(PasswordCredential),
38 | nameof(PasswordVault.Remove),
39 | i =>
40 | {
41 | new PasswordVault().Remove(i as PasswordCredential);
42 | });
43 | }
44 |
45 | private static void AddResolver(Type type, string method, Action