-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
43 lines (37 loc) · 1.38 KB
/
Program.cs
File metadata and controls
43 lines (37 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.Runtime.InteropServices;
using Microsoft.Windows.AppLifecycle;
using Microsoft.Windows.AppNotifications;
using Microsoft.Windows.ApplicationModel.DynamicDependency;
using Microsoft.UI.Dispatching;
namespace Bluetask
{
internal static class Program
{
[DllImport("Microsoft.ui.xaml.dll")]
[DefaultDllImportSearchPaths(DllImportSearchPath.SafeDirectories)]
private static extern void XamlCheckProcessRequirements();
[STAThread]
private static void Main(string[] args)
{
// Ensure WinAppSDK runtime is initialized for unpackaged runs
try
{
Bootstrap.Initialize(0x00010005); // matches Microsoft.WindowsAppSDK version major/minor (1.5)
}
catch
{
// If Initialize fails, continue; dynamic dependency may already be loaded via framework
}
// Required for XAML hosting
XamlCheckProcessRequirements();
WinRT.ComWrappersSupport.InitializeComWrappers();
Microsoft.UI.Xaml.Application.Start((p) =>
{
var context = new DispatcherQueueSynchronizationContext(DispatcherQueue.GetForCurrentThread());
System.Threading.SynchronizationContext.SetSynchronizationContext(context);
new App();
});
}
}
}