ui/winui/window.cpp

branch
newapi
changeset 221
a82d9beaa94a
parent 213
7e39db525fd9
child 226
4eef1d49f794
--- a/ui/winui/window.cpp	Tue Oct 17 21:50:48 2023 +0200
+++ b/ui/winui/window.cpp	Thu Oct 19 18:30:19 2023 +0200
@@ -47,6 +47,7 @@
 using namespace winrt;
 using namespace Microsoft::UI::Xaml;
 using namespace Microsoft::UI::Xaml::Controls;
+using namespace Microsoft::UI::Xaml::Controls::Primitives;
 using namespace Microsoft::UI::Xaml::XamlTypeInfo;
 using namespace Microsoft::UI::Xaml::Markup;
 using namespace Windows::UI::Xaml::Interop;
@@ -61,8 +62,12 @@
 	obj->ctx = uic_context(obj, mp);
 	obj->window = window_data;
 
-	//Window window = Window();
-	Window window = make<winui::implementation::MainWindow>();
+	Window window = Window();
+	//Window window = make<winui::implementation::MainWindow>();
+
+	winrt::Windows::Foundation::Uri resourceLocator{ L"ms-appx:///MainWindow.xaml" };
+	Application::LoadComponent(window, resourceLocator, ComponentResourceLocation::Nested);
+
 	window.ExtendsContentIntoTitleBar(true);
 
 	Grid grid = Grid();

mercurial