how to get a UWP xaml control from a dll to host it in xamlisland

I have a win32 app with a xaml island. I want to host some UserControl which is implemented in a different dll. How do I get the user control from the dll and host it in xaml island. Following is the code I am trying to use.

    m_island = winrt::Windows::UI::Xaml::Hosting::DesktopWindowXamlSource();
    auto modalDialogPage = winrt::ModalDialog::ModalDialogPage();
    m_island.Content(modalDialogPage);

When I can link to the lib which contains ModalDialogPage, it can find and create the ModalDialogPage object. But what about if there is no way to link to the lib and want to load the control written in a dll. Is there a way?

Leave a Comment