@@ -21,30 +21,25 @@ int __stdcall wWinMain(HINSTANCE, HINSTANCE, PWSTR, int)
21
21
auto controller{ winrt::DispatcherQueueController::CreateOnCurrentThread () };
22
22
auto queue = controller.DispatcherQueue ();
23
23
24
- auto compositor = winrt::Compositor ();
25
- auto island = winrt::DrawingIsland (compositor).Island ();
26
-
27
- // Associating the AppWindow with the DispatcherQueue on which the ContentIsland is created
28
- // will ensure that the ContentIsland is Closed when the AppWindow closes.
29
24
auto window = winrt::AppWindow::Create ();
30
25
window.AssociateWithDispatcherQueue (queue);
31
- window.Closing (
32
- [queue](auto &&, auto &&)
26
+ window.Closing ([&](auto &&, auto &&)
33
27
{
34
- // Ensure the DispatcherQueue exits the event loop on close.
35
28
queue.EnqueueEventLoopExit ();
36
29
});
37
30
38
31
window.Title (L" Drawing C++ TestApp" );
39
32
window.Show ();
40
33
41
- // Create a ContentSiteBridge and connect the ContentIsland to it.
34
+ auto compositor = winrt::Compositor ();
35
+ auto drawing = winrt::DrawingIsland (compositor);
36
+
42
37
auto siteBridge = winrt::DesktopChildSiteBridge::Create (compositor, window.Id ());
43
38
siteBridge.ResizePolicy (winrt::ContentSizePolicy::ResizeContentToParentWindow);
44
39
siteBridge.Show ();
45
- siteBridge.Connect (island );
40
+ siteBridge.Connect (drawing. Island () );
46
41
47
- // Move initial focus to the ContentIsland .
42
+ // Move initial focus to the island .
48
43
auto focusNavigationHost = winrt::InputFocusNavigationHost::GetForSiteBridge (siteBridge);
49
44
focusNavigationHost.NavigateFocus (winrt::FocusNavigationRequest::Create (
50
45
winrt::FocusNavigationReason::Programmatic));
0 commit comments