├── .gitignore
├── Albacore.StartMenuCompanion.Sample.csproj
├── Albacore.StartMenuCompanion.Sample.sln
├── App.xaml
├── App.xaml.cs
├── Assets
├── LockScreenLogo.scale-200.png
├── SampleAdaptiveCard.json
├── SplashScreen.scale-200.png
├── Square150x150Logo.scale-200.png
├── Square44x44Logo.scale-200.png
├── Square44x44Logo.targetsize-24_altform-unplated.png
├── StoreLogo.png
└── Wide310x150Logo.scale-200.png
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── Package.appxmanifest
├── Properties
└── launchSettings.json
├── README.md
└── app.manifest
/.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/main/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 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Ww][Ii][Nn]32/
27 | [Aa][Rr][Mm]/
28 | [Aa][Rr][Mm]64/
29 | bld/
30 | [Bb]in/
31 | [Oo]bj/
32 | [Ll]og/
33 | [Ll]ogs/
34 |
35 | # Visual Studio 2015/2017 cache/options directory
36 | .vs/
37 | # Uncomment if you have tasks that create the project's static files in wwwroot
38 | #wwwroot/
39 |
40 | # Visual Studio 2017 auto generated files
41 | Generated\ Files/
42 |
43 | # MSTest test Results
44 | [Tt]est[Rr]esult*/
45 | [Bb]uild[Ll]og.*
46 |
47 | # NUnit
48 | *.VisualState.xml
49 | TestResult.xml
50 | nunit-*.xml
51 |
52 | # Build Results of an ATL Project
53 | [Dd]ebugPS/
54 | [Rr]eleasePS/
55 | dlldata.c
56 |
57 | # Benchmark Results
58 | BenchmarkDotNet.Artifacts/
59 |
60 | # .NET Core
61 | project.lock.json
62 | project.fragment.lock.json
63 | artifacts/
64 |
65 | # ASP.NET Scaffolding
66 | ScaffoldingReadMe.txt
67 |
68 | # StyleCop
69 | StyleCopReport.xml
70 |
71 | # Files built by Visual Studio
72 | *_i.c
73 | *_p.c
74 | *_h.h
75 | *.ilk
76 | *.meta
77 | *.obj
78 | *.iobj
79 | *.pch
80 | *.pdb
81 | *.ipdb
82 | *.pgc
83 | *.pgd
84 | *.rsp
85 | *.sbr
86 | *.tlb
87 | *.tli
88 | *.tlh
89 | *.tmp
90 | *.tmp_proj
91 | *_wpftmp.csproj
92 | *.log
93 | *.tlog
94 | *.vspscc
95 | *.vssscc
96 | .builds
97 | *.pidb
98 | *.svclog
99 | *.scc
100 |
101 | # Chutzpah Test files
102 | _Chutzpah*
103 |
104 | # Visual C++ cache files
105 | ipch/
106 | *.aps
107 | *.ncb
108 | *.opendb
109 | *.opensdf
110 | *.sdf
111 | *.cachefile
112 | *.VC.db
113 | *.VC.VC.opendb
114 |
115 | # Visual Studio profiler
116 | *.psess
117 | *.vsp
118 | *.vspx
119 | *.sap
120 |
121 | # Visual Studio Trace Files
122 | *.e2e
123 |
124 | # TFS 2012 Local Workspace
125 | $tf/
126 |
127 | # Guidance Automation Toolkit
128 | *.gpState
129 |
130 | # ReSharper is a .NET coding add-in
131 | _ReSharper*/
132 | *.[Rr]e[Ss]harper
133 | *.DotSettings.user
134 |
135 | # TeamCity is a build add-in
136 | _TeamCity*
137 |
138 | # DotCover is a Code Coverage Tool
139 | *.dotCover
140 |
141 | # AxoCover is a Code Coverage Tool
142 | .axoCover/*
143 | !.axoCover/settings.json
144 |
145 | # Coverlet is a free, cross platform Code Coverage Tool
146 | coverage*.json
147 | coverage*.xml
148 | coverage*.info
149 |
150 | # Visual Studio code coverage results
151 | *.coverage
152 | *.coveragexml
153 |
154 | # NCrunch
155 | _NCrunch_*
156 | .*crunch*.local.xml
157 | nCrunchTemp_*
158 |
159 | # MightyMoose
160 | *.mm.*
161 | AutoTest.Net/
162 |
163 | # Web workbench (sass)
164 | .sass-cache/
165 |
166 | # Installshield output folder
167 | [Ee]xpress/
168 |
169 | # DocProject is a documentation generator add-in
170 | DocProject/buildhelp/
171 | DocProject/Help/*.HxT
172 | DocProject/Help/*.HxC
173 | DocProject/Help/*.hhc
174 | DocProject/Help/*.hhk
175 | DocProject/Help/*.hhp
176 | DocProject/Help/Html2
177 | DocProject/Help/html
178 |
179 | # Click-Once directory
180 | publish/
181 |
182 | # Publish Web Output
183 | *.[Pp]ublish.xml
184 | *.azurePubxml
185 | # Note: Comment the next line if you want to checkin your web deploy settings,
186 | # but database connection strings (with potential passwords) will be unencrypted
187 | *.pubxml
188 | *.publishproj
189 |
190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
191 | # checkin your Azure Web App publish settings, but sensitive information contained
192 | # in these scripts will be unencrypted
193 | PublishScripts/
194 |
195 | # NuGet Packages
196 | *.nupkg
197 | # NuGet Symbol Packages
198 | *.snupkg
199 | # The packages folder can be ignored because of Package Restore
200 | **/[Pp]ackages/*
201 | # except build/, which is used as an MSBuild target.
202 | !**/[Pp]ackages/build/
203 | # Uncomment if necessary however generally it will be regenerated when needed
204 | #!**/[Pp]ackages/repositories.config
205 | # NuGet v3's project.json files produces more ignorable files
206 | *.nuget.props
207 | *.nuget.targets
208 |
209 | # Microsoft Azure Build Output
210 | csx/
211 | *.build.csdef
212 |
213 | # Microsoft Azure Emulator
214 | ecf/
215 | rcf/
216 |
217 | # Windows Store app package directories and files
218 | AppPackages/
219 | BundleArtifacts/
220 | Package.StoreAssociation.xml
221 | _pkginfo.txt
222 | *.appx
223 | *.appxbundle
224 | *.appxupload
225 |
226 | # Visual Studio cache files
227 | # files ending in .cache can be ignored
228 | *.[Cc]ache
229 | # but keep track of directories ending in .cache
230 | !?*.[Cc]ache/
231 |
232 | # Others
233 | ClientBin/
234 | ~$*
235 | *~
236 | *.dbmdl
237 | *.dbproj.schemaview
238 | *.jfm
239 | *.pfx
240 | *.publishsettings
241 | orleans.codegen.cs
242 |
243 | # Including strong name files can present a security risk
244 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
245 | #*.snk
246 |
247 | # Since there are multiple workflows, uncomment next line to ignore bower_components
248 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
249 | #bower_components/
250 |
251 | # RIA/Silverlight projects
252 | Generated_Code/
253 |
254 | # Backup & report files from converting an old project file
255 | # to a newer Visual Studio version. Backup files are not needed,
256 | # because we have git ;-)
257 | _UpgradeReport_Files/
258 | Backup*/
259 | UpgradeLog*.XML
260 | UpgradeLog*.htm
261 | ServiceFabricBackup/
262 | *.rptproj.bak
263 |
264 | # SQL Server files
265 | *.mdf
266 | *.ldf
267 | *.ndf
268 |
269 | # Business Intelligence projects
270 | *.rdl.data
271 | *.bim.layout
272 | *.bim_*.settings
273 | *.rptproj.rsuser
274 | *- [Bb]ackup.rdl
275 | *- [Bb]ackup ([0-9]).rdl
276 | *- [Bb]ackup ([0-9][0-9]).rdl
277 |
278 | # Microsoft Fakes
279 | FakesAssemblies/
280 |
281 | # GhostDoc plugin setting file
282 | *.GhostDoc.xml
283 |
284 | # Node.js Tools for Visual Studio
285 | .ntvs_analysis.dat
286 | node_modules/
287 |
288 | # Visual Studio 6 build log
289 | *.plg
290 |
291 | # Visual Studio 6 workspace options file
292 | *.opt
293 |
294 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
295 | *.vbw
296 |
297 | # Visual Studio 6 auto-generated project file (contains which files were open etc.)
298 | *.vbp
299 |
300 | # Visual Studio 6 workspace and project file (working project files containing files to include in project)
301 | *.dsw
302 | *.dsp
303 |
304 | # Visual Studio 6 technical files
305 | *.ncb
306 | *.aps
307 |
308 | # Visual Studio LightSwitch build output
309 | **/*.HTMLClient/GeneratedArtifacts
310 | **/*.DesktopClient/GeneratedArtifacts
311 | **/*.DesktopClient/ModelManifest.xml
312 | **/*.Server/GeneratedArtifacts
313 | **/*.Server/ModelManifest.xml
314 | _Pvt_Extensions
315 |
316 | # Paket dependency manager
317 | .paket/paket.exe
318 | paket-files/
319 |
320 | # FAKE - F# Make
321 | .fake/
322 |
323 | # CodeRush personal settings
324 | .cr/personal
325 |
326 | # Python Tools for Visual Studio (PTVS)
327 | __pycache__/
328 | *.pyc
329 |
330 | # Cake - Uncomment if you are using it
331 | # tools/**
332 | # !tools/packages.config
333 |
334 | # Tabs Studio
335 | *.tss
336 |
337 | # Telerik's JustMock configuration file
338 | *.jmconfig
339 |
340 | # BizTalk build output
341 | *.btp.cs
342 | *.btm.cs
343 | *.odx.cs
344 | *.xsd.cs
345 |
346 | # OpenCover UI analysis results
347 | OpenCover/
348 |
349 | # Azure Stream Analytics local run output
350 | ASALocalRun/
351 |
352 | # MSBuild Binary and Structured Log
353 | *.binlog
354 |
355 | # NVidia Nsight GPU debugger configuration file
356 | *.nvuser
357 |
358 | # MFractors (Xamarin productivity tool) working folder
359 | .mfractor/
360 |
361 | # Local History for Visual Studio
362 | .localhistory/
363 |
364 | # Visual Studio History (VSHistory) files
365 | .vshistory/
366 |
367 | # BeatPulse healthcheck temp database
368 | healthchecksdb
369 |
370 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
371 | MigrationBackup/
372 |
373 | # Ionide (cross platform F# VS Code tools) working folder
374 | .ionide/
375 |
376 | # Fody - auto-generated XML schema
377 | FodyWeavers.xsd
378 |
379 | # VS Code files for those working on multiple tools
380 | .vscode/*
381 | !.vscode/settings.json
382 | !.vscode/tasks.json
383 | !.vscode/launch.json
384 | !.vscode/extensions.json
385 | *.code-workspace
386 |
387 | # Local History for Visual Studio Code
388 | .history/
389 |
390 | # Windows Installer files from build outputs
391 | *.cab
392 | *.msi
393 | *.msix
394 | *.msm
395 | *.msp
396 |
397 | # JetBrains Rider
398 | *.sln.iml
399 |
--------------------------------------------------------------------------------
/Albacore.StartMenuCompanion.Sample.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | WinExe
4 | net8.0-windows10.0.19041.0
5 | 10.0.17763.0
6 | Albacore.StartMenuCompanion.Sample
7 | app.manifest
8 | x86;x64;ARM64
9 | win-x86;win-x64;win-arm64
10 | win10-x86;win10-x64;win10-arm64
11 | win-$(Platform).pubxml
12 | true
13 | true
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
40 |
41 |
42 |
43 |
44 |
49 |
50 | true
51 |
52 |
--------------------------------------------------------------------------------
/Albacore.StartMenuCompanion.Sample.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 17
4 | VisualStudioVersion = 17.10.34928.147
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Albacore.StartMenuCompanion.Sample", "Albacore.StartMenuCompanion.Sample.csproj", "{7D0F2A5C-78A3-4FD3-9AC8-6404525AF6C6}"
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 | {7D0F2A5C-78A3-4FD3-9AC8-6404525AF6C6}.Debug|ARM64.ActiveCfg = Debug|ARM64
19 | {7D0F2A5C-78A3-4FD3-9AC8-6404525AF6C6}.Debug|ARM64.Build.0 = Debug|ARM64
20 | {7D0F2A5C-78A3-4FD3-9AC8-6404525AF6C6}.Debug|ARM64.Deploy.0 = Debug|ARM64
21 | {7D0F2A5C-78A3-4FD3-9AC8-6404525AF6C6}.Debug|x64.ActiveCfg = Debug|x64
22 | {7D0F2A5C-78A3-4FD3-9AC8-6404525AF6C6}.Debug|x64.Build.0 = Debug|x64
23 | {7D0F2A5C-78A3-4FD3-9AC8-6404525AF6C6}.Debug|x64.Deploy.0 = Debug|x64
24 | {7D0F2A5C-78A3-4FD3-9AC8-6404525AF6C6}.Debug|x86.ActiveCfg = Debug|x86
25 | {7D0F2A5C-78A3-4FD3-9AC8-6404525AF6C6}.Debug|x86.Build.0 = Debug|x86
26 | {7D0F2A5C-78A3-4FD3-9AC8-6404525AF6C6}.Debug|x86.Deploy.0 = Debug|x86
27 | {7D0F2A5C-78A3-4FD3-9AC8-6404525AF6C6}.Release|ARM64.ActiveCfg = Release|ARM64
28 | {7D0F2A5C-78A3-4FD3-9AC8-6404525AF6C6}.Release|ARM64.Build.0 = Release|ARM64
29 | {7D0F2A5C-78A3-4FD3-9AC8-6404525AF6C6}.Release|ARM64.Deploy.0 = Release|ARM64
30 | {7D0F2A5C-78A3-4FD3-9AC8-6404525AF6C6}.Release|x64.ActiveCfg = Release|x64
31 | {7D0F2A5C-78A3-4FD3-9AC8-6404525AF6C6}.Release|x64.Build.0 = Release|x64
32 | {7D0F2A5C-78A3-4FD3-9AC8-6404525AF6C6}.Release|x64.Deploy.0 = Release|x64
33 | {7D0F2A5C-78A3-4FD3-9AC8-6404525AF6C6}.Release|x86.ActiveCfg = Release|x86
34 | {7D0F2A5C-78A3-4FD3-9AC8-6404525AF6C6}.Release|x86.Build.0 = Release|x86
35 | {7D0F2A5C-78A3-4FD3-9AC8-6404525AF6C6}.Release|x86.Deploy.0 = Release|x86
36 | EndGlobalSection
37 | GlobalSection(SolutionProperties) = preSolution
38 | HideSolutionNode = FALSE
39 | EndGlobalSection
40 | GlobalSection(ExtensibilityGlobals) = postSolution
41 | SolutionGuid = {DBCBC4E3-58BE-4EAF-9DF5-5122331E8F67}
42 | EndGlobalSection
43 | EndGlobal
44 |
--------------------------------------------------------------------------------
/App.xaml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/App.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 Microsoft.UI.Xaml.Shapes;
9 | using System;
10 | using System.Collections.Generic;
11 | using System.IO;
12 | using System.Linq;
13 | using System.Runtime.InteropServices.WindowsRuntime;
14 | using Windows.ApplicationModel;
15 | using Windows.ApplicationModel.Activation;
16 | using Windows.Foundation;
17 | using Windows.Foundation.Collections;
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 Albacore.StartMenuCompanion.Sample
23 | {
24 | ///
25 | /// Provides application-specific behavior to supplement the default Application class.
26 | ///
27 | public partial class App : Application
28 | {
29 | ///
30 | /// Initializes the singleton application object. This is the first line of authored code
31 | /// executed, and as such is the logical equivalent of main() or WinMain().
32 | ///
33 | public App()
34 | {
35 | this.InitializeComponent();
36 | }
37 |
38 | ///
39 | /// Invoked when the application is launched.
40 | ///
41 | /// Details about the launch request and process.
42 | protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
43 | {
44 | m_window = new MainWindow();
45 | m_window.Activate();
46 | }
47 |
48 | private Window m_window;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/Assets/LockScreenLogo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thebookisclosed/StartMenuCompanionSample/cdb13cb135bf4ef51a77602666a6371081d84a17/Assets/LockScreenLogo.scale-200.png
--------------------------------------------------------------------------------
/Assets/SampleAdaptiveCard.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
3 | "type": "AdaptiveCard",
4 | "version": "1.1",
5 | "id": "Weather_Preview_LockScreen_LockScreen",
6 | "body": [
7 | {
8 | "type": "ColumnSet",
9 | "columns": [
10 | {
11 | "type": "Column",
12 | "width": "6px"
13 | },
14 | {
15 | "type": "Column",
16 | "width": "stretch",
17 | "items": [
18 | {
19 | "type": "Container",
20 | "items": [
21 | {
22 | "type": "ColumnSet",
23 | "columns": [
24 | {
25 | "type": "Column",
26 | "items": [
27 | {
28 | "type": "TextBlock",
29 | "weight": "Bolder",
30 | "text": "Hell",
31 | "wrap": true,
32 | "maxLines": 1,
33 | "color": "Default"
34 | },
35 | {
36 | "type": "ColumnSet",
37 | "columns": [
38 | {
39 | "type": "Column",
40 | "width": "auto",
41 | "items": [
42 | {
43 | "type": "Image",
44 | "height": "32px",
45 | "url": "https://assets.msn.com/weathermapdata/1/static/weather/Icons/LFlOFwA=/Condition/AAehR3S.png",
46 | "altText": "Sunny",
47 | "lottieAnimation": "Sunny"
48 | }
49 | ],
50 | "verticalContentAlignment": "Center"
51 | },
52 | {
53 | "type": "Column",
54 | "width": "auto",
55 | "items": [
56 | {
57 | "type": "TextBlock",
58 | "size": "ExtraLarge",
59 | "text": "67",
60 | "horizontalAlignment": "Center",
61 | "wrap": true,
62 | "spacing": "None",
63 | "separator": true
64 | }
65 | ],
66 | "verticalContentAlignment": "Center"
67 | },
68 | {
69 | "type": "Column",
70 | "width": "auto",
71 | "items": [
72 | {
73 | "type": "TextBlock",
74 | "text": "°F",
75 | "wrap": true,
76 | "spacing": "Small"
77 | },
78 | {
79 | "type": "TextBlock",
80 | "text": " ",
81 | "wrap": true,
82 | "spacing": "Small"
83 | }
84 | ],
85 | "verticalContentAlignment": "Center",
86 | "spacing": "Small"
87 | },
88 | {
89 | "type": "Column",
90 | "width": "auto",
91 | "items": [
92 | {
93 | "type": "Image",
94 | "size": "Small",
95 | "url": "https://assets.msn.com/weathermapdata/1/static/weather/Icons/LFlOFwA=/Alert/Alert_TL_Y.png",
96 | "horizontalAlignment": "Left",
97 | "altText": "Low temperature",
98 | "height": "16px"
99 | }
100 | ],
101 | "verticalContentAlignment": "Center"
102 | },
103 | {
104 | "type": "Column",
105 | "width": "stretch",
106 | "items": [
107 | {
108 | "type": "TextBlock",
109 | "size": "Small",
110 | "text": "Low temperature",
111 | "wrap": true,
112 | "maxLines": 3
113 | }
114 | ],
115 | "verticalContentAlignment": "Center"
116 | }
117 | ],
118 | "spacing": "Medium"
119 | },
120 | {
121 | "type": "TextBlock",
122 | "weight": "Bolder",
123 | "color": "Accent",
124 | "text": "See full forecast",
125 | "horizontalAlignment": "Center"
126 | }
127 | ],
128 | "width": "stretch"
129 | }
130 | ],
131 | "selectAction": {
132 | "type": "Action.OpenUrl",
133 | "url": "https://ntp.msn.com/edge/ntp?cm=en-us&ocid=widgetonlockscreen&segment=Weather&scenario=SevereWeather",
134 | "title": "See full forecast"
135 | }
136 | },
137 | {
138 | "type": "ColumnSet",
139 | "columns": [
140 | {
141 | "id": "LargeTicker1",
142 | "type": "Column",
143 | "width": "auto",
144 | "items": [
145 | {
146 | "id": "BadgeAnchorLargeTicker",
147 | "type": "Image",
148 | "height": "32px",
149 | "url": "https://assets.msn.com/weathermapdata/1/static/finance/1stparty/FinanceTaskbarIcons/Finance_Stock_Increase_Decrease/Finance_stock_up_green_72x72.png",
150 | "horizontalAlignment": "Center",
151 | "isAnimated": false,
152 | "animationCount": 0,
153 | "frameIntervalInMs": 0,
154 | "animationDurationInMs": 0,
155 | "animationSvgSize": 0
156 | }
157 | ],
158 | "verticalContentAlignment": "Center",
159 | "spacing": "None"
160 | },
161 | {
162 | "id": "LargeTicker2",
163 | "type": "Column",
164 | "width": "auto",
165 | "items": [
166 | {
167 | "type": "TextBlock",
168 | "text": "VIX",
169 | "spacing": "None"
170 | },
171 | {
172 | "type": "TextBlock",
173 | "color": "Good",
174 | "isSubtle": false,
175 | "text": "+1.15%",
176 | "spacing": "None"
177 | }
178 | ]
179 | }
180 | ],
181 | "spacing": "ExtraLarge"
182 | }
183 | ],
184 | "spacing": "None"
185 | }
186 | ]
187 | }
188 | ]
189 | }
190 | ]
191 | }
--------------------------------------------------------------------------------
/Assets/SplashScreen.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thebookisclosed/StartMenuCompanionSample/cdb13cb135bf4ef51a77602666a6371081d84a17/Assets/SplashScreen.scale-200.png
--------------------------------------------------------------------------------
/Assets/Square150x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thebookisclosed/StartMenuCompanionSample/cdb13cb135bf4ef51a77602666a6371081d84a17/Assets/Square150x150Logo.scale-200.png
--------------------------------------------------------------------------------
/Assets/Square44x44Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thebookisclosed/StartMenuCompanionSample/cdb13cb135bf4ef51a77602666a6371081d84a17/Assets/Square44x44Logo.scale-200.png
--------------------------------------------------------------------------------
/Assets/Square44x44Logo.targetsize-24_altform-unplated.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thebookisclosed/StartMenuCompanionSample/cdb13cb135bf4ef51a77602666a6371081d84a17/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
--------------------------------------------------------------------------------
/Assets/StoreLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thebookisclosed/StartMenuCompanionSample/cdb13cb135bf4ef51a77602666a6371081d84a17/Assets/StoreLogo.png
--------------------------------------------------------------------------------
/Assets/Wide310x150Logo.scale-200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thebookisclosed/StartMenuCompanionSample/cdb13cb135bf4ef51a77602666a6371081d84a17/Assets/Wide310x150Logo.scale-200.png
--------------------------------------------------------------------------------
/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | Adaptive Card JSON:
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/MainWindow.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 System.Security.AccessControl;
14 | using System.Security.Principal;
15 | using System.Threading.Tasks;
16 | using Windows.Foundation;
17 | using Windows.Foundation.Collections;
18 | using Windows.Storage;
19 |
20 | // To learn more about WinUI, the WinUI project structure,
21 | // and more about our project templates, see: http://aka.ms/winui-project-info.
22 |
23 | namespace Albacore.StartMenuCompanion.Sample
24 | {
25 | ///
26 | /// An empty window that can be used on its own or navigated to within a Frame.
27 | ///
28 | public sealed partial class MainWindow : Window
29 | {
30 | private string JSONDirectory = Path.Combine(ApplicationData.Current.LocalFolder.Path, "StartMenu");
31 | private string JSONPath;
32 |
33 | public MainWindow()
34 | {
35 | this.InitializeComponent();
36 | JSONPath = Path.Combine(JSONDirectory, "StartMenuCompanion.json");
37 | if (!Directory.Exists(JSONDirectory))
38 | DropSampleJSON();
39 | else
40 | ReadJSONFile();
41 | }
42 |
43 | private void SaveButton_Click(object sender, RoutedEventArgs e)
44 | {
45 | WriteJSONFile();
46 | }
47 |
48 | private void ReloadButton_Click(object sender, RoutedEventArgs e)
49 | {
50 | ReadJSONFile();
51 | }
52 |
53 | private void ReadJSONFile()
54 | {
55 | if (!File.Exists(JSONPath))
56 | return;
57 | var jsonData = File.ReadAllText(JSONPath);
58 | CompanionJSONContent.Text = jsonData;
59 | }
60 |
61 | private void WriteJSONFile()
62 | {
63 | File.WriteAllText(JSONPath, CompanionJSONContent.Text);
64 | }
65 |
66 | private async void OpenFolderButton_Click(object sender, RoutedEventArgs e)
67 | {
68 | await Windows.System.Launcher.LaunchFolderPathAsync(JSONDirectory);
69 | }
70 |
71 | private async void DropSampleJSON()
72 | {
73 | var storageFile = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/SampleAdaptiveCard.json"));
74 | var storageDir = await ApplicationData.Current.LocalFolder.CreateFolderAsync("StartMenu");
75 |
76 | var dirInfo = new DirectoryInfo(JSONDirectory);
77 | var dirSec = dirInfo.GetAccessControl();
78 | // Add Shell Experience Capability SID
79 | dirSec.AddAccessRule(new FileSystemAccessRule(new SecurityIdentifier("S-1-15-3-1024-3167453650-624722384-889205278-321484983-714554697-3592933102-807660695-1632717421"), FileSystemRights.ReadAndExecute, InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit, PropagationFlags.None, AccessControlType.Allow));
80 | dirInfo.SetAccessControl(dirSec);
81 |
82 | await storageFile.CopyAsync(storageDir, "StartMenuCompanion.json");
83 | ReadJSONFile();
84 | }
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/Package.appxmanifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
11 |
15 |
16 |
17 |
18 |
19 | Start Menu Companion (Sample)
20 | Albacore
21 | Assets\StoreLogo.png
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
37 |
43 |
44 |
45 |
46 |
47 |
48 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
--------------------------------------------------------------------------------
/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "Albacore.StartMenuCompanion.Sample (Package)": {
4 | "commandName": "MsixPackage"
5 | },
6 | "Albacore.StartMenuCompanion.Sample (Unpackaged)": {
7 | "commandName": "Project"
8 | }
9 | }
10 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Start Menu Companion Sample
2 |
3 | This repository contains a small WinUI 3 desktop app which registers itself as a Start Menu Companion provider.
4 | A sample Adaptive Card JSON is included to make getting started simpler.
5 |
6 | ## Prerequisites
7 | - [x] Any current Windows 11 Insider build as of 6/23/2024
8 | - [x] Visual Studio 2022 and its "Windows application development" workload
9 | - [x] Feature ID 48697323 enabled
10 |
11 | ## How do I try this?
12 | 1) Clone, build, and deploy the solution
13 | 2) Make sure the companion is enabled in the Settings app
14 | 3) Open the deployed app and configure the Adaptive Card JSON content to your liking & hit Save
15 | 4) If the companion isn't visible, simply restart the shell by ending `sihost.exe` and `explorer.exe`
16 |
17 | ## How can I change how the app identifies?
18 | The app's name, package identity, as well as everything related to its Settings entry is configured in the `Package.appxmanifest` file.
19 |
20 | ## What can I use to design the card?
21 | You can use the [AdativeCards.io designer](https://adaptivecards.io/designer/), make sure to set the `Target version` to `1.1` so you don't end up using elements not supported by the shell's renderer.
22 |
23 | 
24 |
--------------------------------------------------------------------------------
/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | PerMonitorV2
17 |
18 |
19 |
--------------------------------------------------------------------------------