|
1 // Copyright (c) Microsoft Corporation and Contributors. |
|
2 // Licensed under the MIT License. |
|
3 |
|
4 #include "pch.h" |
|
5 |
|
6 #include "App.xaml.h" |
|
7 #include "MainWindow.xaml.h" |
|
8 |
|
9 #include "toolkit.h" |
|
10 |
|
11 using namespace winrt; |
|
12 using namespace Windows::Foundation; |
|
13 using namespace Microsoft::UI::Xaml; |
|
14 using namespace Microsoft::UI::Xaml::Controls; |
|
15 using namespace Microsoft::UI::Xaml::Navigation; |
|
16 using namespace winui; |
|
17 using namespace winui::implementation; |
|
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 /// <summary> |
|
23 /// Initializes the singleton application object. This is the first line of authored code |
|
24 /// executed, and as such is the logical equivalent of main() or WinMain(). |
|
25 /// </summary> |
|
26 App::App() |
|
27 { |
|
28 InitializeComponent(); |
|
29 |
|
30 #if defined _DEBUG && !defined DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION |
|
31 UnhandledException([this](IInspectable const&, UnhandledExceptionEventArgs const& e) |
|
32 { |
|
33 if (IsDebuggerPresent()) |
|
34 { |
|
35 auto errorMessage = e.Message(); |
|
36 __debugbreak(); |
|
37 } |
|
38 }); |
|
39 #endif |
|
40 } |
|
41 |
|
42 /// <summary> |
|
43 /// Invoked when the application is launched. |
|
44 /// </summary> |
|
45 /// <param name="e">Details about the launch request and process.</param> |
|
46 void App::OnLaunched(LaunchActivatedEventArgs const&) |
|
47 { |
|
48 ui_app_run_startup(); |
|
49 //window = make<MainWindow>(); |
|
50 //window.Activate(); |
|
51 } |