Home
%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CAPPXGENERATEPRIENABLED%3E%3C%2FAPPXGENERATEPRIENABLED%3E%3C%2FSPAN%3Etrue%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CPROJECTPRIINDEXNAME%3E%3C%2FPROJECTPRIINDEXNAME%3E%3C%2FSPAN%3EApp%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CAPPXPACKAGE%3E%3C%2FAPPXPACKAGE%3E%3C%2FSPAN%3Etrue%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%0A%3CP%3EFor%20example%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167326i82E993B58B384109%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%228.png%22%20title%3D%228.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%0A%3CLI%3E%0A%3CP%3ERight%20click%20the%20%3CSTRONG%3E%3CEM%3EMyApp%20(Unloaded)%3C%2FEM%3E%3C%2FSTRONG%3E%20project%2C%20select%20%3CSTRONG%3E%3CEM%3EReload%20Project%3C%2FEM%3E%3C%2FSTRONG%3E.%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERight%20click%20%3CSTRONG%3E%3CEM%3EMainpage.xml%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20select%20%3CSTRONG%3E%3CEM%3ERemove%3C%2FEM%3E%3C%2FSTRONG%3E.%20And%20then%20click%20%3CSTRONG%3E%3CEM%3EDelete%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20200px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167327i35F8FF2A3804B682%2Fimage-size%2Fsmall%3Fv%3D1.0%26amp%3Bpx%3D200%22%20alt%3D%2211.png%22%20title%3D%2211.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ECopy%20App.Xaml%2C%20App.cpp%2C%20App.h%2C%20App.idl%20contents%20to%20overwrite%20current%20ones%3A%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CEM%3EApp.Xaml%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22cb2%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20xml%22%3E%3CCODE%20class%3D%22sourceCode%20xml%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3CXAMLAPPLICATION%3E%3C%2FXAMLAPPLICATION%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20x%3AClass%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22MyApp.App%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22http%3A%2F%2Fschemas.microsoft.com%2Fwinfx%2F2006%2Fxaml%2Fpresentation%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3Ax%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22http%3A%2F%2Fschemas.microsoft.com%2Fwinfx%2F2006%2Fxaml%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3Alocal%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22using%3AMyApp%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3AToolkit%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22using%3AMicrosoft.Toolkit.Win32.UI.XamlHost%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3Ad%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22http%3A%2F%2Fschemas.microsoft.com%2Fexpression%2Fblend%2F2008%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3Amc%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22http%3A%2F%2Fschemas.openxmlformats.org%2Fmarkup-compatibility%2F2006%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20RequestedTheme%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22Light%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20mc%3AIgnorable%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22d%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3CP%3E%3CSTRONG%3E%3CEM%3EApp.cpp%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22cb3%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%22pch.h%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%22App.h%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Eusing%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20winrt%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Eusing%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20Windows%3A%3AUI%3A%3AXaml%3B%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20winrt%3A%3AMyApp%3A%3Aimplementation%3C%2FSPAN%3E%0A%3CSPAN%3E%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20App%3A%3AApp()%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20Initialize()%3B%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20%20%20%20%20AddRef()%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22va%22%3Em_inner%3C%2FSPAN%3E.as%26lt%3B%3A%3AIUnknown%26gt%3B()-%26gt%3BRelease()%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7D%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20App%3A%3A~App()%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20Close()%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7D%3C%2FSPAN%3E%0A%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3CP%3E%3CSTRONG%3E%3CEM%3EApp.h%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22cb4%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22co%22%3E%2F%2F%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22co%22%3E%2F%2F%20Declaration%20of%20the%20App%20class.%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22co%22%3E%2F%2F%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23pragma%20once%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%22App.g.h%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%22App.base.h%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20winrt%3A%3AMyApp%3A%3Aimplementation%3C%2FSPAN%3E%0A%3CSPAN%3E%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3Eclass%3C%2FSPAN%3E%20App%20%3A%20%3CSPAN%20class%3D%22kw%22%3Epublic%3C%2FSPAN%3E%20AppT2%3CAPP%3E%3C%2FAPP%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3Epublic%3C%2FSPAN%3E%3A%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20App()%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20~App()%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7D%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%7D%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20winrt%3A%3AMyApp%3A%3Afactory_implementation%3C%2FSPAN%3E%0A%3CSPAN%3E%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3Eclass%3C%2FSPAN%3E%20App%20%3A%20%3CSPAN%20class%3D%22kw%22%3Epublic%3C%2FSPAN%3E%20AppT%3CAPP%3E%3C%2FAPP%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7D%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3CP%3E%3CSTRONG%3E%3CEM%3EApp.idl%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22cb5%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20MyApp%3C%2FSPAN%3E%0A%3CSPAN%3E%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%5Bdefault_interface%5D%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20runtimeclass%20App%3A%20Microsoft.Toolkit.Win32.UI.XamlHost.XamlApplication%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20App()%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7D%3C%2FSPAN%3E%0A%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ECreate%20app.base.h%20in%20this%20MyApp%20project%2C%20and%20use%20below%20content%3A%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CEM%3Eapp.base.h%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22cb6%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23pragma%20once%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20winrt%3A%3AMyApp%3A%3Aimplementation%3C%2FSPAN%3E%0A%3CSPAN%3E%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3Etemplate%3C%2FSPAN%3E%20%26lt%3B%3CSPAN%20class%3D%22kw%22%3Etypename%3C%2FSPAN%3E%20D%2C%20%3CSPAN%20class%3D%22kw%22%3Etypename%3C%2FSPAN%3E...%20I%26gt%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3Estruct%3C%2FSPAN%3E%20App_baseWithProvider%20%3A%20%3CSPAN%20class%3D%22kw%22%3Epublic%3C%2FSPAN%3E%20App_base%3CD%3E%3C%2FD%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3Eusing%3C%2FSPAN%3E%20IXamlType%20%3D%20%3A%3Awinrt%3A%3AWindows%3A%3AUI%3A%3AXaml%3A%3AMarkup%3A%3AIXamlType%3B%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20%20%20%20%20IXamlType%20GetXamlType(%3A%3Awinrt%3A%3AWindows%3A%3AUI%3A%3AXaml%3A%3AInterop%3A%3ATypeName%20%3CSPAN%20class%3D%22at%22%3Econst%3C%2FSPAN%3E%26amp%3B%20type)%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22cf%22%3Ereturn%3C%2FSPAN%3E%20AppProvider()-%26gt%3BGetXamlType(type)%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%7D%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20%20%20%20%20IXamlType%20GetXamlType(%3A%3Awinrt%3A%3Ahstring%20%3CSPAN%20class%3D%22at%22%3Econst%3C%2FSPAN%3E%26amp%3B%20fullName)%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22cf%22%3Ereturn%3C%2FSPAN%3E%20AppProvider()-%26gt%3BGetXamlType(fullName)%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%7D%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3A%3Awinrt%3A%3Acom_array%26lt%3B%3A%3Awinrt%3A%3AWindows%3A%3AUI%3A%3AXaml%3A%3AMarkup%3A%3AXmlnsDefinition%26gt%3B%20GetXmlnsDefinitions()%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22cf%22%3Ereturn%3C%2FSPAN%3E%20AppProvider()-%26gt%3BGetXmlnsDefinitions()%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%7D%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3Eprivate%3C%2FSPAN%3E%3A%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22dt%22%3Ebool%3C%2FSPAN%3E%20_contentLoaded%7B%20%3CSPAN%20class%3D%22kw%22%3Efalse%3C%2FSPAN%3E%20%7D%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22bu%22%3Estd%3A%3A%3C%2FSPAN%3Eshared_ptr%3CXAMLMETADATAPROVIDER%3E%20_appProvider%3B%3C%2FXAMLMETADATAPROVIDER%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22bu%22%3Estd%3A%3A%3C%2FSPAN%3Eshared_ptr%3CXAMLMETADATAPROVIDER%3E%20AppProvider()%3C%2FXAMLMETADATAPROVIDER%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22cf%22%3Eif%3C%2FSPAN%3E%20(!_appProvider)%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20_appProvider%20%3D%20%3CSPAN%20class%3D%22bu%22%3Estd%3A%3A%3C%2FSPAN%3Emake_shared%3CXAMLMETADATAPROVIDER%3E()%3B%3C%2FXAMLMETADATAPROVIDER%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%20%20%20%20%7D%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22cf%22%3Ereturn%3C%2FSPAN%3E%20_appProvider%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%7D%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7D%3B%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3Etemplate%3C%2FSPAN%3E%20%26lt%3B%3CSPAN%20class%3D%22kw%22%3Etypename%3C%2FSPAN%3E%20D%2C%20%3CSPAN%20class%3D%22kw%22%3Etypename%3C%2FSPAN%3E...%20I%26gt%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3Eusing%3C%2FSPAN%3E%20AppT2%20%3D%20App_baseWithProvider%3CD%3E%3B%3C%2FD%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%7D%3C%2FSPAN%3E%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EInstall%20%3CA%20href%3D%22https%3A%2F%2Fwww.nuget.org%2Fpackages%2FMicrosoft.Toolkit.Win32.UI.XamlApplication%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EMicrosoft.Toolkit.Win32.UI.XamlApplication%3C%2FA%3E%20Nuget%20package.%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EIf%20you%20build%20%3CSTRONG%3E%3CEM%3EMyApp%3C%2FEM%3E%3C%2FSTRONG%3E%20now%2C%20it%20should%20create%20MyApp.dll%20without%20any%20error.%3C%2FP%3E%0A%3C%2FLI%3E%0A%0A%3CH2%20id%3D%22centralize-output-input-and-cwinrt-files-in-solution%22%20id%3D%22toc-hId--54226730%22%20id%3D%22toc-hId--54226570%22%20id%3D%22toc-hId--1414343310%22%20id%3D%22toc-hId--1414343310%22%3ECentralize%20Output%2C%20Input%20and%20C%2B%2B%2FWinRT%20files%20in%20Solution%3C%2FH2%3E%0A%3CP%3EThis%20step%20is%20necessary%20for%20our%20next%20steps%20because%20we%20need%20to%20include%20winrt%20header%20files%20in%20different%20projects%20properly%2C%20and%20MFCApp%20also%20needs%20to%20reference%20MyApp%20resource%20files.%3C%2FP%3E%0A%3COL%20type%3D%221%22%3E%0A%3CLI%3E%0A%3CP%3EAdd%20a%20new%20%3CSTRONG%3E%3CEM%3ESolution.Props%3C%2FEM%3E%3C%2FSTRONG%3E%20file%20by%20right%20clicking%20the%20%3CSTRONG%3E%3CEM%3Esolution%3C%2FEM%3E%3C%2FSTRONG%3E%20node%2C%20and%20select%20Add%20-%26gt%3B%20New%20Item%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167328i9559155B22C64DF3%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%2213.png%22%20title%3D%2213.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EUse%20below%20content%20to%20overwrite%20the%20Solution.Props%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22cb7%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20xml%22%3E%3CCODE%20class%3D%22sourceCode%20xml%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3CSPAN%20class%3D%22kw%22%3E%3F%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3CPROJECT%3E%3C%2FPROJECT%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20xmlns%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22http%3A%2F%2Fschemas.microsoft.com%2Fdeveloper%2Fmsbuild%2F2003%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%3CSPAN%20class%3D%22kw%22%3E%3CPROPERTYGROUP%3E%3C%2FPROPERTYGROUP%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CINTDIR%3E%3C%2FINTDIR%3E%3C%2FSPAN%3E%24(SolutionDir)%5Cobj%5C%24(Platform)%5C%24(Configuration)%5C%24(MSBuildProjectName)%5C%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3COUTDIR%3E%3C%2FOUTDIR%3E%3C%2FSPAN%3E%24(SolutionDir)%5Cbin%5C%24(Platform)%5C%24(Configuration)%5C%24(MSBuildProjectName)%5C%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CGENERATEDFILESDIR%3E%3C%2FGENERATEDFILESDIR%3E%3C%2FSPAN%3E%24(IntDir)Generated%20Files%5C%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EClick%20Views%20-%26gt%3B%20Other%20Windows%20-%26gt%3B%20Property%20Manager%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20200px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167329i856685A95450AF93%2Fimage-size%2Fsmall%3Fv%3D1.0%26amp%3Bpx%3D200%22%20alt%3D%2212.png%22%20title%3D%2212.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERight%20click%20%3CSTRONG%3E%3CEM%3ESimpleApp%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20select%20%3CSTRONG%3E%3CEM%3EAdd%20Existing%20Property%20Sheet%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20add%20the%20new%20%3CSTRONG%3E%3CEM%3Esolution.props%3C%2FEM%3E%3C%2FSTRONG%3E%20file%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167330i4D68B095F20CDFE4%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%2213.png%22%20title%3D%2213.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERepeat%20the%20step%204.%20for%20%3CSTRONG%3E%3CEM%3EMyApp%3C%2FEM%3E%3C%2FSTRONG%3E.%20We%20can%20close%20the%20Property%20Manager%20window%20now.%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERight%20click%20the%20project%20node%20%3CSTRONG%3E%3CEM%3EMFCApp%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20select%20Properties.%3C%2FP%3E%0A%3CP%3EIf%20you%20see%20the%20Outut%20and%20Intermidiate%20directries%20are%20already%20become%20as%20below%2C%20then%20can%20skip%20this%20step%3A%3C%2FP%3E%0A%3CP%3E%24(SolutionDir)%24(Platform)%24(Configuration)%24(MSBuildProjectName)%3CBR%20%2F%3Eand%20%24(SolutionDir)%24(Platform)%24(Configuration)%24(MSBuildProjectName)%3C%2FP%3E%0A%3CP%3EOtherwise%20please%20manually%20set%EF%BC%9A%3C%2FP%3E%0A%3CP%3EOutput%20Directory%3A%20%24(OutDir)%3C%2FP%3E%0A%3CP%3EIntermidia%20Directory%3A%20%24(IntDir)%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167331i6CABD54FCFDC00E3%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%2212.png%22%20title%3D%2212.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERepeat%20the%20step%206%20for%20%3CSTRONG%3E%3CEM%3EMyApp%3C%2FEM%3E%3C%2FSTRONG%3E.%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERight%20click%20the%20Solution%20node%2C%20and%20choose%20%3CSTRONG%3E%3CEM%3EProject%20Dependencies%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20make%20sure%20SimpleApp%20depends%20on%20MyApp%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20357px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167332i9D195788C147016B%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%2215.png%22%20title%3D%2215.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERebuild%20the%20whole%20solution%2C%20it%20should%20work%20without%20errors.%3C%2FP%3E%0A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CH2%20id%3D%22add-uwp-custom-xaml-control-to-myapp%22%20id%3D%22toc-hId--1861681193%22%20id%3D%22toc-hId--1861681033%22%20id%3D%22toc-hId-1073169523%22%20id%3D%22toc-hId-1073169523%22%3EAdd%20UWP%20Custom%20XAML%20Control%20to%20MyApp%3C%2FH2%3E%0A%3COL%20type%3D%221%22%3E%0A%3CLI%3E%0A%3CP%3ERight%20click%20%3CSTRONG%3E%3CEM%3EMyApp%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20select%20Add%20-%26gt%3B%20New%20Item%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ECreate%20%3CSTRONG%3E%3CEM%3EBlank%20User%20Conrol%20(C%2B%2B%2FWinRT)%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20here%20we%20call%20it%20MainUserControl%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167333i9DA901C8378FEB50%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%2216.png%22%20title%3D%2216.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CH2%20id%3D%22integrate-custom-xaml-control-in-simpleapp%22%20id%3D%22toc-hId-625831640%22%20id%3D%22toc-hId-625831800%22%20id%3D%22toc-hId--734284940%22%20id%3D%22toc-hId--734284940%22%3EIntegrate%20Custom%20XAML%20Control%20in%20SimpleApp%3C%2FH2%3E%0A%3COL%20type%3D%221%22%3E%0A%3CLI%3E%0A%3CP%3EAdd%20one%20XML%20file%20%3CSTRONG%3Eapp.manifest%3C%2FSTRONG%3E%20in%20your%20project%20with%20below%20content%20to%20register%20custom%20control%20type%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22cb8%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20xml%22%3E%3CCODE%20class%3D%22sourceCode%20xml%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%20version%3D%221.0%22%20encoding%3D%22utf-8%22%20standalone%3D%22yes%22%3CSPAN%20class%3D%22kw%22%3E%3F%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3CASSEMBLY%3E%3C%2FASSEMBLY%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22urn%3Aschemas-microsoft-com%3Aasm.v1%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3Aasmv3%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22urn%3Aschemas-microsoft-com%3Aasm.v3%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20manifestVersion%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%221.0%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CFILE%3E%3C%2FFILE%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20name%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22MyApp.dll%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CACTIVATABLECLASS%3E%3C%2FACTIVATABLECLASS%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20name%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22MyApp.App%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20threadingModel%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22both%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20xmlns%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22urn%3Aschemas-microsoft-com%3Awinrt.v1%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3E%2F%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CACTIVATABLECLASS%3E%3C%2FACTIVATABLECLASS%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20name%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22MyApp.XamlMetadataProvider%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20threadingModel%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22both%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20xmlns%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22urn%3Aschemas-microsoft-com%3Awinrt.v1%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3E%2F%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CACTIVATABLECLASS%3E%3C%2FACTIVATABLECLASS%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20name%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22MyApp.MainUserControl%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20threadingModel%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22both%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20xmlns%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22urn%3Aschemas-microsoft-com%3Awinrt.v1%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3E%2F%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ENow%20the%20project%20structure%20is%20like%20as%20below%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20200px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167334i4032DBB55E9D5A79%2Fimage-size%2Fsmall%3Fv%3D1.0%26amp%3Bpx%3D200%22%20alt%3D%2217.png%22%20title%3D%2217.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERight%20click%20the%20Win32%20Project%20%3CSTRONG%3E%3CEM%3ESimpleApp%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20select%20%3CSTRONG%3E%3CEM%3EUnload%20Project%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERight%20click%20the%20%3CSTRONG%3E%3CEM%3ESimpleApp%20(Unloaded)%3C%2FEM%3E%3C%2FSTRONG%3E%20project%2C%20select%20%3CSTRONG%3E%3CEM%3EEdit%20SimpleApp.vcxproj%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERemove%20the%20three%20lines%20from%20the%20%3CSTRONG%3E%3CEM%3ESimpleApp.vcxproj%3C%2FEM%3E%3C%2FSTRONG%3E%20project%20file%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22cb9%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20xml%22%3E%3CCODE%20class%3D%22sourceCode%20xml%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3CITEMGROUP%3E%3C%2FITEMGROUP%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CMANIFEST%3E%3C%2FMANIFEST%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20Include%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22app.manifest%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3E%2F%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3CP%3EAdd%20below%20properties%20to%20the%20%3CSTRONG%3E%3CEM%3ESimpleApp.vcxproj%3C%2FEM%3E%3C%2FSTRONG%3E%20project%20file%20before%20the%20%3CSTRONG%3E%3CEM%3E%E2%80%9C%3CIMPORT%20project%3D%22%E2%80%9D%E2%80%9C%24(VCTargetsPath).Cpp.targets%E2%80%9D%22%3E%3C%2FIMPORT%3E%22%3C%2FEM%3E%3C%2FSTRONG%3E%20line%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22cb10%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20xml%22%3E%3CCODE%20class%3D%22sourceCode%20xml%22%3E%3CSPAN%3E%20%20%3CSPAN%20class%3D%22kw%22%3E%3CITEMGROUP%3E%3C%2FITEMGROUP%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CMANIFEST%3E%3C%2FMANIFEST%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20Include%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22app.manifest%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3E%2F%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CAPPXMANIFEST%3E%3C%2FAPPXMANIFEST%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20Include%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22%24(SolutionDir)%5Cbin%5C%24(Platform)%5C%24(Configuration)%5C%24(AppProjectName)%5CAppxManifest.xml%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3E%2F%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%3CSPAN%20class%3D%22kw%22%3E%3CPROPERTYGROUP%3E%3C%2FPROPERTYGROUP%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CAPPPROJECTNAME%3E%3C%2FAPPPROJECTNAME%3E%3C%2FSPAN%3EMyApp%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%3CSPAN%20class%3D%22kw%22%3E%3CPROPERTYGROUP%3E%3C%2FPROPERTYGROUP%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CAPPINCLUDEDIRECTORIES%3E%3C%2FAPPINCLUDEDIRECTORIES%3E%3C%2FSPAN%3E%24(SolutionDir)%5Cobj%5C%24(Platform)%5C%24(Configuration)%5C%24(AppProjectName)%5C%3B%24(SolutionDir)%5Cobj%5C%24(Platform)%5C%24(Configuration)%5C%24(AppProjectName)%5CGenerated%20Files%5C%3B%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CITEMGROUP%3E%3C%2FITEMGROUP%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CNATIVEREFERENCEFILE%3E%3C%2FNATIVEREFERENCEFILE%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20Include%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22%24(SolutionDir)%5Cbin%5C%24(Platform)%5C%24(Configuration)%5C%24(AppProjectName)%5C*.xbf%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CDEPLOYMENTCONTENT%3E%3C%2FDEPLOYMENTCONTENT%3E%3C%2FSPAN%3Etrue%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CCOPYTOOUTPUTDIRECTORY%3E%3C%2FCOPYTOOUTPUTDIRECTORY%3E%3C%2FSPAN%3EPreserveNewest%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CNATIVEREFERENCEFILE%3E%3C%2FNATIVEREFERENCEFILE%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20Include%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22%24(SolutionDir)%5Cbin%5C%24(Platform)%5C%24(Configuration)%5C%24(AppProjectName)%5C*.dll%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CDEPLOYMENTCONTENT%3E%3C%2FDEPLOYMENTCONTENT%3E%3C%2FSPAN%3Etrue%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CCOPYTOOUTPUTDIRECTORY%3E%3C%2FCOPYTOOUTPUTDIRECTORY%3E%3C%2FSPAN%3EPreserveNewest%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CNATIVEREFERENCEFILE%3E%3C%2FNATIVEREFERENCEFILE%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20Include%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22%24(SolutionDir)%5Cbin%5C%24(Platform)%5C%24(Configuration)%5C%24(AppProjectName)%5Cresources.pri%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CDEPLOYMENTCONTENT%3E%3C%2FDEPLOYMENTCONTENT%3E%3C%2FSPAN%3Etrue%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CCOPYTOOUTPUTDIRECTORY%3E%3C%2FCOPYTOOUTPUTDIRECTORY%3E%3C%2FSPAN%3EPreserveNewest%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%3CSPAN%20class%3D%22er%22%3E%26lt%3B%3C%2FSPAN%3E------Right%20Here---------%26gt%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%3CSPAN%20class%3D%22kw%22%3E%3CIMPORT%3E%3C%2FIMPORT%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20Project%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22%24(VCTargetsPath)%5CMicrosoft.Cpp.targets%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3E%2F%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERight%20click%20the%20%3CSTRONG%3E%3CEM%3ESimpleApp%20(Unloaded)%3C%2FEM%3E%3C%2FSTRONG%3E%20project%2C%20select%20%3CSTRONG%3E%3CEM%3EReload%20Project%3C%2FEM%3E%3C%2FSTRONG%3E.%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERight%20click%20%3CSTRONG%3E%3CEM%3ESimpleApp%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20select%20%3CSTRONG%3E%3CEM%3EProperties%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20setup%20%3CSTRONG%3E%3CEM%3E%24(AppIncludeDirectories)%3C%2FEM%3E%3C%2FSTRONG%3E%20as%20a%20part%20of%20include%20file%20path%2C%20this%20macro%20has%20been%20defined%20in%20the%20above%20project%20file%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167335i3D2A547AD082D4BB%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%2218.png%22%20title%3D%2218.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ESet%20%3CSTRONG%3E%3CEM%3E%E2%80%9CPer%20Monitor%20DPI%20Aware%E2%80%9D%3C%2FEM%3E%3C%2FSTRONG%3E%20for%20%3CSTRONG%3E%3CEM%3EDPI%20Awareness%3C%2FEM%3E%3C%2FSTRONG%3E%20otherwise%20you%20may%20be%20not%20able%20to%20start%20this%20SimpleApp%20when%20it%20is%20%3CSTRONG%3E%3CEM%3E%E2%80%9CHigh%20DPI%20Aware%E2%80%9D%3C%2FEM%3E%3C%2FSTRONG%3E%20and%20hit%20configuration%20error%20in%20Manifest%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20200px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167336i342C4977A08A4745%2Fimage-size%2Fsmall%3Fv%3D1.0%26amp%3Bpx%3D200%22%20alt%3D%2219.png%22%20title%3D%2219.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167337i4A85CE310D203A6A%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%2220.png%22%20title%3D%2220.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EOpen%20framework.h%2C%20remove%20this%20%23define%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22cb11%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23define%20WIN32_LEAN_AND_MEAN%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EIn%20SimpleApp.h%2C%20add%20below%20code%20to%20include%20necessary%20winrt%20header%20files%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22cb12%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%3CWINRT%3E%3C%2FWINRT%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%3CWINRT%3E%3C%2FWINRT%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%3CWINRT%3E%3C%2FWINRT%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%3CWINDOWS.UI.XAML.HOSTING.DESKTOPWINDOWXAMLSOURCE.H%3E%3C%2FWINDOWS.UI.XAML.HOSTING.DESKTOPWINDOWXAMLSOURCE.H%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%3CWINRT%3E%3C%2FWINRT%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%3CWINRT%3E%3C%2FWINRT%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%3CWINRT%3E%3C%2FWINRT%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%3CWINRT%3E%3C%2FWINRT%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EUsing%20winrt%20namespaces%20in%20SimpleAPP.cpp%3C%2FP%3E%0A%3CDIV%20id%3D%22cb13%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Eusing%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20winrt%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Eusing%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20Windows%3A%3AUI%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Eusing%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20Windows%3A%3AUI%3A%3AComposition%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Eusing%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20Windows%3A%3AUI%3A%3AXaml%3A%3AHosting%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Eusing%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20Windows%3A%3AFoundation%3A%3ANumerics%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Eusing%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20Windows%3A%3AUI%3A%3AXaml%3A%3AControls%3B%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EDeclare%20hostApp%2C%20_desktopWindowXamlSource%20and%20our%20custom%20control%20in%20%3CSTRONG%3E%3CEM%3ESimpleApp.cpp%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22cb14%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%20%20%20%20%20%3CSPAN%20class%3D%22co%22%3E%2F%2F%20Global%20Variables%3A%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20HINSTANCE%20hInst%3B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22co%22%3E%2F%2F%20current%20instance%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20WCHAR%20szTitle%5BMAX_LOADSTRING%5D%3B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22co%22%3E%2F%2F%20The%20title%20bar%20text%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20WCHAR%20szWindowClass%5BMAX_LOADSTRING%5D%3B%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22co%22%3E%2F%2F%20the%20main%20window%20class%20name%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%0A%0A%3CSPAN%3E%20%20%20%20winrt%3A%3AMyApp%3A%3AApp%20hostApp%7B%20%3CSPAN%20class%3D%22kw%22%3Enullptr%3C%2FSPAN%3E%20%7D%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20winrt%3A%3AWindows%3A%3AUI%3A%3AXaml%3A%3AHosting%3A%3ADesktopWindowXamlSource%20_desktopWindowXamlSource%7B%20%3CSPAN%20class%3D%22kw%22%3Enullptr%3C%2FSPAN%3E%20%7D%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20winrt%3A%3AMyApp%3A%3AMainUserControl%20_mainUserControl%7B%20%3CSPAN%20class%3D%22kw%22%3Enullptr%3C%2FSPAN%3E%20%7D%3B%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EInitalize%20hostApp%2C%20_desktopWindowXamlSource%20in%20%3CSTRONG%3E%3CEM%3EwWinMain%3C%2FEM%3E%3C%2FSTRONG%3E%20in%20%3CSTRONG%3E%3CEM%3ESimpleApp.CPP%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22cb15%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%20%20%20%20winrt%3A%3Ainit_apartment(winrt%3A%3A%3CSPAN%20class%3D%22dt%22%3Eapartment_type%3C%2FSPAN%3E%3A%3Asingle_threaded)%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20hostApp%20%3D%20winrt%3A%3AMyApp%3A%3AApp%7B%7D%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20_desktopWindowXamlSource%20%3D%20winrt%3A%3AWindows%3A%3AUI%3A%3AXaml%3A%3AHosting%3A%3ADesktopWindowXamlSource%7B%7D%3B%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EAdd%20below%20code%20in%20%3CSTRONG%3E%3CEM%3EInitInstance%3C%2FEM%3E%3C%2FSTRONG%3E%20in%20%3CSTRONG%3E%3CEM%3ESimpleApp.cpp%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22cb16%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22cf%22%3Eif%3C%2FSPAN%3E%20(_desktopWindowXamlSource%20!%3D%20%3CSPAN%20class%3D%22kw%22%3Enullptr%3C%2FSPAN%3E)%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%3CSPAN%20class%3D%22co%22%3E%2F%2F%20Get%20handle%20to%20corewindow%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3Eauto%3C%2FSPAN%3E%20interop%20%3D%20_desktopWindowXamlSource.as%3CIDESKTOPWINDOWXAMLSOURCENATIVE%3E()%3B%3C%2FIDESKTOPWINDOWXAMLSOURCENATIVE%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%3CSPAN%20class%3D%22co%22%3E%2F%2F%20Parent%20the%20DesktopWindowXamlSource%20object%20to%20current%20window%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20check_hresult(interop-%26gt%3BAttachToWindow(hWnd))%3B%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20%20%20%20%3CSPAN%20class%3D%22co%22%3E%2F%2F%20This%20Hwnd%20will%20be%20the%20window%20handler%20for%20the%20Xaml%20Island%3A%20A%20child%20window%20that%20contains%20Xaml.%20%20%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20HWND%20hWndXamlIsland%20%3D%20%3CSPAN%20class%3D%22kw%22%3Enullptr%3C%2FSPAN%3E%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%3CSPAN%20class%3D%22co%22%3E%2F%2F%20Get%20the%20new%20child%20window's%20hwnd%20%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20interop-%26gt%3Bget_WindowHandle(%26amp%3BhWndXamlIsland)%3B%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20%20%20%20RECT%20windowRect%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%3A%3AGetWindowRect(hWnd%2C%20%26amp%3BwindowRect)%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%3A%3ASetWindowPos(hWndXamlIsland%2C%20NULL%2C%20%3CSPAN%20class%3D%22dv%22%3E0%3C%2FSPAN%3E%2C%20%3CSPAN%20class%3D%22dv%22%3E0%3C%2FSPAN%3E%2C%20windowRect.right%20-%20windowRect.left%2C%20windowRect.bottom%20-%20windowRect.top%2C%20SWP_SHOWWINDOW)%3B%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20%20%20%20_mainUserControl%20%3D%20winrt%3A%3AMyApp%3A%3AMainUserControl()%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20_desktopWindowXamlSource.Content(_mainUserControl)%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%7D%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20ShowWindow(hWnd%2C%20nCmdShow)%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20UpdateWindow(hWnd)%3B%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EClean%20up%20resources%20when%20the%20view%20is%20disconstructed%20in%20MFCAppView.cpp%3C%2FP%3E%0A%3CDIV%20id%3D%22cb17%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%20%3CSPAN%20class%3D%22cf%22%3Ecase%3C%2FSPAN%3E%20WM_DESTROY%3A%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20PostQuitMessage(%3CSPAN%20class%3D%22dv%22%3E0%3C%2FSPAN%3E)%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22cf%22%3Eif%3C%2FSPAN%3E%20(_desktopWindowXamlSource%20!%3D%20%3CSPAN%20class%3D%22kw%22%3Enullptr%3C%2FSPAN%3E)%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20_desktopWindowXamlSource.Close()%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20_desktopWindowXamlSource%20%3D%20%3CSPAN%20class%3D%22kw%22%3Enullptr%3C%2FSPAN%3E%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7D%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22cf%22%3Ebreak%3C%2FSPAN%3E%3B%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EAdd%20AdjustLayout%20function%20to%20make%20XAML%20content%20layout%20properly%20in%20SimpleApp.cpp%20%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22cb18%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22dt%22%3Evoid%3C%2FSPAN%3E%20AdjustLayout(HWND%20hWnd)%3C%2FSPAN%3E%0A%3CSPAN%3E%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22cf%22%3Eif%3C%2FSPAN%3E%20(_desktopWindowXamlSource%20!%3D%20%3CSPAN%20class%3D%22kw%22%3Enullptr%3C%2FSPAN%3E)%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3Eauto%3C%2FSPAN%3E%20interop%20%3D%20_desktopWindowXamlSource.as%3CIDESKTOPWINDOWXAMLSOURCENATIVE%3E()%3B%3C%2FIDESKTOPWINDOWXAMLSOURCENATIVE%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20HWND%20xamlHostHwnd%20%3D%20NULL%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20check_hresult(interop-%26gt%3Bget_WindowHandle(%26amp%3BxamlHostHwnd))%3B%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20%20%20%20%20RECT%20windowRect%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3A%3AGetWindowRect(hWnd%2C%20%26amp%3BwindowRect)%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3A%3ASetWindowPos(xamlHostHwnd%2C%20NULL%2C%20%3CSPAN%20class%3D%22dv%22%3E0%3C%2FSPAN%3E%2C%20%3CSPAN%20class%3D%22dv%22%3E0%3C%2FSPAN%3E%2C%20windowRect.right%20-%20windowRect.left%2C%20windowRect.bottom%20-%20windowRect.top%2C%20SWP_SHOWWINDOW)%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7D%3C%2FSPAN%3E%0A%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EIn%20SimpleApp.CPP%20handle%20WM_SIZE%20in%20the%20%3CSTRONG%3E%3CEM%3EWinProc%3C%2FEM%3E%3C%2FSTRONG%3E%20function%3A%20%3CCODE%3EC%2B%2B%20%20%20%20%20%20%20%20%20%20%20%20%20case%20WM_SIZE%3A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20AdjustLayout(hWnd)%3B%3C%2FCODE%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ENow%20you%20can%20build%20and%20run%20this%20SimpleApp.%20It%20should%20display%20a%20button%20in%20the%20central%20of%20view%20window%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167338i5859E356479D4422%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%2221.gif%22%20title%3D%2221.gif%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CH2%20id%3D%22using-ink-control-in-myapp-uwp-project%22%20id%3D%22toc-hId--1181622823%22%20id%3D%22toc-hId--1181622663%22%20id%3D%22toc-hId-1753227893%22%20id%3D%22toc-hId-1753227893%22%3EUsing%20Ink%20Control%20in%20MyApp%20UWP%20Project%3C%2FH2%3E%0A%3COL%20type%3D%221%22%3E%0A%3CLI%3E%0A%3CP%3EAdd%20an%20%3CSTRONG%3E%3CEM%3EAssets%3C%2FEM%3E%3C%2FSTRONG%3E%20file%20folder%20under%20%3CSTRONG%3E%3CEM%3ESimpleApp%3C%2FEM%3E%3C%2FSTRONG%3E%20on%20file%20system%2C%20add%20viewbackground.png%20file.%20And%20then%20create%20a%20new%20filter%20of%20%E2%80%9CAssets%E2%80%9D%2C%20add%20this%20existing%20viewbackground.png%20into%20the%20%3CSTRONG%3E%3CEM%3EAssets%3C%2FEM%3E%3C%2FSTRONG%3E%20filter%3A%3C%2FP%3E%0A%3CP%3ESet%20the%20file%E2%80%99s%20%3CSTRONG%3EContent%3C%2FSTRONG%3E%20property%20as%20%3CSTRONG%3ETrue%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20396px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167339iB1EE728F2DA1708D%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%2222.png%22%20title%3D%2222.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EIf%20you%20cannot%20see%20the%20%3CSTRONG%3E%3CEM%3Eviewbackground.png%3C%2FEM%3E%3C%2FSTRONG%3E%20file%2C%20please%20click%20the%20%E2%80%9CShow%20All%20Files%E2%80%9D%20tool%20icon%20in%20the%20solution%20explorer%20window.%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EAdd%20the%20sample%20png%20file%20into%20%3CSTRONG%3E%3CEM%3EAssets%3C%2FEM%3E%3C%2FSTRONG%3E%20folder%20of%20%3CSTRONG%3E%3CEM%3EMyApp%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20and%20make%20its%20%3CSTRONG%3E%3CEM%3EContent%3C%2FEM%3E%3C%2FSTRONG%3E%20property%20as%20%3CSTRONG%3ETrue%3C%2FSTRONG%3E%20as%20well.%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EModify%20MainUserControl.Xaml%20as%20below%20in%20%3CSTRONG%3E%3CEM%3EMyApp%3C%2FEM%3E%3C%2FSTRONG%3E%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22cb19%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20xml%22%3E%3CCODE%20class%3D%22sourceCode%20xml%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3CUSERCONTROL%3E%3C%2FUSERCONTROL%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20x%3AClass%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22MyApp.MainUserControl%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22http%3A%2F%2Fschemas.microsoft.com%2Fwinfx%2F2006%2Fxaml%2Fpresentation%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3Ax%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22http%3A%2F%2Fschemas.microsoft.com%2Fwinfx%2F2006%2Fxaml%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3Alocal%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22using%3AMyApp%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3Ad%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22http%3A%2F%2Fschemas.microsoft.com%2Fexpression%2Fblend%2F2008%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3Amc%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22http%3A%2F%2Fschemas.openxmlformats.org%2Fmarkup-compatibility%2F2006%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20mc%3AIgnorable%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22d%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CRELATIVEPANEL%3E%3C%2FRELATIVEPANEL%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20HorizontalAlignment%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22Stretch%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20VerticalAlignment%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22Stretch%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CIMAGE%3E%3C%2FIMAGE%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20Source%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22assets%2Fviewbackground.png%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20RelativePanel.AlignLeftWithPanel%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22True%22%3C%2FSPAN%3E%20%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20RelativePanel.AlignRightWithPanel%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22True%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20RelativePanel.AlignHorizontalCenterWithPanel%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22True%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CINKCANVAS%3E%3C%2FINKCANVAS%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20x%3AName%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22ic%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20RelativePanel.AlignLeftWithPanel%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22True%22%3C%2FSPAN%3E%20%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20RelativePanel.AlignRightWithPanel%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22True%22%3C%2FSPAN%3E%20%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20RelativePanel.AlignBottomWithPanel%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22True%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20RelativePanel.AlignTopWithPanel%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22True%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CINKTOOLBAR%3E%3C%2FINKTOOLBAR%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20x%3AName%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22it%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20HorizontalAlignment%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22Left%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20VerticalAlignment%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22Top%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EAdd%20below%20code%20in%20MainUserControl.CPP%2C%20remove%20the%20Button%20ClickHandler%20code%20as%20we%20don%E2%80%99t%20use%20it%20now%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22cb20%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%20%20%20%20MainUserControl%3A%3AMainUserControl()%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20InitializeComponent()%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20ic().InkPresenter().InputDeviceTypes((winrt%3A%3AWindows%3A%3AUI%3A%3ACore%3A%3ACoreInputDeviceTypes)%3CSPAN%20class%3D%22dv%22%3E7%3C%2FSPAN%3E)%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20it().TargetInkCanvas(ic())%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7D%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EInclude%20more%20winrt%20header%20files%20in%20MainUserControl.h%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22cb21%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%3CWINRT%3E%3C%2FWINRT%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%3CWINRT%3E%3C%2FWINRT%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EBuild%20and%20run%20Simple%2C%20if%20steps%20have%20been%20taken%20exactly%20as%20above%2C%20it%20will%20show%20as%20below%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167340i339E79FDCDDCEF04%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%2223.png%22%20title%3D%2223.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EYou%20may%20notice%20that%20it%20doesn%E2%80%99t%20display%20the%20background%20image%2C%20this%20is%20because%20the%20uri%20%3CSTRONG%3Eassets%2Fviewbackground.png%3C%2FSTRONG%3E%20needs%20to%20be%20used%20UWP%20package.%20In%20Visual%20Studio%2C%20with%20%3CSTRONG%3E%E2%80%9CWindows%20Application%20Packaging%20Project%20(C%2B%2B)%E2%80%9D%3C%2FSTRONG%3E%2C%20it%20is%20easily%20to%20packaging%20our%20SimpleApp%20project%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167341i71A911326DB368E5%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%2216.png%22%20title%3D%2216.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3ECreate%20the%20packaging%20project%20in%20the%20solution%2C%20right%20click%20the%20%3CSTRONG%3EApplication%3C%2FSTRONG%3E%20node%2C%20and%20select%20%3CSTRONG%3EAdd%20Reference%3C%2FSTRONG%3E%2C%20add%20SimpleApp.%20Now%20the%20packaging%20project%20structure%20is%20like%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167342i13D3D667EE411FA9%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%2224.png%22%20title%3D%2224.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EFor%20more%20information%20about%20packaging%20project%2C%20refer%20to%3A%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fmsix%2Fdesktop%2Fdesktop-to-uwp-packaging-dot-net%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EPackage%20a%20desktop%20app%20from%20source%20code%20using%20Visual%20Studio%3C%2FA%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EAfter%20this%2C%20choose%20the%20packaging%20project%20as%20Start%20Up%20project%2C%20Ctrl%2BF5%20to%20run%20it.%20We%20can%20see%20the%20expected%20result%20will%20show%20up%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167343iB872CEBBB6F0EF02%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%2225.png%22%20title%3D%2225.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EFurther%20more%2C%20you%20can%20publish%20this%20packaging%20app%20as%20MSIX%20or%20APPX%2C%20and%20easily%20deploy%20it%3A%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fmsix%2Fdesktop%2Fdesktop-to-uwp-r2r%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EPackage%20a%20UWP%20app%20with%20Visual%20Studio%3C%2FA%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CH2%20id%3D%22wrap-up%22%20id%3D%22toc-hId-1305890010%22%20id%3D%22toc-hId-1305890170%22%20id%3D%22toc-hId--54226570%22%20id%3D%22toc-hId--54226570%22%3EWrap%20Up%3C%2FH2%3E%0A%3CP%3EThis%20article%20gives%20detailed%20steps%20on%20how%20to%20leverage%20XamplApplication%20to%20host%20standard%20XAML%20control%20in%20C%2B%2B%20Win32%20project%2C%20with%20this%20method%2C%20it%20is%20flexible%20to%20leverage%20Win10%20Controls%20in%20Win32%20project.%20The%20whole%20sample%20solution%20can%20be%20found%20from%20this%20repo%3A%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Ffreistli%2FModernizeApp%2Ftree%2Fmaster%2FC%252B%252B%2FSimpleApp%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Ffreistli%2FModernizeApp%2Ftree%2Fmaster%2FC%252B%252B%2FSimpleApp%3C%2FA%3E%3C%2FP%3E%0A%3CH2%20id%3D%22further-step%22%20id%3D%22toc-hId--501564453%22%20id%3D%22toc-hId--501564293%22%20id%3D%22toc-hId--1861681033%22%20id%3D%22toc-hId--1861681033%22%3EFurther%20Step%3C%2FH2%3E%0A%3CP%3ETo%20use%20WinUI%202.x%2C%20you%20can%20refer%20to%20this%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Ffreistli%2FModernizeApp%2Fblob%2Fmaster%2FDocs%2FHost%2520Custom%2520UWP%2520Controls%2520in%2520MFC%2520MDI%2520project%2520using%2520XMAL%2520Islands.md%23using-winui-in-uwp-custom-control-in-myapp-uwp-project%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Epart%3C%2FA%3E%20and%20embedded%20it%20in%20your%20C%2B%2B%20project.%20The%20sample%20solution%20is%20also%20ready%20from%20this%20repo%3A%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Ffreistli%2FModernizeApp%2Ftree%2Fmaster%2FC%252B%252B%2FSimpleAppWithWinUI%2FSimpleApp%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Ffreistli%2FModernizeApp%2Ftree%2Fmaster%2FC%252B%252B%2FSimpleAppWithWinUI%2FSimpleApp%3C%2FA%3E.%20Its%20left%20TreeView%20is%20from%20WinUI%202.4%20prerelease%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167344iA94CDECBF87F3DA5%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%2226.png%22%20title%3D%2226.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CAPPXGENERATEPRIENABLED%3E%3C%2FAPPXGENERATEPRIENABLED%3E%3C%2FSPAN%3Etrue%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CPROJECTPRIINDEXNAME%3E%3C%2FPROJECTPRIINDEXNAME%3E%3C%2FSPAN%3EApp%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CAPPXPACKAGE%3E%3C%2FAPPXPACKAGE%3E%3C%2FSPAN%3Etrue%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%0A%3CP%3EFor%20example%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167326i82E993B58B384109%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%228.png%22%20title%3D%228.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%0A%3CLI%3E%0A%3CP%3ERight%20click%20the%20%3CSTRONG%3E%3CEM%3EMyApp%20(Unloaded)%3C%2FEM%3E%3C%2FSTRONG%3E%20project%2C%20select%20%3CSTRONG%3E%3CEM%3EReload%20Project%3C%2FEM%3E%3C%2FSTRONG%3E.%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERight%20click%20%3CSTRONG%3E%3CEM%3EMainpage.xml%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20select%20%3CSTRONG%3E%3CEM%3ERemove%3C%2FEM%3E%3C%2FSTRONG%3E.%20And%20then%20click%20%3CSTRONG%3E%3CEM%3EDelete%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167327i35F8FF2A3804B682%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%2211.png%22%20title%3D%2211.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ECopy%20App.Xaml%2C%20App.cpp%2C%20App.h%2C%20App.idl%20contents%20to%20overwrite%20current%20ones%3A%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CEM%3EApp.Xaml%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22cb2%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20xml%22%3E%3CCODE%20class%3D%22sourceCode%20xml%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3CXAMLAPPLICATION%3E%3C%2FXAMLAPPLICATION%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20x%3AClass%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22MyApp.App%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22http%3A%2F%2Fschemas.microsoft.com%2Fwinfx%2F2006%2Fxaml%2Fpresentation%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3Ax%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22http%3A%2F%2Fschemas.microsoft.com%2Fwinfx%2F2006%2Fxaml%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3Alocal%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22using%3AMyApp%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3AToolkit%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22using%3AMicrosoft.Toolkit.Win32.UI.XamlHost%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3Ad%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22http%3A%2F%2Fschemas.microsoft.com%2Fexpression%2Fblend%2F2008%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3Amc%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22http%3A%2F%2Fschemas.openxmlformats.org%2Fmarkup-compatibility%2F2006%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20RequestedTheme%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22Light%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20mc%3AIgnorable%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22d%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3CP%3E%3CSTRONG%3E%3CEM%3EApp.cpp%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22cb3%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%22pch.h%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%22App.h%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Eusing%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20winrt%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Eusing%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20Windows%3A%3AUI%3A%3AXaml%3B%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20winrt%3A%3AMyApp%3A%3Aimplementation%3C%2FSPAN%3E%0A%3CSPAN%3E%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20App%3A%3AApp()%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20Initialize()%3B%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20%20%20%20%20AddRef()%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22va%22%3Em_inner%3C%2FSPAN%3E.as%26lt%3B%3A%3AIUnknown%26gt%3B()-%26gt%3BRelease()%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7D%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20App%3A%3A~App()%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20Close()%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7D%3C%2FSPAN%3E%0A%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3CP%3E%3CSTRONG%3E%3CEM%3EApp.h%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22cb4%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22co%22%3E%2F%2F%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22co%22%3E%2F%2F%20Declaration%20of%20the%20App%20class.%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22co%22%3E%2F%2F%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23pragma%20once%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%22App.g.h%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%22App.base.h%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20winrt%3A%3AMyApp%3A%3Aimplementation%3C%2FSPAN%3E%0A%3CSPAN%3E%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3Eclass%3C%2FSPAN%3E%20App%20%3A%20%3CSPAN%20class%3D%22kw%22%3Epublic%3C%2FSPAN%3E%20AppT2%3CAPP%3E%3C%2FAPP%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3Epublic%3C%2FSPAN%3E%3A%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20App()%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20~App()%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7D%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%7D%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20winrt%3A%3AMyApp%3A%3Afactory_implementation%3C%2FSPAN%3E%0A%3CSPAN%3E%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3Eclass%3C%2FSPAN%3E%20App%20%3A%20%3CSPAN%20class%3D%22kw%22%3Epublic%3C%2FSPAN%3E%20AppT%3CAPP%3E%3C%2FAPP%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7D%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3CP%3E%3CSTRONG%3E%3CEM%3EApp.idl%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22cb5%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20MyApp%3C%2FSPAN%3E%0A%3CSPAN%3E%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%5Bdefault_interface%5D%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20runtimeclass%20App%3A%20Microsoft.Toolkit.Win32.UI.XamlHost.XamlApplication%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20App()%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7D%3C%2FSPAN%3E%0A%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ECreate%20app.base.h%20in%20this%20MyApp%20project%2C%20and%20use%20below%20content%3A%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CEM%3Eapp.base.h%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22cb6%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23pragma%20once%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20winrt%3A%3AMyApp%3A%3Aimplementation%3C%2FSPAN%3E%0A%3CSPAN%3E%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3Etemplate%3C%2FSPAN%3E%20%26lt%3B%3CSPAN%20class%3D%22kw%22%3Etypename%3C%2FSPAN%3E%20D%2C%20%3CSPAN%20class%3D%22kw%22%3Etypename%3C%2FSPAN%3E...%20I%26gt%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3Estruct%3C%2FSPAN%3E%20App_baseWithProvider%20%3A%20%3CSPAN%20class%3D%22kw%22%3Epublic%3C%2FSPAN%3E%20App_base%3CD%3E%3C%2FD%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3Eusing%3C%2FSPAN%3E%20IXamlType%20%3D%20%3A%3Awinrt%3A%3AWindows%3A%3AUI%3A%3AXaml%3A%3AMarkup%3A%3AIXamlType%3B%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20%20%20%20%20IXamlType%20GetXamlType(%3A%3Awinrt%3A%3AWindows%3A%3AUI%3A%3AXaml%3A%3AInterop%3A%3ATypeName%20%3CSPAN%20class%3D%22at%22%3Econst%3C%2FSPAN%3E%26amp%3B%20type)%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22cf%22%3Ereturn%3C%2FSPAN%3E%20AppProvider()-%26gt%3BGetXamlType(type)%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%7D%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20%20%20%20%20IXamlType%20GetXamlType(%3A%3Awinrt%3A%3Ahstring%20%3CSPAN%20class%3D%22at%22%3Econst%3C%2FSPAN%3E%26amp%3B%20fullName)%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22cf%22%3Ereturn%3C%2FSPAN%3E%20AppProvider()-%26gt%3BGetXamlType(fullName)%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%7D%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3A%3Awinrt%3A%3Acom_array%26lt%3B%3A%3Awinrt%3A%3AWindows%3A%3AUI%3A%3AXaml%3A%3AMarkup%3A%3AXmlnsDefinition%26gt%3B%20GetXmlnsDefinitions()%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22cf%22%3Ereturn%3C%2FSPAN%3E%20AppProvider()-%26gt%3BGetXmlnsDefinitions()%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%7D%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3Eprivate%3C%2FSPAN%3E%3A%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22dt%22%3Ebool%3C%2FSPAN%3E%20_contentLoaded%7B%20%3CSPAN%20class%3D%22kw%22%3Efalse%3C%2FSPAN%3E%20%7D%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22bu%22%3Estd%3A%3A%3C%2FSPAN%3Eshared_ptr%3CXAMLMETADATAPROVIDER%3E%20_appProvider%3B%3C%2FXAMLMETADATAPROVIDER%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22bu%22%3Estd%3A%3A%3C%2FSPAN%3Eshared_ptr%3CXAMLMETADATAPROVIDER%3E%20AppProvider()%3C%2FXAMLMETADATAPROVIDER%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22cf%22%3Eif%3C%2FSPAN%3E%20(!_appProvider)%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20_appProvider%20%3D%20%3CSPAN%20class%3D%22bu%22%3Estd%3A%3A%3C%2FSPAN%3Emake_shared%3CXAMLMETADATAPROVIDER%3E()%3B%3C%2FXAMLMETADATAPROVIDER%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%20%20%20%20%7D%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22cf%22%3Ereturn%3C%2FSPAN%3E%20_appProvider%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%7D%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7D%3B%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3Etemplate%3C%2FSPAN%3E%20%26lt%3B%3CSPAN%20class%3D%22kw%22%3Etypename%3C%2FSPAN%3E%20D%2C%20%3CSPAN%20class%3D%22kw%22%3Etypename%3C%2FSPAN%3E...%20I%26gt%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3Eusing%3C%2FSPAN%3E%20AppT2%20%3D%20App_baseWithProvider%3CD%3E%3B%3C%2FD%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%7D%3C%2FSPAN%3E%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EInstall%20%3CA%20href%3D%22https%3A%2F%2Fwww.nuget.org%2Fpackages%2FMicrosoft.Toolkit.Win32.UI.XamlApplication%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EMicrosoft.Toolkit.Win32.UI.XamlApplication%3C%2FA%3E%20Nuget%20package.%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EIf%20you%20build%20%3CSTRONG%3E%3CEM%3EMyApp%3C%2FEM%3E%3C%2FSTRONG%3E%20now%2C%20it%20should%20create%20MyApp.dll%20without%20any%20error.%3C%2FP%3E%0A%3C%2FLI%3E%0A%0A%3CH2%20id%3D%22centralize-output-input-and-cwinrt-files-in-solution%22%20id%3D%22toc-hId--54226570%22%20id%3D%22toc-hId--635249017%22%20id%3D%22toc-hId-625831800%22%3ECentralize%20Output%2C%20Input%20and%20C%2B%2B%2FWinRT%20files%20in%20Solution%3C%2FH2%3E%0A%3CP%3EThis%20step%20is%20necessary%20for%20our%20next%20steps%20because%20we%20need%20to%20include%20winrt%20header%20files%20in%20different%20projects%20properly%2C%20and%20MFCApp%20also%20needs%20to%20reference%20MyApp%20resource%20files.%3C%2FP%3E%0A%3COL%20type%3D%221%22%3E%0A%3CLI%3E%0A%3CP%3EAdd%20a%20new%20%3CSTRONG%3E%3CEM%3ESolution.Props%3C%2FEM%3E%3C%2FSTRONG%3E%20file%20by%20right%20clicking%20the%20%3CSTRONG%3E%3CEM%3Esolution%3C%2FEM%3E%3C%2FSTRONG%3E%20node%2C%20and%20select%20Add%20-%26gt%3B%20New%20Item%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167328i9559155B22C64DF3%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2213.png%22%20title%3D%2213.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EUse%20below%20content%20to%20overwrite%20the%20Solution.Props%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22cb7%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20xml%22%3E%3CCODE%20class%3D%22sourceCode%20xml%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3CSPAN%20class%3D%22kw%22%3E%3F%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3CPROJECT%3E%3C%2FPROJECT%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20xmlns%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22http%3A%2F%2Fschemas.microsoft.com%2Fdeveloper%2Fmsbuild%2F2003%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%3CSPAN%20class%3D%22kw%22%3E%3CPROPERTYGROUP%3E%3C%2FPROPERTYGROUP%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CINTDIR%3E%3C%2FINTDIR%3E%3C%2FSPAN%3E%24(SolutionDir)%5Cobj%5C%24(Platform)%5C%24(Configuration)%5C%24(MSBuildProjectName)%5C%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3COUTDIR%3E%3C%2FOUTDIR%3E%3C%2FSPAN%3E%24(SolutionDir)%5Cbin%5C%24(Platform)%5C%24(Configuration)%5C%24(MSBuildProjectName)%5C%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CGENERATEDFILESDIR%3E%3C%2FGENERATEDFILESDIR%3E%3C%2FSPAN%3E%24(IntDir)Generated%20Files%5C%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EClick%20Views%20-%26gt%3B%20Other%20Windows%20-%26gt%3B%20Property%20Manager%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20200px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167329i856685A95450AF93%2Fimage-size%2Fsmall%3Fv%3D1.0%26amp%3Bpx%3D200%22%20alt%3D%2212.png%22%20title%3D%2212.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERight%20click%20%3CSTRONG%3E%3CEM%3ESimpleApp%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20select%20%3CSTRONG%3E%3CEM%3EAdd%20Existing%20Property%20Sheet%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20add%20the%20new%20%3CSTRONG%3E%3CEM%3Esolution.props%3C%2FEM%3E%3C%2FSTRONG%3E%20file%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167330i4D68B095F20CDFE4%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%2213.png%22%20title%3D%2213.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERepeat%20the%20step%204.%20for%20%3CSTRONG%3E%3CEM%3EMyApp%3C%2FEM%3E%3C%2FSTRONG%3E.%20We%20can%20close%20the%20Property%20Manager%20window%20now.%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERight%20click%20the%20project%20node%20%3CSTRONG%3E%3CEM%3EMFCApp%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20select%20Properties.%3C%2FP%3E%0A%3CP%3EIf%20you%20see%20the%20Outut%20and%20Intermidiate%20directries%20are%20already%20become%20as%20below%2C%20then%20can%20skip%20this%20step%3A%3C%2FP%3E%0A%3CP%3E%24(SolutionDir)%24(Platform)%24(Configuration)%24(MSBuildProjectName)%3CBR%20%2F%3Eand%20%24(SolutionDir)%24(Platform)%24(Configuration)%24(MSBuildProjectName)%3C%2FP%3E%0A%3CP%3EOtherwise%20please%20manually%20set%EF%BC%9A%3C%2FP%3E%0A%3CP%3EOutput%20Directory%3A%20%24(OutDir)%3C%2FP%3E%0A%3CP%3EIntermidia%20Directory%3A%20%24(IntDir)%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167331i6CABD54FCFDC00E3%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2212.png%22%20title%3D%2212.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERepeat%20the%20step%206%20for%20%3CSTRONG%3E%3CEM%3EMyApp%3C%2FEM%3E%3C%2FSTRONG%3E.%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERight%20click%20the%20Solution%20node%2C%20and%20choose%20%3CSTRONG%3E%3CEM%3EProject%20Dependencies%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20make%20sure%20SimpleApp%20depends%20on%20MyApp%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20357px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167332i9D195788C147016B%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%2215.png%22%20title%3D%2215.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERebuild%20the%20whole%20solution%2C%20it%20should%20work%20without%20errors.%3C%2FP%3E%0A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CH2%20id%3D%22add-uwp-custom-xaml-control-to-myapp%22%20id%3D%22toc-hId--1861681033%22%20id%3D%22toc-hId-1852263816%22%20id%3D%22toc-hId--1181622663%22%3EAdd%20UWP%20Custom%20XAML%20Control%20to%20MyApp%3C%2FH2%3E%0A%3COL%20type%3D%221%22%3E%0A%3CLI%3E%0A%3CP%3ERight%20click%20%3CSTRONG%3E%3CEM%3EMyApp%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20select%20Add%20-%26gt%3B%20New%20Item%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ECreate%20%3CSTRONG%3E%3CEM%3EBlank%20User%20Conrol%20(C%2B%2B%2FWinRT)%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20here%20we%20call%20it%20MainUserControl%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167333i9DA901C8378FEB50%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2216.png%22%20title%3D%2216.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CH2%20id%3D%22integrate-custom-xaml-control-in-simpleapp%22%20id%3D%22toc-hId-625831800%22%20id%3D%22toc-hId-44809353%22%20id%3D%22toc-hId-1305890170%22%3EIntegrate%20Custom%20XAML%20Control%20in%20SimpleApp%3C%2FH2%3E%0A%3COL%20type%3D%221%22%3E%0A%3CLI%3E%0A%3CP%3EAdd%20one%20XML%20file%20%3CSTRONG%3Eapp.manifest%3C%2FSTRONG%3E%20in%20your%20project%20with%20below%20content%20to%20register%20custom%20control%20type%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22cb8%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20xml%22%3E%3CCODE%20class%3D%22sourceCode%20xml%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%20version%3D%221.0%22%20encoding%3D%22utf-8%22%20standalone%3D%22yes%22%3CSPAN%20class%3D%22kw%22%3E%3F%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3CASSEMBLY%3E%3C%2FASSEMBLY%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22urn%3Aschemas-microsoft-com%3Aasm.v1%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3Aasmv3%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22urn%3Aschemas-microsoft-com%3Aasm.v3%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20manifestVersion%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%221.0%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CFILE%3E%3C%2FFILE%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20name%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22MyApp.dll%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CACTIVATABLECLASS%3E%3C%2FACTIVATABLECLASS%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20name%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22MyApp.App%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20threadingModel%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22both%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20xmlns%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22urn%3Aschemas-microsoft-com%3Awinrt.v1%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3E%2F%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CACTIVATABLECLASS%3E%3C%2FACTIVATABLECLASS%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20name%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22MyApp.XamlMetadataProvider%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20threadingModel%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22both%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20xmlns%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22urn%3Aschemas-microsoft-com%3Awinrt.v1%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3E%2F%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CACTIVATABLECLASS%3E%3C%2FACTIVATABLECLASS%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20name%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22MyApp.MainUserControl%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20threadingModel%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22both%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20xmlns%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22urn%3Aschemas-microsoft-com%3Awinrt.v1%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3E%2F%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ENow%20the%20project%20structure%20is%20like%20as%20below%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20200px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167334i4032DBB55E9D5A79%2Fimage-size%2Fsmall%3Fv%3D1.0%26amp%3Bpx%3D200%22%20alt%3D%2217.png%22%20title%3D%2217.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERight%20click%20the%20Win32%20Project%20%3CSTRONG%3E%3CEM%3ESimpleApp%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20select%20%3CSTRONG%3E%3CEM%3EUnload%20Project%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERight%20click%20the%20%3CSTRONG%3E%3CEM%3ESimpleApp%20(Unloaded)%3C%2FEM%3E%3C%2FSTRONG%3E%20project%2C%20select%20%3CSTRONG%3E%3CEM%3EEdit%20SimpleApp.vcxproj%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERemove%20the%20three%20lines%20from%20the%20%3CSTRONG%3E%3CEM%3ESimpleApp.vcxproj%3C%2FEM%3E%3C%2FSTRONG%3E%20project%20file%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22cb9%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20xml%22%3E%3CCODE%20class%3D%22sourceCode%20xml%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3CITEMGROUP%3E%3C%2FITEMGROUP%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CMANIFEST%3E%3C%2FMANIFEST%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20Include%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22app.manifest%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3E%2F%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3CP%3EAdd%20below%20properties%20to%20the%20%3CSTRONG%3E%3CEM%3ESimpleApp.vcxproj%3C%2FEM%3E%3C%2FSTRONG%3E%20project%20file%20before%20the%20%3CSTRONG%3E%3CEM%3E%E2%80%9C%3CIMPORT%20project%3D%22%E2%80%9D%E2%80%9C%24(VCTargetsPath).Cpp.targets%E2%80%9D%22%3E%3C%2FIMPORT%3E%22%3C%2FEM%3E%3C%2FSTRONG%3E%20line%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22cb10%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20xml%22%3E%3CCODE%20class%3D%22sourceCode%20xml%22%3E%3CSPAN%3E%20%20%3CSPAN%20class%3D%22kw%22%3E%3CITEMGROUP%3E%3C%2FITEMGROUP%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CMANIFEST%3E%3C%2FMANIFEST%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20Include%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22app.manifest%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3E%2F%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CAPPXMANIFEST%3E%3C%2FAPPXMANIFEST%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20Include%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22%24(SolutionDir)%5Cbin%5C%24(Platform)%5C%24(Configuration)%5C%24(AppProjectName)%5CAppxManifest.xml%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3E%2F%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%3CSPAN%20class%3D%22kw%22%3E%3CPROPERTYGROUP%3E%3C%2FPROPERTYGROUP%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CAPPPROJECTNAME%3E%3C%2FAPPPROJECTNAME%3E%3C%2FSPAN%3EMyApp%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%3CSPAN%20class%3D%22kw%22%3E%3CPROPERTYGROUP%3E%3C%2FPROPERTYGROUP%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CAPPINCLUDEDIRECTORIES%3E%3C%2FAPPINCLUDEDIRECTORIES%3E%3C%2FSPAN%3E%24(SolutionDir)%5Cobj%5C%24(Platform)%5C%24(Configuration)%5C%24(AppProjectName)%5C%3B%24(SolutionDir)%5Cobj%5C%24(Platform)%5C%24(Configuration)%5C%24(AppProjectName)%5CGenerated%20Files%5C%3B%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CITEMGROUP%3E%3C%2FITEMGROUP%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CNATIVEREFERENCEFILE%3E%3C%2FNATIVEREFERENCEFILE%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20Include%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22%24(SolutionDir)%5Cbin%5C%24(Platform)%5C%24(Configuration)%5C%24(AppProjectName)%5C*.xbf%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CDEPLOYMENTCONTENT%3E%3C%2FDEPLOYMENTCONTENT%3E%3C%2FSPAN%3Etrue%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CCOPYTOOUTPUTDIRECTORY%3E%3C%2FCOPYTOOUTPUTDIRECTORY%3E%3C%2FSPAN%3EPreserveNewest%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CNATIVEREFERENCEFILE%3E%3C%2FNATIVEREFERENCEFILE%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20Include%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22%24(SolutionDir)%5Cbin%5C%24(Platform)%5C%24(Configuration)%5C%24(AppProjectName)%5C*.dll%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CDEPLOYMENTCONTENT%3E%3C%2FDEPLOYMENTCONTENT%3E%3C%2FSPAN%3Etrue%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CCOPYTOOUTPUTDIRECTORY%3E%3C%2FCOPYTOOUTPUTDIRECTORY%3E%3C%2FSPAN%3EPreserveNewest%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CNATIVEREFERENCEFILE%3E%3C%2FNATIVEREFERENCEFILE%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20Include%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22%24(SolutionDir)%5Cbin%5C%24(Platform)%5C%24(Configuration)%5C%24(AppProjectName)%5Cresources.pri%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CDEPLOYMENTCONTENT%3E%3C%2FDEPLOYMENTCONTENT%3E%3C%2FSPAN%3Etrue%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CCOPYTOOUTPUTDIRECTORY%3E%3C%2FCOPYTOOUTPUTDIRECTORY%3E%3C%2FSPAN%3EPreserveNewest%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%3CSPAN%20class%3D%22er%22%3E%26lt%3B%3C%2FSPAN%3E------Right%20Here---------%26gt%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%3CSPAN%20class%3D%22kw%22%3E%3CIMPORT%3E%3C%2FIMPORT%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20Project%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22%24(VCTargetsPath)%5CMicrosoft.Cpp.targets%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3E%2F%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERight%20click%20the%20%3CSTRONG%3E%3CEM%3ESimpleApp%20(Unloaded)%3C%2FEM%3E%3C%2FSTRONG%3E%20project%2C%20select%20%3CSTRONG%3E%3CEM%3EReload%20Project%3C%2FEM%3E%3C%2FSTRONG%3E.%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERight%20click%20%3CSTRONG%3E%3CEM%3ESimpleApp%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20select%20%3CSTRONG%3E%3CEM%3EProperties%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20setup%20%3CSTRONG%3E%3CEM%3E%24(AppIncludeDirectories)%3C%2FEM%3E%3C%2FSTRONG%3E%20as%20a%20part%20of%20include%20file%20path%2C%20this%20macro%20has%20been%20defined%20in%20the%20above%20project%20file%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167335i3D2A547AD082D4BB%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2218.png%22%20title%3D%2218.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ESet%20%3CSTRONG%3E%3CEM%3E%E2%80%9CPer%20Monitor%20DPI%20Aware%E2%80%9D%3C%2FEM%3E%3C%2FSTRONG%3E%20for%20%3CSTRONG%3E%3CEM%3EDPI%20Awareness%3C%2FEM%3E%3C%2FSTRONG%3E%20otherwise%20you%20may%20be%20not%20able%20to%20start%20this%20SimpleApp%20when%20it%20is%20%3CSTRONG%3E%3CEM%3E%E2%80%9CHigh%20DPI%20Aware%E2%80%9D%3C%2FEM%3E%3C%2FSTRONG%3E%20and%20hit%20configuration%20error%20in%20Manifest%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167336i342C4977A08A4745%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%2219.png%22%20title%3D%2219.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167337i4A85CE310D203A6A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2220.png%22%20title%3D%2220.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EOpen%20framework.h%2C%20remove%20this%20%23define%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22cb11%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23define%20WIN32_LEAN_AND_MEAN%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EIn%20SimpleApp.h%2C%20add%20below%20code%20to%20include%20necessary%20winrt%20header%20files%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22cb12%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%3CWINRT%3E%3C%2FWINRT%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%3CWINRT%3E%3C%2FWINRT%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%3CWINRT%3E%3C%2FWINRT%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%3CWINDOWS.UI.XAML.HOSTING.DESKTOPWINDOWXAMLSOURCE.H%3E%3C%2FWINDOWS.UI.XAML.HOSTING.DESKTOPWINDOWXAMLSOURCE.H%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%3CWINRT%3E%3C%2FWINRT%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%3CWINRT%3E%3C%2FWINRT%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%3CWINRT%3E%3C%2FWINRT%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%3CWINRT%3E%3C%2FWINRT%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EUsing%20winrt%20namespaces%20in%20SimpleAPP.cpp%3C%2FP%3E%0A%3CDIV%20id%3D%22cb13%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Eusing%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20winrt%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Eusing%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20Windows%3A%3AUI%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Eusing%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20Windows%3A%3AUI%3A%3AComposition%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Eusing%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20Windows%3A%3AUI%3A%3AXaml%3A%3AHosting%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Eusing%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20Windows%3A%3AFoundation%3A%3ANumerics%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Eusing%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20Windows%3A%3AUI%3A%3AXaml%3A%3AControls%3B%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EDeclare%20hostApp%2C%20_desktopWindowXamlSource%20and%20our%20custom%20control%20in%20%3CSTRONG%3E%3CEM%3ESimpleApp.cpp%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22cb14%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%20%20%20%20%20%3CSPAN%20class%3D%22co%22%3E%2F%2F%20Global%20Variables%3A%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20HINSTANCE%20hInst%3B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22co%22%3E%2F%2F%20current%20instance%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20WCHAR%20szTitle%5BMAX_LOADSTRING%5D%3B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22co%22%3E%2F%2F%20The%20title%20bar%20text%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20WCHAR%20szWindowClass%5BMAX_LOADSTRING%5D%3B%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22co%22%3E%2F%2F%20the%20main%20window%20class%20name%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%0A%0A%3CSPAN%3E%20%20%20%20winrt%3A%3AMyApp%3A%3AApp%20hostApp%7B%20%3CSPAN%20class%3D%22kw%22%3Enullptr%3C%2FSPAN%3E%20%7D%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20winrt%3A%3AWindows%3A%3AUI%3A%3AXaml%3A%3AHosting%3A%3ADesktopWindowXamlSource%20_desktopWindowXamlSource%7B%20%3CSPAN%20class%3D%22kw%22%3Enullptr%3C%2FSPAN%3E%20%7D%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20winrt%3A%3AMyApp%3A%3AMainUserControl%20_mainUserControl%7B%20%3CSPAN%20class%3D%22kw%22%3Enullptr%3C%2FSPAN%3E%20%7D%3B%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EInitalize%20hostApp%2C%20_desktopWindowXamlSource%20in%20%3CSTRONG%3E%3CEM%3EwWinMain%3C%2FEM%3E%3C%2FSTRONG%3E%20in%20%3CSTRONG%3E%3CEM%3ESimpleApp.CPP%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22cb15%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%20%20%20%20winrt%3A%3Ainit_apartment(winrt%3A%3A%3CSPAN%20class%3D%22dt%22%3Eapartment_type%3C%2FSPAN%3E%3A%3Asingle_threaded)%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20hostApp%20%3D%20winrt%3A%3AMyApp%3A%3AApp%7B%7D%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20_desktopWindowXamlSource%20%3D%20winrt%3A%3AWindows%3A%3AUI%3A%3AXaml%3A%3AHosting%3A%3ADesktopWindowXamlSource%7B%7D%3B%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EAdd%20below%20code%20in%20%3CSTRONG%3E%3CEM%3EInitInstance%3C%2FEM%3E%3C%2FSTRONG%3E%20in%20%3CSTRONG%3E%3CEM%3ESimpleApp.cpp%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22cb16%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22cf%22%3Eif%3C%2FSPAN%3E%20(_desktopWindowXamlSource%20!%3D%20%3CSPAN%20class%3D%22kw%22%3Enullptr%3C%2FSPAN%3E)%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%3CSPAN%20class%3D%22co%22%3E%2F%2F%20Get%20handle%20to%20corewindow%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3Eauto%3C%2FSPAN%3E%20interop%20%3D%20_desktopWindowXamlSource.as%3CIDESKTOPWINDOWXAMLSOURCENATIVE%3E()%3B%3C%2FIDESKTOPWINDOWXAMLSOURCENATIVE%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%3CSPAN%20class%3D%22co%22%3E%2F%2F%20Parent%20the%20DesktopWindowXamlSource%20object%20to%20current%20window%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20check_hresult(interop-%26gt%3BAttachToWindow(hWnd))%3B%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20%20%20%20%3CSPAN%20class%3D%22co%22%3E%2F%2F%20This%20Hwnd%20will%20be%20the%20window%20handler%20for%20the%20Xaml%20Island%3A%20A%20child%20window%20that%20contains%20Xaml.%20%20%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20HWND%20hWndXamlIsland%20%3D%20%3CSPAN%20class%3D%22kw%22%3Enullptr%3C%2FSPAN%3E%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%3CSPAN%20class%3D%22co%22%3E%2F%2F%20Get%20the%20new%20child%20window's%20hwnd%20%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20interop-%26gt%3Bget_WindowHandle(%26amp%3BhWndXamlIsland)%3B%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20%20%20%20RECT%20windowRect%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%3A%3AGetWindowRect(hWnd%2C%20%26amp%3BwindowRect)%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%3A%3ASetWindowPos(hWndXamlIsland%2C%20NULL%2C%20%3CSPAN%20class%3D%22dv%22%3E0%3C%2FSPAN%3E%2C%20%3CSPAN%20class%3D%22dv%22%3E0%3C%2FSPAN%3E%2C%20windowRect.right%20-%20windowRect.left%2C%20windowRect.bottom%20-%20windowRect.top%2C%20SWP_SHOWWINDOW)%3B%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20%20%20%20_mainUserControl%20%3D%20winrt%3A%3AMyApp%3A%3AMainUserControl()%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20_desktopWindowXamlSource.Content(_mainUserControl)%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%7D%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20ShowWindow(hWnd%2C%20nCmdShow)%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20UpdateWindow(hWnd)%3B%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EClean%20up%20resources%20when%20the%20view%20is%20disconstructed%20in%20MFCAppView.cpp%3C%2FP%3E%0A%3CDIV%20id%3D%22cb17%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%20%3CSPAN%20class%3D%22cf%22%3Ecase%3C%2FSPAN%3E%20WM_DESTROY%3A%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20PostQuitMessage(%3CSPAN%20class%3D%22dv%22%3E0%3C%2FSPAN%3E)%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22cf%22%3Eif%3C%2FSPAN%3E%20(_desktopWindowXamlSource%20!%3D%20%3CSPAN%20class%3D%22kw%22%3Enullptr%3C%2FSPAN%3E)%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20_desktopWindowXamlSource.Close()%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20_desktopWindowXamlSource%20%3D%20%3CSPAN%20class%3D%22kw%22%3Enullptr%3C%2FSPAN%3E%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7D%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22cf%22%3Ebreak%3C%2FSPAN%3E%3B%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EAdd%20AdjustLayout%20function%20to%20make%20XAML%20content%20layout%20properly%20in%20SimpleApp.cpp%20%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22cb18%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22dt%22%3Evoid%3C%2FSPAN%3E%20AdjustLayout(HWND%20hWnd)%3C%2FSPAN%3E%0A%3CSPAN%3E%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22cf%22%3Eif%3C%2FSPAN%3E%20(_desktopWindowXamlSource%20!%3D%20%3CSPAN%20class%3D%22kw%22%3Enullptr%3C%2FSPAN%3E)%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3Eauto%3C%2FSPAN%3E%20interop%20%3D%20_desktopWindowXamlSource.as%3CIDESKTOPWINDOWXAMLSOURCENATIVE%3E()%3B%3C%2FIDESKTOPWINDOWXAMLSOURCENATIVE%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20HWND%20xamlHostHwnd%20%3D%20NULL%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20check_hresult(interop-%26gt%3Bget_WindowHandle(%26amp%3BxamlHostHwnd))%3B%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20%20%20%20%20RECT%20windowRect%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3A%3AGetWindowRect(hWnd%2C%20%26amp%3BwindowRect)%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3A%3ASetWindowPos(xamlHostHwnd%2C%20NULL%2C%20%3CSPAN%20class%3D%22dv%22%3E0%3C%2FSPAN%3E%2C%20%3CSPAN%20class%3D%22dv%22%3E0%3C%2FSPAN%3E%2C%20windowRect.right%20-%20windowRect.left%2C%20windowRect.bottom%20-%20windowRect.top%2C%20SWP_SHOWWINDOW)%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7D%3C%2FSPAN%3E%0A%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EIn%20SimpleApp.CPP%20handle%20WM_SIZE%20in%20the%20%3CSTRONG%3E%3CEM%3EWinProc%3C%2FEM%3E%3C%2FSTRONG%3E%20function%3A%20%3CCODE%3EC%2B%2B%20%20%20%20%20%20%20%20%20%20%20%20%20case%20WM_SIZE%3A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20AdjustLayout(hWnd)%3B%3C%2FCODE%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ENow%20you%20can%20build%20and%20run%20this%20SimpleApp.%20It%20should%20display%20a%20button%20in%20the%20central%20of%20view%20window%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20856px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167338i5859E356479D4422%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2221.gif%22%20title%3D%2221.gif%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CH2%20id%3D%22using-ink-control-in-myapp-uwp-project%22%20id%3D%22toc-hId--1181622663%22%20id%3D%22toc-hId--1762645110%22%20id%3D%22toc-hId--501564293%22%3EUsing%20Ink%20Control%20in%20MyApp%20UWP%20Project%3C%2FH2%3E%0A%3COL%20type%3D%221%22%3E%0A%3CLI%3E%0A%3CP%3EAdd%20an%20%3CSTRONG%3E%3CEM%3EAssets%3C%2FEM%3E%3C%2FSTRONG%3E%20file%20folder%20under%20%3CSTRONG%3E%3CEM%3ESimpleApp%3C%2FEM%3E%3C%2FSTRONG%3E%20on%20file%20system%2C%20add%20viewbackground.png%20file.%20And%20then%20create%20a%20new%20filter%20of%20%E2%80%9CAssets%E2%80%9D%2C%20add%20this%20existing%20viewbackground.png%20into%20the%20%3CSTRONG%3E%3CEM%3EAssets%3C%2FEM%3E%3C%2FSTRONG%3E%20filter%3A%3C%2FP%3E%0A%3CP%3ESet%20the%20file%E2%80%99s%20%3CSTRONG%3EContent%3C%2FSTRONG%3E%20property%20as%20%3CSTRONG%3ETrue%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20989px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167339iB1EE728F2DA1708D%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2222.png%22%20title%3D%2222.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EIf%20you%20cannot%20see%20the%20%3CSTRONG%3E%3CEM%3Eviewbackground.png%3C%2FEM%3E%3C%2FSTRONG%3E%20file%2C%20please%20click%20the%20%E2%80%9CShow%20All%20Files%E2%80%9D%20tool%20icon%20in%20the%20solution%20explorer%20window.%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EAdd%20the%20sample%20png%20file%20into%20%3CSTRONG%3E%3CEM%3EAssets%3C%2FEM%3E%3C%2FSTRONG%3E%20folder%20of%20%3CSTRONG%3E%3CEM%3EMyApp%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20and%20make%20its%20%3CSTRONG%3E%3CEM%3EContent%3C%2FEM%3E%3C%2FSTRONG%3E%20property%20as%20%3CSTRONG%3ETrue%3C%2FSTRONG%3E%20as%20well.%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EModify%20MainUserControl.Xaml%20as%20below%20in%20%3CSTRONG%3E%3CEM%3EMyApp%3C%2FEM%3E%3C%2FSTRONG%3E%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22cb19%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20xml%22%3E%3CCODE%20class%3D%22sourceCode%20xml%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3CUSERCONTROL%3E%3C%2FUSERCONTROL%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20x%3AClass%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22MyApp.MainUserControl%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22http%3A%2F%2Fschemas.microsoft.com%2Fwinfx%2F2006%2Fxaml%2Fpresentation%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3Ax%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22http%3A%2F%2Fschemas.microsoft.com%2Fwinfx%2F2006%2Fxaml%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3Alocal%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22using%3AMyApp%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3Ad%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22http%3A%2F%2Fschemas.microsoft.com%2Fexpression%2Fblend%2F2008%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3Amc%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22http%3A%2F%2Fschemas.openxmlformats.org%2Fmarkup-compatibility%2F2006%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20mc%3AIgnorable%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22d%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CRELATIVEPANEL%3E%3C%2FRELATIVEPANEL%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20HorizontalAlignment%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22Stretch%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20VerticalAlignment%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22Stretch%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CIMAGE%3E%3C%2FIMAGE%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20Source%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22assets%2Fviewbackground.png%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20RelativePanel.AlignLeftWithPanel%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22True%22%3C%2FSPAN%3E%20%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20RelativePanel.AlignRightWithPanel%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22True%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20RelativePanel.AlignHorizontalCenterWithPanel%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22True%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CINKCANVAS%3E%3C%2FINKCANVAS%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20x%3AName%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22ic%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20RelativePanel.AlignLeftWithPanel%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22True%22%3C%2FSPAN%3E%20%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20RelativePanel.AlignRightWithPanel%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22True%22%3C%2FSPAN%3E%20%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20RelativePanel.AlignBottomWithPanel%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22True%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20RelativePanel.AlignTopWithPanel%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22True%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CINKTOOLBAR%3E%3C%2FINKTOOLBAR%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20x%3AName%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22it%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20HorizontalAlignment%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22Left%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20VerticalAlignment%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22Top%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EAdd%20below%20code%20in%20MainUserControl.CPP%2C%20remove%20the%20Button%20ClickHandler%20code%20as%20we%20don%E2%80%99t%20use%20it%20now%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22cb20%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%20%20%20%20MainUserControl%3A%3AMainUserControl()%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20InitializeComponent()%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20ic().InkPresenter().InputDeviceTypes((winrt%3A%3AWindows%3A%3AUI%3A%3ACore%3A%3ACoreInputDeviceTypes)%3CSPAN%20class%3D%22dv%22%3E7%3C%2FSPAN%3E)%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20it().TargetInkCanvas(ic())%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7D%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EInclude%20more%20winrt%20header%20files%20in%20MainUserControl.h%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22cb21%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%3CWINRT%3E%3C%2FWINRT%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%3CWINRT%3E%3C%2FWINRT%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EBuild%20and%20run%20Simple%2C%20if%20steps%20have%20been%20taken%20exactly%20as%20above%2C%20it%20will%20show%20as%20below%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167340i339E79FDCDDCEF04%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2223.png%22%20title%3D%2223.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EYou%20may%20notice%20that%20it%20doesn%E2%80%99t%20display%20the%20background%20image%2C%20this%20is%20because%20the%20uri%20%3CSTRONG%3Eassets%2Fviewbackground.png%3C%2FSTRONG%3E%20needs%20to%20be%20used%20UWP%20package.%20In%20Visual%20Studio%2C%20with%20%3CSTRONG%3E%E2%80%9CWindows%20Application%20Packaging%20Project%20(C%2B%2B)%E2%80%9D%3C%2FSTRONG%3E%2C%20it%20is%20easily%20to%20packaging%20our%20SimpleApp%20project%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167341i71A911326DB368E5%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2216.png%22%20title%3D%2216.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3ECreate%20the%20packaging%20project%20in%20the%20solution%2C%20right%20click%20the%20%3CSTRONG%3EApplication%3C%2FSTRONG%3E%20node%2C%20and%20select%20%3CSTRONG%3EAdd%20Reference%3C%2FSTRONG%3E%2C%20add%20SimpleApp.%20Now%20the%20packaging%20project%20structure%20is%20like%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167342i13D3D667EE411FA9%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%2224.png%22%20title%3D%2224.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EFor%20more%20information%20about%20packaging%20project%2C%20refer%20to%3A%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fmsix%2Fdesktop%2Fdesktop-to-uwp-packaging-dot-net%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EPackage%20a%20desktop%20app%20from%20source%20code%20using%20Visual%20Studio%3C%2FA%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EAfter%20this%2C%20choose%20the%20packaging%20project%20as%20Start%20Up%20project%2C%20Ctrl%2BF5%20to%20run%20it.%20We%20can%20see%20the%20expected%20result%20will%20show%20up%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167343iB872CEBBB6F0EF02%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2225.png%22%20title%3D%2225.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EFurther%20more%2C%20you%20can%20publish%20this%20packaging%20app%20as%20MSIX%20or%20APPX%2C%20and%20easily%20deploy%20it%3A%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fmsix%2Fdesktop%2Fdesktop-to-uwp-r2r%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EPackage%20a%20UWP%20app%20with%20Visual%20Studio%3C%2FA%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CH2%20id%3D%22wrap-up%22%20id%3D%22toc-hId-1305890170%22%20id%3D%22toc-hId-724867723%22%20id%3D%22toc-hId--635249017%22%3EWrap%20Up%3C%2FH2%3E%0A%3CP%3EThis%20article%20gives%20detailed%20steps%20on%20how%20to%20leverage%20XamplApplication%20to%20host%20standard%20XAML%20control%20in%20C%2B%2B%20Win32%20project%2C%20with%20this%20method%2C%20it%20is%20flexible%20to%20leverage%20Win10%20Controls%20in%20Win32%20project.%20The%20whole%20sample%20solution%20can%20be%20found%20from%20this%20repo%3A%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Ffreistli%2FModernizeApp%2Ftree%2Fmaster%2FC%252B%252B%2FSimpleApp%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Ffreistli%2FModernizeApp%2Ftree%2Fmaster%2FC%252B%252B%2FSimpleApp%3C%2FA%3E%3C%2FP%3E%0A%3CH2%20id%3D%22further-step%22%20id%3D%22toc-hId--501564293%22%20id%3D%22toc-hId--1082586740%22%20id%3D%22toc-hId-1852263816%22%3EFurther%20Step%3C%2FH2%3E%0A%3CP%3ETo%20use%20WinUI%202.x%2C%20you%20can%20refer%20to%20this%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Ffreistli%2FModernizeApp%2Fblob%2Fmaster%2FDocs%2FHost%2520Custom%2520UWP%2520Controls%2520in%2520MFC%2520MDI%2520project%2520using%2520XMAL%2520Islands.md%23using-winui-in-uwp-custom-control-in-myapp-uwp-project%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Epart%3C%2FA%3E%20and%20embedded%20it%20in%20your%20C%2B%2B%20project.%20The%20sample%20solution%20is%20also%20ready%20from%20this%20repo%3A%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Ffreistli%2FModernizeApp%2Ftree%2Fmaster%2FC%252B%252B%2FSimpleAppWithWinUI%2FSimpleApp%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Ffreistli%2FModernizeApp%2Ftree%2Fmaster%2FC%252B%252B%2FSimpleAppWithWinUI%2FSimpleApp%3C%2FA%3E.%20Its%20left%20TreeView%20is%20from%20WinUI%202.4%20prerelease%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167344iA94CDECBF87F3DA5%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2226.png%22%20title%3D%2226.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1129823%22%20slang%3D%22en-US%22%3EHost%20Custom%20UWP%20Controls%20in%20C%2B%2B%20Win32%20Project%20using%20XAML%20Islands%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1129823%22%20slang%3D%22en-US%22%3E%3CH1%20id%3D%22host-custom-uwp-controls-in-c-win32-project-using-xaml-islands%22%20id%3D%22toc-hId-382608049%22%20id%3D%22toc-hId--84273366%22%3EHost%20Custom%20UWP%20Controls%20in%20C%2B%2B%20Win32%20Project%20using%20XAML%20Islands%3C%2FH1%3E%0A%3CP%3EThis%20article%20explains%20how%20to%20modernize%20C%2B%2B%20Win32%20project%20with%20custom%20UWP%20Controls%20through%20XAML%20Islands%20in%20detail.%20With%20custom%20UWP%20controls%2C%20it%20allows%20us%20to%20define%20control%20layout%20easily%20through%20XAML%20pages.%20Not%20only%20putting%20standard%20UWP%20controls%20into%20the%20custom%20control%2C%20we%20can%20also%20integrate%20other%20custom%20controls%20as%20well%2C%20such%20as%20latest%20WinUI%20controls.%20We%20will%20use%20a%20new%20Xaml%20Application%20project%20to%20bring%20the%20custom%20UWP%20controls%20into%20our%20C%2B%2B%20Win32%20project.%20This%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fapps%2Fdesktop%2Fmodernize%2Fusing-the-xaml-hosting-api%23host-a-custom-uwp-control%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Earticle%3C%2FA%3E%20has%20mentioned%20how%20to%20use%20the%20new%20XAML%20application%20in%20Win32%20C%2B%2B%20application%2C%20we%20will%20give%20more%20detailed%20steps.%3C%2FP%3E%0A%3CP%3EOverall%2C%20in%20our%20solution%2C%20we%20will%20have%20two%20parts%20to%20demonstrate%20this%20method%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CP%3EC%2B%2B%20Win32%20Project%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%3CP%3EA%20companion%20UWP%20app%20project%20that%20defines%20a%20XamlApplication%20object.%3C%2FP%3E%0A%3CP%3EIn%20this%20project%2C%20we%20will%20define%20a%20custom%20UWP%20control%20and%20export%20it%20so%20that%20C%2B%2B%20Win32%20can%20use%20the%20custom%20UWP%20control.%3C%2FP%3E%0A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CH2%20id%3D%22development-environment%22%20id%3D%22toc-hId-1073169523%22%20id%3D%22toc-hId--1762645110%22%3EDevelopment%20Environment%3C%2FH2%3E%0A%3CUL%3E%0A%3CLI%3EVisual%20Studio%202019%20(16.3.6)%3C%2FLI%3E%0A%3CLI%3EWindows%2010%201909%20(18363.476)%3C%2FLI%3E%0A%3CLI%3EWindows%2010%20SDK%20(10.0.18362.1)%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CH2%20id%3D%22configure-c-win32-project%22%20id%3D%22toc-hId--734284940%22%20id%3D%22toc-hId-724867723%22%3EConfigure%20C%2B%2B%20Win32%20Project%3C%2FH2%3E%0A%3COL%20type%3D%221%22%3E%0A%3CLI%3E%3CP%3ECreate%20C%2B%2B%20Win32%20in%20Visual%20Studio%202019%2C%20will%20name%20it%20SimpleApp%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20492px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167310i1A06B85A36604467%2Fimage-dimensions%2F492x87%3Fv%3D1.0%22%20width%3D%22492%22%20height%3D%2287%22%20alt%3D%2201.png%22%20title%3D%2201.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%3CP%3EIn%20Solution%20Explorer%2C%20right-click%20the%20Simple%20project%20node%2C%20click%20%3CSTRONG%3ERetarget%20Project%3C%2FSTRONG%3E%2C%20select%20the%20%3CSTRONG%3E10.0.18362.0%3C%2FSTRONG%3E%20or%20a%20later%20SDK%20release%2C%20and%20then%20click%20OK.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167311i02F2C3C0C734DE84%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%223.png%22%20title%3D%223.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167312i40F8211E31BA806A%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%2202.png%22%20title%3D%2202.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%3CP%3EInstall%20the%20%3CSTRONG%3E%3CEM%3EMicrosoft.Windows.CppWinRT%3C%2FEM%3E%3C%2FSTRONG%3E%20NuGet%20package%3A%3C%2FP%3E%0A%3COL%20type%3D%22a%22%3E%0A%3CLI%3E%3CP%3ERight-click%20the%20project%20in%20Solution%20Explorer%20and%20choose%20%3CSTRONG%3E%3CEM%3EManage%20NuGet%20Packages%3C%2FEM%3E%3C%2FSTRONG%3E.%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%3CP%3ESelect%20the%20Browse%20tab%2C%20search%20for%20the%20%3CSTRONG%3EMicrosoft.Windows.CppWinRT%3C%2FSTRONG%3E%20package%2C%20and%20install%20the%20latest%20version%20of%20this%20package.%3C%2FP%3E%0A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167313i991706D6AD950497%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2203.png%22%20title%3D%2203.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EAfter%20install%20the%20nuget%20package%2C%20check%20the%20SimpleApp%20project%20properties%2C%20you%20will%20notice%20its%20C%2B%2B%20version%20is%20ISO%20C%2B%2B17%2C%20which%20is%20required%20by%20C%2B%2B%2FWinRT%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167314iD58A11F7BAE3595C%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2204.png%22%20title%3D%2204.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EBuild%20this%20SimpleApp%2C%20we%20can%20see%20winrt%20projected%20files%20are%20generated%20in%20the%20%E2%80%9CGenerated%20Files%E2%80%9D%20folder%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167315iED104A4EB6B54BB5%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2205.png%22%20title%3D%2205.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%3CP%3EInstall%20the%20%3CSTRONG%3EMicrosoft.Toolkit.Win32.UI.SDK%3C%2FSTRONG%3E%20NuGet%20package%3A%3C%2FP%3E%0A%3COL%20type%3D%22a%22%3E%0A%3CLI%3EIn%20the%20NuGet%20Package%20Manager%20window%2C%20make%20sure%20that%20Include%20prerelease%20is%20selected.%3C%2FLI%3E%0A%3CLI%3ESelect%20the%20Browse%20tab%2C%20search%20for%20the%20%3CSTRONG%3EMicrosoft.Toolkit.Win32.UI.SDK%3C%2FSTRONG%3E%20package%2C%20and%20install%20version%20v6.0.0%20(or%20Later)%20of%20this%20package.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167316i752FE572CB89AFF4%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2206.png%22%20title%3D%2206.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%3CP%3EInstall%20the%20%3CSTRONG%3E%3CEM%3EMicrosoft.VCRTForwarders.140%3C%2FEM%3E%3C%2FSTRONG%3E%20nuget%20package%20as%20well.%20Running%20Custom%20UWP%20Control%20in%20this%20project%20will%20require%20VC%20libs.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167317i20E695EC5B8366BD%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%227.png%22%20title%3D%227.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CH2%20id%3D%22configure-uwp-project%22%20id%3D%22toc-hId-1753227893%22%20id%3D%22toc-hId--1082586740%22%3EConfigure%20UWP%20Project%3C%2FH2%3E%0A%3COL%20type%3D%221%22%3E%0A%3CLI%3E%3CP%3EIn%20Solution%20Explorer%2C%20right-click%20the%20solution%20node%20and%20select%20Add%20-%26gt%3B%20New%20Project.%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%3CP%3EAdd%20a%20Blank%20App%20(C%2B%2B%2FWinRT)%20project%20to%20your%20solution.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167318i627F8757DB3FC2CB%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%221.png%22%20title%3D%221.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%3CP%3EGive%20it%20a%20name%20%3CSTRONG%3E%3CEM%3EMyApp%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20and%20create%20it%2C%20Make%20sure%20the%20target%20version%20and%20minimum%20version%20are%20%3CSTRONG%3E%3CEM%3Eboth%3C%2FEM%3E%3C%2FSTRONG%3E%20set%20to%20%3CSTRONG%3E%3CEM%3EWindows%2010%2C%20version%201903%3C%2FEM%3E%3C%2FSTRONG%3E%20or%20later.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167319i3681969F9B416309%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%228.png%22%20title%3D%228.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%3CP%3ERight%20click%20the%20MyApp%20and%20open%20its%20properties%2C%20make%20sure%20its%20C%2B%2B%2FWinRT%20configuration%20is%20as%20below%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167320iB90DDF093B187CB0%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%223.png%22%20title%3D%223.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%3CP%3EChange%20its%20output%20type%20from%20.EXE%20to%20%3CSTRONG%3E%3CEM%3EDynamic%20Library%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167321i3C429D3D1389EBD8%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%224.png%22%20title%3D%224.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%3CP%3ESave%20a%20dummy.exe%20into%20the%20%3CSTRONG%3E%3CEM%3EMyApp%3C%2FEM%3E%3C%2FSTRONG%3E%20folder.%20It%20doesn%E2%80%99t%20need%20to%20be%20a%20real%20exe%2C%20just%20input%20%E2%80%9Cdummy%20exe%20file%E2%80%9D%20in%20notepad%2C%20and%20save%20it%20as%20%3CSTRONG%3E%3CEM%3Edummy.exe%3C%2FEM%3E%3C%2FSTRONG%3E.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20200px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167322iED0C9D3FA0203F98%2Fimage-size%2Fsmall%3Fv%3D1.0%26amp%3Bpx%3D200%22%20alt%3D%225.png%22%20title%3D%225.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167323i1F9D713AE26765B4%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%229.png%22%20title%3D%229.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EAdd%20the%20dummy.exe%20into%20MyApp%20project%2C%20and%20make%20sure%20the%20Content%20property%20of%20dummy.exe%20is%20%3CSTRONG%3E%3CEM%3ETrue%3C%2FEM%3E%3C%2FSTRONG%3E.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167324i310F1081B603F9B2%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%2210.png%22%20title%3D%2210.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%3CP%3ENow%20edit%20Package.appxmanifest%2C%20change%20the%20Executable%20attribute%20to%20%E2%80%9Cdummy.exe%E2%80%9D%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167325iCB302692E43AD9F1%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%227.png%22%20title%3D%227.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%3CP%3ERight%20click%20the%20%3CSTRONG%3E%3CEM%3EMyApp%3C%2FEM%3E%3C%2FSTRONG%3E%20project%2C%20select%20%3CSTRONG%3E%3CEM%3EUnload%20Project%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%3CP%3ERight%20click%20the%20%3CSTRONG%3E%3CEM%3EMyApp%20(Unloaded)%3C%2FEM%3E%3C%2FSTRONG%3E%20project%2C%20select%20%3CSTRONG%3E%3CEM%3EEdit%20MyApp.vcxproj%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%3CP%3EAdd%20below%20properties%20to%20the%20%3CSTRONG%3E%3CEM%3EMyApp.vcxproj%3C%2FEM%3E%3C%2FSTRONG%3E%20project%20file%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22cb1%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20xml%22%3E%3CCODE%20class%3D%22sourceCode%20xml%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3CPROPERTYGROUP%3E%3C%2FPROPERTYGROUP%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20Label%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22Globals%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CWINDOWSAPPCONTAINER%3E%3C%2FWINDOWSAPPCONTAINER%3E%3C%2FSPAN%3Etrue%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3C%2FLI%3E%3C%2FOL%3E%3C%2FLINGO-BODY%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CAPPXGENERATEPRIENABLED%3E%3C%2FAPPXGENERATEPRIENABLED%3E%3C%2FSPAN%3Etrue%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CPROJECTPRIINDEXNAME%3E%3C%2FPROJECTPRIINDEXNAME%3E%3C%2FSPAN%3EApp%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CAPPXPACKAGE%3E%3C%2FAPPXPACKAGE%3E%3C%2FSPAN%3Etrue%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%0A%3CP%3EFor%20example%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167326i82E993B58B384109%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%228.png%22%20title%3D%228.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%0A%3CLI%3E%0A%3CP%3ERight%20click%20the%20%3CSTRONG%3E%3CEM%3EMyApp%20(Unloaded)%3C%2FEM%3E%3C%2FSTRONG%3E%20project%2C%20select%20%3CSTRONG%3E%3CEM%3EReload%20Project%3C%2FEM%3E%3C%2FSTRONG%3E.%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERight%20click%20%3CSTRONG%3E%3CEM%3EMainpage.xml%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20select%20%3CSTRONG%3E%3CEM%3ERemove%3C%2FEM%3E%3C%2FSTRONG%3E.%20And%20then%20click%20%3CSTRONG%3E%3CEM%3EDelete%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167327i35F8FF2A3804B682%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%2211.png%22%20title%3D%2211.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ECopy%20App.Xaml%2C%20App.cpp%2C%20App.h%2C%20App.idl%20contents%20to%20overwrite%20current%20ones%3A%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CEM%3EApp.Xaml%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22cb2%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20xml%22%3E%3CCODE%20class%3D%22sourceCode%20xml%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3CXAMLAPPLICATION%3E%3C%2FXAMLAPPLICATION%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20x%3AClass%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22MyApp.App%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22http%3A%2F%2Fschemas.microsoft.com%2Fwinfx%2F2006%2Fxaml%2Fpresentation%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3Ax%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22http%3A%2F%2Fschemas.microsoft.com%2Fwinfx%2F2006%2Fxaml%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3Alocal%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22using%3AMyApp%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3AToolkit%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22using%3AMicrosoft.Toolkit.Win32.UI.XamlHost%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3Ad%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22http%3A%2F%2Fschemas.microsoft.com%2Fexpression%2Fblend%2F2008%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3Amc%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22http%3A%2F%2Fschemas.openxmlformats.org%2Fmarkup-compatibility%2F2006%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20RequestedTheme%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22Light%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20mc%3AIgnorable%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22d%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3CP%3E%3CSTRONG%3E%3CEM%3EApp.cpp%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22cb3%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%22pch.h%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%22App.h%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Eusing%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20winrt%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Eusing%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20Windows%3A%3AUI%3A%3AXaml%3B%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20winrt%3A%3AMyApp%3A%3Aimplementation%3C%2FSPAN%3E%0A%3CSPAN%3E%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20App%3A%3AApp()%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20Initialize()%3B%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20%20%20%20%20AddRef()%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22va%22%3Em_inner%3C%2FSPAN%3E.as%26lt%3B%3A%3AIUnknown%26gt%3B()-%26gt%3BRelease()%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7D%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20App%3A%3A~App()%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20Close()%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7D%3C%2FSPAN%3E%0A%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3CP%3E%3CSTRONG%3E%3CEM%3EApp.h%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22cb4%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22co%22%3E%2F%2F%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22co%22%3E%2F%2F%20Declaration%20of%20the%20App%20class.%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22co%22%3E%2F%2F%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23pragma%20once%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%22App.g.h%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%22App.base.h%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20winrt%3A%3AMyApp%3A%3Aimplementation%3C%2FSPAN%3E%0A%3CSPAN%3E%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3Eclass%3C%2FSPAN%3E%20App%20%3A%20%3CSPAN%20class%3D%22kw%22%3Epublic%3C%2FSPAN%3E%20AppT2%3CAPP%3E%3C%2FAPP%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3Epublic%3C%2FSPAN%3E%3A%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20App()%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20~App()%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7D%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%7D%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20winrt%3A%3AMyApp%3A%3Afactory_implementation%3C%2FSPAN%3E%0A%3CSPAN%3E%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3Eclass%3C%2FSPAN%3E%20App%20%3A%20%3CSPAN%20class%3D%22kw%22%3Epublic%3C%2FSPAN%3E%20AppT%3CAPP%3E%3C%2FAPP%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7D%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3CP%3E%3CSTRONG%3E%3CEM%3EApp.idl%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22cb5%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20MyApp%3C%2FSPAN%3E%0A%3CSPAN%3E%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%5Bdefault_interface%5D%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20runtimeclass%20App%3A%20Microsoft.Toolkit.Win32.UI.XamlHost.XamlApplication%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20App()%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7D%3C%2FSPAN%3E%0A%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ECreate%20app.base.h%20in%20this%20MyApp%20project%2C%20and%20use%20below%20content%3A%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CEM%3Eapp.base.h%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22cb6%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23pragma%20once%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20winrt%3A%3AMyApp%3A%3Aimplementation%3C%2FSPAN%3E%0A%3CSPAN%3E%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3Etemplate%3C%2FSPAN%3E%20%26lt%3B%3CSPAN%20class%3D%22kw%22%3Etypename%3C%2FSPAN%3E%20D%2C%20%3CSPAN%20class%3D%22kw%22%3Etypename%3C%2FSPAN%3E...%20I%26gt%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3Estruct%3C%2FSPAN%3E%20App_baseWithProvider%20%3A%20%3CSPAN%20class%3D%22kw%22%3Epublic%3C%2FSPAN%3E%20App_base%3CD%3E%3C%2FD%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3Eusing%3C%2FSPAN%3E%20IXamlType%20%3D%20%3A%3Awinrt%3A%3AWindows%3A%3AUI%3A%3AXaml%3A%3AMarkup%3A%3AIXamlType%3B%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20%20%20%20%20IXamlType%20GetXamlType(%3A%3Awinrt%3A%3AWindows%3A%3AUI%3A%3AXaml%3A%3AInterop%3A%3ATypeName%20%3CSPAN%20class%3D%22at%22%3Econst%3C%2FSPAN%3E%26amp%3B%20type)%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22cf%22%3Ereturn%3C%2FSPAN%3E%20AppProvider()-%26gt%3BGetXamlType(type)%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%7D%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20%20%20%20%20IXamlType%20GetXamlType(%3A%3Awinrt%3A%3Ahstring%20%3CSPAN%20class%3D%22at%22%3Econst%3C%2FSPAN%3E%26amp%3B%20fullName)%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22cf%22%3Ereturn%3C%2FSPAN%3E%20AppProvider()-%26gt%3BGetXamlType(fullName)%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%7D%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3A%3Awinrt%3A%3Acom_array%26lt%3B%3A%3Awinrt%3A%3AWindows%3A%3AUI%3A%3AXaml%3A%3AMarkup%3A%3AXmlnsDefinition%26gt%3B%20GetXmlnsDefinitions()%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22cf%22%3Ereturn%3C%2FSPAN%3E%20AppProvider()-%26gt%3BGetXmlnsDefinitions()%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%7D%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3Eprivate%3C%2FSPAN%3E%3A%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22dt%22%3Ebool%3C%2FSPAN%3E%20_contentLoaded%7B%20%3CSPAN%20class%3D%22kw%22%3Efalse%3C%2FSPAN%3E%20%7D%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22bu%22%3Estd%3A%3A%3C%2FSPAN%3Eshared_ptr%3CXAMLMETADATAPROVIDER%3E%20_appProvider%3B%3C%2FXAMLMETADATAPROVIDER%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22bu%22%3Estd%3A%3A%3C%2FSPAN%3Eshared_ptr%3CXAMLMETADATAPROVIDER%3E%20AppProvider()%3C%2FXAMLMETADATAPROVIDER%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22cf%22%3Eif%3C%2FSPAN%3E%20(!_appProvider)%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20_appProvider%20%3D%20%3CSPAN%20class%3D%22bu%22%3Estd%3A%3A%3C%2FSPAN%3Emake_shared%3CXAMLMETADATAPROVIDER%3E()%3B%3C%2FXAMLMETADATAPROVIDER%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%20%20%20%20%7D%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22cf%22%3Ereturn%3C%2FSPAN%3E%20_appProvider%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%7D%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7D%3B%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3Etemplate%3C%2FSPAN%3E%20%26lt%3B%3CSPAN%20class%3D%22kw%22%3Etypename%3C%2FSPAN%3E%20D%2C%20%3CSPAN%20class%3D%22kw%22%3Etypename%3C%2FSPAN%3E...%20I%26gt%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3Eusing%3C%2FSPAN%3E%20AppT2%20%3D%20App_baseWithProvider%3CD%3E%3B%3C%2FD%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%7D%3C%2FSPAN%3E%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EInstall%20%3CA%20href%3D%22https%3A%2F%2Fwww.nuget.org%2Fpackages%2FMicrosoft.Toolkit.Win32.UI.XamlApplication%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EMicrosoft.Toolkit.Win32.UI.XamlApplication%3C%2FA%3E%20Nuget%20package.%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EIf%20you%20build%20%3CSTRONG%3E%3CEM%3EMyApp%3C%2FEM%3E%3C%2FSTRONG%3E%20now%2C%20it%20should%20create%20MyApp.dll%20without%20any%20error.%3C%2FP%3E%0A%3C%2FLI%3E%0A%0A%3CH2%20id%3D%22centralize-output-input-and-cwinrt-files-in-solution%22%20id%3D%22toc-hId--54226570%22%20id%3D%22toc-hId-1404926093%22%3ECentralize%20Output%2C%20Input%20and%20C%2B%2B%2FWinRT%20files%20in%20Solution%3C%2FH2%3E%0A%3CP%3EThis%20step%20is%20necessary%20for%20our%20next%20steps%20because%20we%20need%20to%20include%20winrt%20header%20files%20in%20different%20projects%20properly%2C%20and%20MFCApp%20also%20needs%20to%20reference%20MyApp%20resource%20files.%3C%2FP%3E%0A%3COL%20type%3D%221%22%3E%0A%3CLI%3E%0A%3CP%3EAdd%20a%20new%20%3CSTRONG%3E%3CEM%3ESolution.Props%3C%2FEM%3E%3C%2FSTRONG%3E%20file%20by%20right%20clicking%20the%20%3CSTRONG%3E%3CEM%3Esolution%3C%2FEM%3E%3C%2FSTRONG%3E%20node%2C%20and%20select%20Add%20-%26gt%3B%20New%20Item%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167328i9559155B22C64DF3%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2213.png%22%20title%3D%2213.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EUse%20below%20content%20to%20overwrite%20the%20Solution.Props%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22cb7%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20xml%22%3E%3CCODE%20class%3D%22sourceCode%20xml%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3CSPAN%20class%3D%22kw%22%3E%3F%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3CPROJECT%3E%3C%2FPROJECT%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20xmlns%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22http%3A%2F%2Fschemas.microsoft.com%2Fdeveloper%2Fmsbuild%2F2003%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%3CSPAN%20class%3D%22kw%22%3E%3CPROPERTYGROUP%3E%3C%2FPROPERTYGROUP%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CINTDIR%3E%3C%2FINTDIR%3E%3C%2FSPAN%3E%24(SolutionDir)%5Cobj%5C%24(Platform)%5C%24(Configuration)%5C%24(MSBuildProjectName)%5C%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3COUTDIR%3E%3C%2FOUTDIR%3E%3C%2FSPAN%3E%24(SolutionDir)%5Cbin%5C%24(Platform)%5C%24(Configuration)%5C%24(MSBuildProjectName)%5C%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CGENERATEDFILESDIR%3E%3C%2FGENERATEDFILESDIR%3E%3C%2FSPAN%3E%24(IntDir)Generated%20Files%5C%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EClick%20Views%20-%26gt%3B%20Other%20Windows%20-%26gt%3B%20Property%20Manager%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20200px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167329i856685A95450AF93%2Fimage-size%2Fsmall%3Fv%3D1.0%26amp%3Bpx%3D200%22%20alt%3D%2212.png%22%20title%3D%2212.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERight%20click%20%3CSTRONG%3E%3CEM%3ESimpleApp%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20select%20%3CSTRONG%3E%3CEM%3EAdd%20Existing%20Property%20Sheet%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20add%20the%20new%20%3CSTRONG%3E%3CEM%3Esolution.props%3C%2FEM%3E%3C%2FSTRONG%3E%20file%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167330i4D68B095F20CDFE4%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%2213.png%22%20title%3D%2213.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERepeat%20the%20step%204.%20for%20%3CSTRONG%3E%3CEM%3EMyApp%3C%2FEM%3E%3C%2FSTRONG%3E.%20We%20can%20close%20the%20Property%20Manager%20window%20now.%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERight%20click%20the%20project%20node%20%3CSTRONG%3E%3CEM%3EMFCApp%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20select%20Properties.%3C%2FP%3E%0A%3CP%3EIf%20you%20see%20the%20Outut%20and%20Intermidiate%20directries%20are%20already%20become%20as%20below%2C%20then%20can%20skip%20this%20step%3A%3C%2FP%3E%0A%3CP%3E%24(SolutionDir)%24(Platform)%24(Configuration)%24(MSBuildProjectName)%3CBR%20%2F%3Eand%20%24(SolutionDir)%24(Platform)%24(Configuration)%24(MSBuildProjectName)%3C%2FP%3E%0A%3CP%3EOtherwise%20please%20manually%20set%EF%BC%9A%3C%2FP%3E%0A%3CP%3EOutput%20Directory%3A%20%24(OutDir)%3C%2FP%3E%0A%3CP%3EIntermidia%20Directory%3A%20%24(IntDir)%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167331i6CABD54FCFDC00E3%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2212.png%22%20title%3D%2212.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERepeat%20the%20step%206%20for%20%3CSTRONG%3E%3CEM%3EMyApp%3C%2FEM%3E%3C%2FSTRONG%3E.%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERight%20click%20the%20Solution%20node%2C%20and%20choose%20%3CSTRONG%3E%3CEM%3EProject%20Dependencies%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20make%20sure%20SimpleApp%20depends%20on%20MyApp%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20357px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167332i9D195788C147016B%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%2215.png%22%20title%3D%2215.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERebuild%20the%20whole%20solution%2C%20it%20should%20work%20without%20errors.%3C%2FP%3E%0A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CH2%20id%3D%22add-uwp-custom-xaml-control-to-myapp%22%20id%3D%22toc-hId--1861681033%22%20id%3D%22toc-hId--402528370%22%3EAdd%20UWP%20Custom%20XAML%20Control%20to%20MyApp%3C%2FH2%3E%0A%3COL%20type%3D%221%22%3E%0A%3CLI%3E%0A%3CP%3ERight%20click%20%3CSTRONG%3E%3CEM%3EMyApp%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20select%20Add%20-%26gt%3B%20New%20Item%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ECreate%20%3CSTRONG%3E%3CEM%3EBlank%20User%20Conrol%20(C%2B%2B%2FWinRT)%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20here%20we%20call%20it%20MainUserControl%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167333i9DA901C8378FEB50%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2216.png%22%20title%3D%2216.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CH2%20id%3D%22integrate-custom-xaml-control-in-simpleapp%22%20id%3D%22toc-hId-625831800%22%20id%3D%22toc-hId-2084984463%22%3EIntegrate%20Custom%20XAML%20Control%20in%20SimpleApp%3C%2FH2%3E%0A%3COL%20type%3D%221%22%3E%0A%3CLI%3E%0A%3CP%3EAdd%20one%20XML%20file%20%3CSTRONG%3Eapp.manifest%3C%2FSTRONG%3E%20in%20your%20project%20with%20below%20content%20to%20register%20custom%20control%20type%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22cb8%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20xml%22%3E%3CCODE%20class%3D%22sourceCode%20xml%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%20version%3D%221.0%22%20encoding%3D%22utf-8%22%20standalone%3D%22yes%22%3CSPAN%20class%3D%22kw%22%3E%3F%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3CASSEMBLY%3E%3C%2FASSEMBLY%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22urn%3Aschemas-microsoft-com%3Aasm.v1%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3Aasmv3%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22urn%3Aschemas-microsoft-com%3Aasm.v3%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20manifestVersion%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%221.0%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CFILE%3E%3C%2FFILE%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20name%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22MyApp.dll%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CACTIVATABLECLASS%3E%3C%2FACTIVATABLECLASS%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20name%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22MyApp.App%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20threadingModel%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22both%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20xmlns%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22urn%3Aschemas-microsoft-com%3Awinrt.v1%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3E%2F%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CACTIVATABLECLASS%3E%3C%2FACTIVATABLECLASS%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20name%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22MyApp.XamlMetadataProvider%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20threadingModel%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22both%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20xmlns%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22urn%3Aschemas-microsoft-com%3Awinrt.v1%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3E%2F%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CACTIVATABLECLASS%3E%3C%2FACTIVATABLECLASS%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20name%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22MyApp.MainUserControl%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20threadingModel%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22both%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20xmlns%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22urn%3Aschemas-microsoft-com%3Awinrt.v1%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3E%2F%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ENow%20the%20project%20structure%20is%20like%20as%20below%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20200px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167334i4032DBB55E9D5A79%2Fimage-size%2Fsmall%3Fv%3D1.0%26amp%3Bpx%3D200%22%20alt%3D%2217.png%22%20title%3D%2217.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERight%20click%20the%20Win32%20Project%20%3CSTRONG%3E%3CEM%3ESimpleApp%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20select%20%3CSTRONG%3E%3CEM%3EUnload%20Project%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERight%20click%20the%20%3CSTRONG%3E%3CEM%3ESimpleApp%20(Unloaded)%3C%2FEM%3E%3C%2FSTRONG%3E%20project%2C%20select%20%3CSTRONG%3E%3CEM%3EEdit%20SimpleApp.vcxproj%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERemove%20the%20three%20lines%20from%20the%20%3CSTRONG%3E%3CEM%3ESimpleApp.vcxproj%3C%2FEM%3E%3C%2FSTRONG%3E%20project%20file%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22cb9%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20xml%22%3E%3CCODE%20class%3D%22sourceCode%20xml%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3CITEMGROUP%3E%3C%2FITEMGROUP%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CMANIFEST%3E%3C%2FMANIFEST%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20Include%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22app.manifest%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3E%2F%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3CP%3EAdd%20below%20properties%20to%20the%20%3CSTRONG%3E%3CEM%3ESimpleApp.vcxproj%3C%2FEM%3E%3C%2FSTRONG%3E%20project%20file%20before%20the%20%3CSTRONG%3E%3CEM%3E%E2%80%9C%3CIMPORT%20project%3D%22%E2%80%9D%E2%80%9C%24(VCTargetsPath).Cpp.targets%E2%80%9D%22%3E%3C%2FIMPORT%3E%22%3C%2FEM%3E%3C%2FSTRONG%3E%20line%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22cb10%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20xml%22%3E%3CCODE%20class%3D%22sourceCode%20xml%22%3E%3CSPAN%3E%20%20%3CSPAN%20class%3D%22kw%22%3E%3CITEMGROUP%3E%3C%2FITEMGROUP%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CMANIFEST%3E%3C%2FMANIFEST%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20Include%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22app.manifest%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3E%2F%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CAPPXMANIFEST%3E%3C%2FAPPXMANIFEST%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20Include%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22%24(SolutionDir)%5Cbin%5C%24(Platform)%5C%24(Configuration)%5C%24(AppProjectName)%5CAppxManifest.xml%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3E%2F%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%3CSPAN%20class%3D%22kw%22%3E%3CPROPERTYGROUP%3E%3C%2FPROPERTYGROUP%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CAPPPROJECTNAME%3E%3C%2FAPPPROJECTNAME%3E%3C%2FSPAN%3EMyApp%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%3CSPAN%20class%3D%22kw%22%3E%3CPROPERTYGROUP%3E%3C%2FPROPERTYGROUP%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CAPPINCLUDEDIRECTORIES%3E%3C%2FAPPINCLUDEDIRECTORIES%3E%3C%2FSPAN%3E%24(SolutionDir)%5Cobj%5C%24(Platform)%5C%24(Configuration)%5C%24(AppProjectName)%5C%3B%24(SolutionDir)%5Cobj%5C%24(Platform)%5C%24(Configuration)%5C%24(AppProjectName)%5CGenerated%20Files%5C%3B%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CITEMGROUP%3E%3C%2FITEMGROUP%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CNATIVEREFERENCEFILE%3E%3C%2FNATIVEREFERENCEFILE%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20Include%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22%24(SolutionDir)%5Cbin%5C%24(Platform)%5C%24(Configuration)%5C%24(AppProjectName)%5C*.xbf%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CDEPLOYMENTCONTENT%3E%3C%2FDEPLOYMENTCONTENT%3E%3C%2FSPAN%3Etrue%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CCOPYTOOUTPUTDIRECTORY%3E%3C%2FCOPYTOOUTPUTDIRECTORY%3E%3C%2FSPAN%3EPreserveNewest%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CNATIVEREFERENCEFILE%3E%3C%2FNATIVEREFERENCEFILE%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20Include%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22%24(SolutionDir)%5Cbin%5C%24(Platform)%5C%24(Configuration)%5C%24(AppProjectName)%5C*.dll%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CDEPLOYMENTCONTENT%3E%3C%2FDEPLOYMENTCONTENT%3E%3C%2FSPAN%3Etrue%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CCOPYTOOUTPUTDIRECTORY%3E%3C%2FCOPYTOOUTPUTDIRECTORY%3E%3C%2FSPAN%3EPreserveNewest%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CNATIVEREFERENCEFILE%3E%3C%2FNATIVEREFERENCEFILE%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20Include%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22%24(SolutionDir)%5Cbin%5C%24(Platform)%5C%24(Configuration)%5C%24(AppProjectName)%5Cresources.pri%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CDEPLOYMENTCONTENT%3E%3C%2FDEPLOYMENTCONTENT%3E%3C%2FSPAN%3Etrue%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CCOPYTOOUTPUTDIRECTORY%3E%3C%2FCOPYTOOUTPUTDIRECTORY%3E%3C%2FSPAN%3EPreserveNewest%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%3CSPAN%20class%3D%22er%22%3E%26lt%3B%3C%2FSPAN%3E------Right%20Here---------%26gt%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%3CSPAN%20class%3D%22kw%22%3E%3CIMPORT%3E%3C%2FIMPORT%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20Project%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22%24(VCTargetsPath)%5CMicrosoft.Cpp.targets%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3E%2F%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERight%20click%20the%20%3CSTRONG%3E%3CEM%3ESimpleApp%20(Unloaded)%3C%2FEM%3E%3C%2FSTRONG%3E%20project%2C%20select%20%3CSTRONG%3E%3CEM%3EReload%20Project%3C%2FEM%3E%3C%2FSTRONG%3E.%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ERight%20click%20%3CSTRONG%3E%3CEM%3ESimpleApp%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20select%20%3CSTRONG%3E%3CEM%3EProperties%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20setup%20%3CSTRONG%3E%3CEM%3E%24(AppIncludeDirectories)%3C%2FEM%3E%3C%2FSTRONG%3E%20as%20a%20part%20of%20include%20file%20path%2C%20this%20macro%20has%20been%20defined%20in%20the%20above%20project%20file%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167335i3D2A547AD082D4BB%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2218.png%22%20title%3D%2218.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ESet%20%3CSTRONG%3E%3CEM%3E%E2%80%9CPer%20Monitor%20DPI%20Aware%E2%80%9D%3C%2FEM%3E%3C%2FSTRONG%3E%20for%20%3CSTRONG%3E%3CEM%3EDPI%20Awareness%3C%2FEM%3E%3C%2FSTRONG%3E%20otherwise%20you%20may%20be%20not%20able%20to%20start%20this%20SimpleApp%20when%20it%20is%20%3CSTRONG%3E%3CEM%3E%E2%80%9CHigh%20DPI%20Aware%E2%80%9D%3C%2FEM%3E%3C%2FSTRONG%3E%20and%20hit%20configuration%20error%20in%20Manifest%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167336i342C4977A08A4745%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%2219.png%22%20title%3D%2219.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167337i4A85CE310D203A6A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2220.png%22%20title%3D%2220.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EOpen%20framework.h%2C%20remove%20this%20%23define%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22cb11%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23define%20WIN32_LEAN_AND_MEAN%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EIn%20SimpleApp.h%2C%20add%20below%20code%20to%20include%20necessary%20winrt%20header%20files%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22cb12%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%3CWINRT%3E%3C%2FWINRT%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%3CWINRT%3E%3C%2FWINRT%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%3CWINRT%3E%3C%2FWINRT%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%3CWINDOWS.UI.XAML.HOSTING.DESKTOPWINDOWXAMLSOURCE.H%3E%3C%2FWINDOWS.UI.XAML.HOSTING.DESKTOPWINDOWXAMLSOURCE.H%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%3CWINRT%3E%3C%2FWINRT%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%3CWINRT%3E%3C%2FWINRT%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%3CWINRT%3E%3C%2FWINRT%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%3CWINRT%3E%3C%2FWINRT%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EUsing%20winrt%20namespaces%20in%20SimpleAPP.cpp%3C%2FP%3E%0A%3CDIV%20id%3D%22cb13%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Eusing%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20winrt%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Eusing%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20Windows%3A%3AUI%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Eusing%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20Windows%3A%3AUI%3A%3AComposition%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Eusing%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20Windows%3A%3AUI%3A%3AXaml%3A%3AHosting%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Eusing%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20Windows%3A%3AFoundation%3A%3ANumerics%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3Eusing%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22kw%22%3Enamespace%3C%2FSPAN%3E%20Windows%3A%3AUI%3A%3AXaml%3A%3AControls%3B%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EDeclare%20hostApp%2C%20_desktopWindowXamlSource%20and%20our%20custom%20control%20in%20%3CSTRONG%3E%3CEM%3ESimpleApp.cpp%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22cb14%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%20%20%20%20%20%3CSPAN%20class%3D%22co%22%3E%2F%2F%20Global%20Variables%3A%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20HINSTANCE%20hInst%3B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22co%22%3E%2F%2F%20current%20instance%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20WCHAR%20szTitle%5BMAX_LOADSTRING%5D%3B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22co%22%3E%2F%2F%20The%20title%20bar%20text%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20WCHAR%20szWindowClass%5BMAX_LOADSTRING%5D%3B%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22co%22%3E%2F%2F%20the%20main%20window%20class%20name%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%0A%0A%3CSPAN%3E%20%20%20%20winrt%3A%3AMyApp%3A%3AApp%20hostApp%7B%20%3CSPAN%20class%3D%22kw%22%3Enullptr%3C%2FSPAN%3E%20%7D%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20winrt%3A%3AWindows%3A%3AUI%3A%3AXaml%3A%3AHosting%3A%3ADesktopWindowXamlSource%20_desktopWindowXamlSource%7B%20%3CSPAN%20class%3D%22kw%22%3Enullptr%3C%2FSPAN%3E%20%7D%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20winrt%3A%3AMyApp%3A%3AMainUserControl%20_mainUserControl%7B%20%3CSPAN%20class%3D%22kw%22%3Enullptr%3C%2FSPAN%3E%20%7D%3B%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EInitalize%20hostApp%2C%20_desktopWindowXamlSource%20in%20%3CSTRONG%3E%3CEM%3EwWinMain%3C%2FEM%3E%3C%2FSTRONG%3E%20in%20%3CSTRONG%3E%3CEM%3ESimpleApp.CPP%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22cb15%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%20%20%20%20winrt%3A%3Ainit_apartment(winrt%3A%3A%3CSPAN%20class%3D%22dt%22%3Eapartment_type%3C%2FSPAN%3E%3A%3Asingle_threaded)%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20hostApp%20%3D%20winrt%3A%3AMyApp%3A%3AApp%7B%7D%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20_desktopWindowXamlSource%20%3D%20winrt%3A%3AWindows%3A%3AUI%3A%3AXaml%3A%3AHosting%3A%3ADesktopWindowXamlSource%7B%7D%3B%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EAdd%20below%20code%20in%20%3CSTRONG%3E%3CEM%3EInitInstance%3C%2FEM%3E%3C%2FSTRONG%3E%20in%20%3CSTRONG%3E%3CEM%3ESimpleApp.cpp%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22cb16%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22cf%22%3Eif%3C%2FSPAN%3E%20(_desktopWindowXamlSource%20!%3D%20%3CSPAN%20class%3D%22kw%22%3Enullptr%3C%2FSPAN%3E)%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%3CSPAN%20class%3D%22co%22%3E%2F%2F%20Get%20handle%20to%20corewindow%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3Eauto%3C%2FSPAN%3E%20interop%20%3D%20_desktopWindowXamlSource.as%3CIDESKTOPWINDOWXAMLSOURCENATIVE%3E()%3B%3C%2FIDESKTOPWINDOWXAMLSOURCENATIVE%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%3CSPAN%20class%3D%22co%22%3E%2F%2F%20Parent%20the%20DesktopWindowXamlSource%20object%20to%20current%20window%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20check_hresult(interop-%26gt%3BAttachToWindow(hWnd))%3B%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20%20%20%20%3CSPAN%20class%3D%22co%22%3E%2F%2F%20This%20Hwnd%20will%20be%20the%20window%20handler%20for%20the%20Xaml%20Island%3A%20A%20child%20window%20that%20contains%20Xaml.%20%20%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20HWND%20hWndXamlIsland%20%3D%20%3CSPAN%20class%3D%22kw%22%3Enullptr%3C%2FSPAN%3E%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%3CSPAN%20class%3D%22co%22%3E%2F%2F%20Get%20the%20new%20child%20window's%20hwnd%20%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20interop-%26gt%3Bget_WindowHandle(%26amp%3BhWndXamlIsland)%3B%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20%20%20%20RECT%20windowRect%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%3A%3AGetWindowRect(hWnd%2C%20%26amp%3BwindowRect)%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%3A%3ASetWindowPos(hWndXamlIsland%2C%20NULL%2C%20%3CSPAN%20class%3D%22dv%22%3E0%3C%2FSPAN%3E%2C%20%3CSPAN%20class%3D%22dv%22%3E0%3C%2FSPAN%3E%2C%20windowRect.right%20-%20windowRect.left%2C%20windowRect.bottom%20-%20windowRect.top%2C%20SWP_SHOWWINDOW)%3B%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20%20%20%20_mainUserControl%20%3D%20winrt%3A%3AMyApp%3A%3AMainUserControl()%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20_desktopWindowXamlSource.Content(_mainUserControl)%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%7D%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20ShowWindow(hWnd%2C%20nCmdShow)%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20UpdateWindow(hWnd)%3B%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EClean%20up%20resources%20when%20the%20view%20is%20disconstructed%20in%20MFCAppView.cpp%3C%2FP%3E%0A%3CDIV%20id%3D%22cb17%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%20%3CSPAN%20class%3D%22cf%22%3Ecase%3C%2FSPAN%3E%20WM_DESTROY%3A%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20PostQuitMessage(%3CSPAN%20class%3D%22dv%22%3E0%3C%2FSPAN%3E)%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22cf%22%3Eif%3C%2FSPAN%3E%20(_desktopWindowXamlSource%20!%3D%20%3CSPAN%20class%3D%22kw%22%3Enullptr%3C%2FSPAN%3E)%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20_desktopWindowXamlSource.Close()%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20_desktopWindowXamlSource%20%3D%20%3CSPAN%20class%3D%22kw%22%3Enullptr%3C%2FSPAN%3E%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7D%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22cf%22%3Ebreak%3C%2FSPAN%3E%3B%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EAdd%20AdjustLayout%20function%20to%20make%20XAML%20content%20layout%20properly%20in%20SimpleApp.cpp%20%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22cb18%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22dt%22%3Evoid%3C%2FSPAN%3E%20AdjustLayout(HWND%20hWnd)%3C%2FSPAN%3E%0A%3CSPAN%3E%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22cf%22%3Eif%3C%2FSPAN%3E%20(_desktopWindowXamlSource%20!%3D%20%3CSPAN%20class%3D%22kw%22%3Enullptr%3C%2FSPAN%3E)%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3Eauto%3C%2FSPAN%3E%20interop%20%3D%20_desktopWindowXamlSource.as%3CIDESKTOPWINDOWXAMLSOURCENATIVE%3E()%3B%3C%2FIDESKTOPWINDOWXAMLSOURCENATIVE%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20HWND%20xamlHostHwnd%20%3D%20NULL%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20check_hresult(interop-%26gt%3Bget_WindowHandle(%26amp%3BxamlHostHwnd))%3B%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20%20%20%20%20RECT%20windowRect%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3A%3AGetWindowRect(hWnd%2C%20%26amp%3BwindowRect)%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3A%3ASetWindowPos(xamlHostHwnd%2C%20NULL%2C%20%3CSPAN%20class%3D%22dv%22%3E0%3C%2FSPAN%3E%2C%20%3CSPAN%20class%3D%22dv%22%3E0%3C%2FSPAN%3E%2C%20windowRect.right%20-%20windowRect.left%2C%20windowRect.bottom%20-%20windowRect.top%2C%20SWP_SHOWWINDOW)%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7D%3C%2FSPAN%3E%0A%3CSPAN%3E%7D%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EIn%20SimpleApp.CPP%20handle%20WM_SIZE%20in%20the%20%3CSTRONG%3E%3CEM%3EWinProc%3C%2FEM%3E%3C%2FSTRONG%3E%20function%3A%20%3CCODE%3EC%2B%2B%20%20%20%20%20%20%20%20%20%20%20%20%20case%20WM_SIZE%3A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20AdjustLayout(hWnd)%3B%3C%2FCODE%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3ENow%20you%20can%20build%20and%20run%20this%20SimpleApp.%20It%20should%20display%20a%20button%20in%20the%20central%20of%20view%20window%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20856px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167338i5859E356479D4422%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2221.gif%22%20title%3D%2221.gif%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CH2%20id%3D%22using-ink-control-in-myapp-uwp-project%22%20id%3D%22toc-hId--1181622663%22%20id%3D%22toc-hId-277530000%22%3EUsing%20Ink%20Control%20in%20MyApp%20UWP%20Project%3C%2FH2%3E%0A%3COL%20type%3D%221%22%3E%0A%3CLI%3E%0A%3CP%3EAdd%20an%20%3CSTRONG%3E%3CEM%3EAssets%3C%2FEM%3E%3C%2FSTRONG%3E%20file%20folder%20under%20%3CSTRONG%3E%3CEM%3ESimpleApp%3C%2FEM%3E%3C%2FSTRONG%3E%20on%20file%20system%2C%20add%20viewbackground.png%20file.%20And%20then%20create%20a%20new%20filter%20of%20%E2%80%9CAssets%E2%80%9D%2C%20add%20this%20existing%20viewbackground.png%20into%20the%20%3CSTRONG%3E%3CEM%3EAssets%3C%2FEM%3E%3C%2FSTRONG%3E%20filter%3A%3C%2FP%3E%0A%3CP%3ESet%20the%20file%E2%80%99s%20%3CSTRONG%3EContent%3C%2FSTRONG%3E%20property%20as%20%3CSTRONG%3ETrue%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20989px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167339iB1EE728F2DA1708D%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2222.png%22%20title%3D%2222.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EIf%20you%20cannot%20see%20the%20%3CSTRONG%3E%3CEM%3Eviewbackground.png%3C%2FEM%3E%3C%2FSTRONG%3E%20file%2C%20please%20click%20the%20%E2%80%9CShow%20All%20Files%E2%80%9D%20tool%20icon%20in%20the%20solution%20explorer%20window.%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EAdd%20the%20sample%20png%20file%20into%20%3CSTRONG%3E%3CEM%3EAssets%3C%2FEM%3E%3C%2FSTRONG%3E%20folder%20of%20%3CSTRONG%3E%3CEM%3EMyApp%3C%2FEM%3E%3C%2FSTRONG%3E%2C%20and%20make%20its%20%3CSTRONG%3E%3CEM%3EContent%3C%2FEM%3E%3C%2FSTRONG%3E%20property%20as%20%3CSTRONG%3ETrue%3C%2FSTRONG%3E%20as%20well.%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EModify%20MainUserControl.Xaml%20as%20below%20in%20%3CSTRONG%3E%3CEM%3EMyApp%3C%2FEM%3E%3C%2FSTRONG%3E%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22cb19%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20xml%22%3E%3CCODE%20class%3D%22sourceCode%20xml%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3CUSERCONTROL%3E%3C%2FUSERCONTROL%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20x%3AClass%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22MyApp.MainUserControl%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22http%3A%2F%2Fschemas.microsoft.com%2Fwinfx%2F2006%2Fxaml%2Fpresentation%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3Ax%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22http%3A%2F%2Fschemas.microsoft.com%2Fwinfx%2F2006%2Fxaml%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3Alocal%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22using%3AMyApp%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3Ad%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22http%3A%2F%2Fschemas.microsoft.com%2Fexpression%2Fblend%2F2008%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20xmlns%3Amc%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22http%3A%2F%2Fschemas.openxmlformats.org%2Fmarkup-compatibility%2F2006%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20mc%3AIgnorable%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22d%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CRELATIVEPANEL%3E%3C%2FRELATIVEPANEL%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20HorizontalAlignment%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22Stretch%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20VerticalAlignment%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22Stretch%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CIMAGE%3E%3C%2FIMAGE%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20Source%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22assets%2Fviewbackground.png%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20RelativePanel.AlignLeftWithPanel%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22True%22%3C%2FSPAN%3E%20%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20RelativePanel.AlignRightWithPanel%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22True%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20RelativePanel.AlignHorizontalCenterWithPanel%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22True%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CINKCANVAS%3E%3C%2FINKCANVAS%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20x%3AName%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22ic%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20RelativePanel.AlignLeftWithPanel%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22True%22%3C%2FSPAN%3E%20%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20RelativePanel.AlignRightWithPanel%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22True%22%3C%2FSPAN%3E%20%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20RelativePanel.AlignBottomWithPanel%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22True%22%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20RelativePanel.AlignTopWithPanel%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22True%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3CINKTOOLBAR%3E%3C%2FINKTOOLBAR%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20x%3AName%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22it%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20HorizontalAlignment%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22Left%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22ot%22%3E%20VerticalAlignment%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22st%22%3E%22Top%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%26gt%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22kw%22%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EAdd%20below%20code%20in%20MainUserControl.CPP%2C%20remove%20the%20Button%20ClickHandler%20code%20as%20we%20don%E2%80%99t%20use%20it%20now%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22cb20%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%20%20%20%20MainUserControl%3A%3AMainUserControl()%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20InitializeComponent()%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20ic().InkPresenter().InputDeviceTypes((winrt%3A%3AWindows%3A%3AUI%3A%3ACore%3A%3ACoreInputDeviceTypes)%3CSPAN%20class%3D%22dv%22%3E7%3C%2FSPAN%3E)%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%20%20%20%20it().TargetInkCanvas(ic())%3B%3C%2FSPAN%3E%0A%3CSPAN%3E%20%20%20%20%7D%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EInclude%20more%20winrt%20header%20files%20in%20MainUserControl.h%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22cb21%22%20class%3D%22sourceCode%22%3E%0A%3CPRE%20class%3D%22sourceCode%20c%2B%2B%22%3E%3CCODE%20class%3D%22sourceCode%20cpp%22%3E%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%3CWINRT%3E%3C%2FWINRT%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CSPAN%3E%3CSPAN%20class%3D%22pp%22%3E%23include%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22im%22%3E%3CWINRT%3E%3C%2FWINRT%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EBuild%20and%20run%20Simple%2C%20if%20steps%20have%20been%20taken%20exactly%20as%20above%2C%20it%20will%20show%20as%20below%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167340i339E79FDCDDCEF04%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2223.png%22%20title%3D%2223.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EYou%20may%20notice%20that%20it%20doesn%E2%80%99t%20display%20the%20background%20image%2C%20this%20is%20because%20the%20uri%20%3CSTRONG%3Eassets%2Fviewbackground.png%3C%2FSTRONG%3E%20needs%20to%20be%20used%20UWP%20package.%20In%20Visual%20Studio%2C%20with%20%3CSTRONG%3E%E2%80%9CWindows%20Application%20Packaging%20Project%20(C%2B%2B)%E2%80%9D%3C%2FSTRONG%3E%2C%20it%20is%20easily%20to%20packaging%20our%20SimpleApp%20project%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167341i71A911326DB368E5%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2216.png%22%20title%3D%2216.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3ECreate%20the%20packaging%20project%20in%20the%20solution%2C%20right%20click%20the%20%3CSTRONG%3EApplication%3C%2FSTRONG%3E%20node%2C%20and%20select%20%3CSTRONG%3EAdd%20Reference%3C%2FSTRONG%3E%2C%20add%20SimpleApp.%20Now%20the%20packaging%20project%20structure%20is%20like%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167342i13D3D667EE411FA9%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%2224.png%22%20title%3D%2224.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EFor%20more%20information%20about%20packaging%20project%2C%20refer%20to%3A%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fmsix%2Fdesktop%2Fdesktop-to-uwp-packaging-dot-net%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EPackage%20a%20desktop%20app%20from%20source%20code%20using%20Visual%20Studio%3C%2FA%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3CLI%3E%0A%3CP%3EAfter%20this%2C%20choose%20the%20packaging%20project%20as%20Start%20Up%20project%2C%20Ctrl%2BF5%20to%20run%20it.%20We%20can%20see%20the%20expected%20result%20will%20show%20up%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167343iB872CEBBB6F0EF02%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2225.png%22%20title%3D%2225.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EFurther%20more%2C%20you%20can%20publish%20this%20packaging%20app%20as%20MSIX%20or%20APPX%2C%20and%20easily%20deploy%20it%3A%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fmsix%2Fdesktop%2Fdesktop-to-uwp-r2r%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EPackage%20a%20UWP%20app%20with%20Visual%20Studio%3C%2FA%3E%3C%2FP%3E%0A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CH2%20id%3D%22wrap-up%22%20id%3D%22toc-hId-1305890170%22%20id%3D%22toc-hId--831762522%22%3EWrap%20Up%3C%2FH2%3E%0A%3CP%3EThis%20article%20gives%20detailed%20steps%20on%20how%20to%20leverage%20XamplApplication%20to%20host%20standard%20XAML%20control%20in%20C%2B%2B%20Win32%20project%2C%20with%20this%20method%2C%20it%20is%20flexible%20to%20leverage%20Win10%20Controls%20in%20Win32%20project.%20The%20whole%20sample%20solution%20can%20be%20found%20from%20this%20repo%3A%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Ffreistli%2FModernizeApp%2Ftree%2Fmaster%2FC%252B%252B%2FSimpleApp%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Ffreistli%2FModernizeApp%2Ftree%2Fmaster%2FC%252B%252B%2FSimpleApp%3C%2FA%3E%3C%2FP%3E%0A%3CH2%20id%3D%22further-step%22%20id%3D%22toc-hId--501564293%22%20id%3D%22toc-hId-1655750311%22%3EFurther%20Step%3C%2FH2%3E%0A%3CP%3ETo%20use%20WinUI%202.x%2C%20you%20can%20refer%20to%20this%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Ffreistli%2FModernizeApp%2Fblob%2Fmaster%2FDocs%2FHost%2520Custom%2520UWP%2520Controls%2520in%2520MFC%2520MDI%2520project%2520using%2520XMAL%2520Islands.md%23using-winui-in-uwp-custom-control-in-myapp-uwp-project%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Epart%3C%2FA%3E%20and%20embedded%20it%20in%20your%20C%2B%2B%20project.%20The%20sample%20solution%20is%20also%20ready%20from%20this%20repo%3A%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Ffreistli%2FModernizeApp%2Ftree%2Fmaster%2FC%252B%252B%2FSimpleAppWithWinUI%2FSimpleApp%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Ffreistli%2FModernizeApp%2Ftree%2Fmaster%2FC%252B%252B%2FSimpleAppWithWinUI%2FSimpleApp%3C%2FA%3E.%20Its%20left%20TreeView%20is%20from%20WinUI%202.4%20prerelease%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167344iA94CDECBF87F3DA5%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2226.png%22%20title%3D%2226.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1129823%22%20slang%3D%22en-US%22%3E%3CDIV%3E%0A%3CDIV%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F167345i52F9E897C0A800BA%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2226.png%22%20title%3D%2226.png%22%20%2F%3E%3C%2FSPAN%3EThis%26nbsp%3Barticle%26nbsp%3Bexplains%26nbsp%3Bhow%26nbsp%3Bto%26nbsp%3Bmodernize%26nbsp%3BC%2B%2B%26nbsp%3BWin32%26nbsp%3Bproject%26nbsp%3Bwith%26nbsp%3Bcustom%26nbsp%3BUWP%26nbsp%3BControls%26nbsp%3Bthrough%26nbsp%3BXAML%26nbsp%3BIslands%26nbsp%3Bin%26nbsp%3Bdetail.%26nbsp%3BWith%26nbsp%3Bcustom%26nbsp%3BUWP%26nbsp%3Bcontrols%2C%26nbsp%3Bit%26nbsp%3Ballows%26nbsp%3Bus%26nbsp%3Bto%26nbsp%3Bdefine%26nbsp%3Bcontrol%26nbsp%3Blayout%26nbsp%3Beasily%26nbsp%3Bthrough%26nbsp%3BXAML%26nbsp%3Bpages.%26nbsp%3BNot%26nbsp%3Bonly%26nbsp%3Bputting%26nbsp%3Bstandard%26nbsp%3BUWP%26nbsp%3Bcontrols%26nbsp%3Binto%26nbsp%3Bthe%26nbsp%3Bcustom%26nbsp%3Bcontrol%2C%26nbsp%3Bwe%26nbsp%3Bcan%26nbsp%3Balso%26nbsp%3Bintegrate%26nbsp%3Bother%26nbsp%3Bcustom%26nbsp%3Bcontrols%26nbsp%3Bas%26nbsp%3Bwell%2C%26nbsp%3Bsuch%26nbsp%3Bas%26nbsp%3Blatest%26nbsp%3BWinUI%26nbsp%3Bcontrols.%26nbsp%3BWe%26nbsp%3Bwill%26nbsp%3Buse%26nbsp%3Ba%26nbsp%3Bnew%26nbsp%3BXaml%26nbsp%3BApplication%26nbsp%3Bproject%26nbsp%3Bto%26nbsp%3Bbring%26nbsp%3Bthe%26nbsp%3Bcustom%26nbsp%3BUWP%26nbsp%3Bcontrols%26nbsp%3Binto%26nbsp%3Bour%26nbsp%3BC%2B%2B%26nbsp%3BWin32%26nbsp%3Bproject.%26nbsp%3BThis%20guide%26nbsp%3Bhas%26nbsp%3Bmentioned%26nbsp%3Bhow%26nbsp%3Bto%26nbsp%3Buse%26nbsp%3Bthe%26nbsp%3Bnew%26nbsp%3BXAML%26nbsp%3Bapplication%26nbsp%3Bin%26nbsp%3BWin32%26nbsp%3BC%2B%2B%26nbsp%3Bapplication%2C%26nbsp%3Bwe%26nbsp%3Bwill%26nbsp%3Bgive%26nbsp%3Bmore%26nbsp%3Bdetailed%26nbsp%3Bsteps.%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3C%2FDIV%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1129823%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EC%2B%2B%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMSIX%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWIN32%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWinUI%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EXMAL%20Islands%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

Host Custom UWP Controls in C++ Win32 Project using XAML Islands

This article explains how to modernize C++ Win32 project with custom UWP Controls through XAML Islands in detail. With custom UWP controls, it allows us to define control layout easily through XAML pages. Not only putting standard UWP controls into the custom control, we can also integrate other custom controls as well, such as latest WinUI controls. We will use a new Xaml Application project to bring the custom UWP controls into our C++ Win32 project. This article has mentioned how to use the new XAML application in Win32 C++ application, we will give more detailed steps.

Overall, in our solution, we will have two parts to demonstrate this method:

  • C++ Win32 Project

  • A companion UWP app project that defines a XamlApplication object.

    In this project, we will define a custom UWP control and export it so that C++ Win32 can use the custom UWP control.

Development Environment

  • Visual Studio 2019 (16.3.6)
  • Windows 10 1909 (18363.476)
  • Windows 10 SDK (10.0.18362.1)

Configure C++ Win32 Project

  1. Create C++ Win32 in Visual Studio 2019, will name it SimpleApp

    01.png

  2. In Solution Explorer, right-click the Simple project node, click Retarget Project, select the 10.0.18362.0 or a later SDK release, and then click OK.

    3.png

    02.png

  3. Install the Microsoft.Windows.CppWinRT NuGet package:

    1. Right-click the project in Solution Explorer and choose Manage NuGet Packages.

    2. Select the Browse tab, search for the Microsoft.Windows.CppWinRT package, and install the latest version of this package.

    03.png

    After install the nuget package, check the SimpleApp project properties, you will notice its C++ version is ISO C++17, which is required by C++/WinRT:

    04.png

    Build this SimpleApp, we can see winrt projected files are generated in the “Generated Files” folder:

    05.png

  4. Install the Microsoft.Toolkit.Win32.UI.SDK NuGet package:

    1. In the NuGet Package Manager window, make sure that Include prerelease is selected.
    2. Select the Browse tab, search for the Microsoft.Toolkit.Win32.UI.SDK package, and install version v6.0.0 (or Later) of this package.

    06.png

  5. Install the Microsoft.VCRTForwarders.140 nuget package as well. Running Custom UWP Control in this project will require VC libs.

    7.png

Configure UWP Project

  1. In Solution Explorer, right-click the solution node and select Add -> New Project.

  2. Add a Blank App (C++/WinRT) project to your solution.

    1.png

  3. Give it a name MyApp, and create it, Make sure the target version and minimum version are both set to Windows 10, version 1903 or later.

    8.png

  4. Right click the MyApp and open its properties, make sure its C++/WinRT configuration is as below:

    3.png

  5. Change its output type from .EXE to Dynamic Library

    4.png

  6. Save a dummy.exe into the MyApp folder. It doesn’t need to be a real exe, just input “dummy exe file” in notepad, and save it as dummy.exe.

    5.png

    9.png

    Add the dummy.exe into MyApp project, and make sure the Content property of dummy.exe is True.

    10.png

  7. Now edit Package.appxmanifest, change the Executable attribute to “dummy.exe”

    7.png

  8. Right click the MyApp project, select Unload Project

  9. Right click the MyApp (Unloaded) project, select Edit MyApp.vcxproj

  10. Add below properties to the MyApp.vcxproj project file:

    <PropertyGroup Label="Globals">
        <WindowsAppContainer>true</WindowsAppContainer>
        <AppxGeneratePriEnabled>true</AppxGeneratePriEnabled>
        <ProjectPriIndexName>App</ProjectPriIndexName>
        <AppxPackage>true</AppxPackage>
      </PropertyGroup>

    For example:

    8.png

  11. Right click the MyApp (Unloaded) project, select Reload Project.

  12. Right click Mainpage.xml, select Remove. And then click Delete

    11.png

  13. Copy App.Xaml, App.cpp, App.h, App.idl contents to overwrite current ones:

    App.Xaml

    <Toolkit:XamlApplication
        x:Class="MyApp.App"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="using:MyApp"
        xmlns:Toolkit="using:Microsoft.Toolkit.Win32.UI.XamlHost"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        RequestedTheme="Light"
        mc:Ignorable="d">
    </Toolkit:XamlApplication>

    App.cpp

    #include "pch.h"
    #include "App.h"
    
    using namespace winrt;
    using namespace Windows::UI::Xaml;
    
    namespace winrt::MyApp::implementation
    {
        App::App()
        {
            Initialize();
    
            AddRef();
            m_inner.as<::IUnknown>()->Release();
        }
    
        App::~App()
        {
            Close();
        }
    }

    App.h

    //
    // Declaration of the App class.
    //
    
    #pragma once
    
    #include "App.g.h"
    #include "App.base.h"
    
    namespace winrt::MyApp::implementation
    {
        class App : public AppT2<App>
        {
        public:
            App();
            ~App();
        };
    }
    
    namespace winrt::MyApp::factory_implementation
    {
        class App : public AppT<App, implementation::App>
        {
        };
    }

    App.idl

    namespace MyApp
    {
        [default_interface]
        runtimeclass App: Microsoft.Toolkit.Win32.UI.XamlHost.XamlApplication
        {
            App();
        }
    }
  14. Create app.base.h in this MyApp project, and use below content:

    app.base.h

    #pragma once
    
    namespace winrt::MyApp::implementation
    {
        template <typename D, typename... I>
        struct App_baseWithProvider : public App_base<D, ::winrt::Windows::UI::Xaml::Markup::IXamlMetadataProvider>
        {
            using IXamlType = ::winrt::Windows::UI::Xaml::Markup::IXamlType;
    
            IXamlType GetXamlType(::winrt::Windows::UI::Xaml::Interop::TypeName const& type)
            {
                return AppProvider()->GetXamlType(type);
            }
    
            IXamlType GetXamlType(::winrt::hstring const& fullName)
            {
                return AppProvider()->GetXamlType(fullName);
            }
    
            ::winrt::com_array<::winrt::Windows::UI::Xaml::Markup::XmlnsDefinition> GetXmlnsDefinitions()
            {
                return AppProvider()->GetXmlnsDefinitions();
            }
    
        private:
            bool _contentLoaded{ false };
            std::shared_ptr<XamlMetaDataProvider> _appProvider;
            std::shared_ptr<XamlMetaDataProvider> AppProvider()
            {
                if (!_appProvider)
                {
                    _appProvider = std::make_shared<XamlMetaDataProvider>();
                }
                return _appProvider;
            }
        };
    
        template <typename D, typename... I>
        using AppT2 = App_baseWithProvider<D, I...>;
    }
    
  15. Install Microsoft.Toolkit.Win32.UI.XamlApplication Nuget package.

  16. If you build MyApp now, it should create MyApp.dll without any error.

Centralize Output, Input and C++/WinRT files in Solution

This step is necessary for our next steps because we need to include winrt header files in different projects properly, and MFCApp also needs to reference MyApp resource files.

  1. Add a new Solution.Props file by right clicking the solution node, and select Add -> New Item:

    13.png

  2. Use below content to overwrite the Solution.Props:

    <?xml version="1.0" encoding="utf-8"?>
    <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <PropertyGroup>
        <IntDir>$(SolutionDir)\obj\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</IntDir>
        <OutDir>$(SolutionDir)\bin\$(Platform)\$(Configuration)\$(MSBuildProjectName)\</OutDir>
        <GeneratedFilesDir>$(IntDir)Generated Files\</GeneratedFilesDir>
      </PropertyGroup>
    </Project>
  3. Click Views -> Other Windows -> Property Manager

    12.png

  4. Right click SimpleApp, select Add Existing Property Sheet, add the new solution.props file

    13.png

  5. Repeat the step 4. for MyApp. We can close the Property Manager window now.

  6. Right click the project node MFCApp, select Properties.

    If you see the Outut and Intermidiate directries are already become as below, then can skip this step:

    $(SolutionDir)$(Platform)$(Configuration)$(MSBuildProjectName)
    and $(SolutionDir)$(Platform)$(Configuration)$(MSBuildProjectName)

    Otherwise please manually set:

    Output Directory: $(OutDir)

    Intermidia Directory: $(IntDir)

    12.png

  7. Repeat the step 6 for MyApp.

  8. Right click the Solution node, and choose Project Dependencies, make sure SimpleApp depends on MyApp:

    15.png

  9. Rebuild the whole solution, it should work without errors.

Add UWP Custom XAML Control to MyApp

  1. Right click MyApp, select Add -> New Item

  2. Create Blank User Conrol (C++/WinRT), here we call it MainUserControl:

    16.png

Integrate Custom XAML Control in SimpleApp

  1. Add one XML file app.manifest in your project with below content to register custom control type:

    <?xml version="1.0" encoding="utf-8" standalone="yes"?>
    <assembly
        xmlns="urn:schemas-microsoft-com:asm.v1"
        xmlns:asmv3="urn:schemas-microsoft-com:asm.v3"
        manifestVersion="1.0">
        <asmv3:file name="MyApp.dll">
            <activatableClass
                name="MyApp.App"
                threadingModel="both"
                xmlns="urn:schemas-microsoft-com:winrt.v1" />
            <activatableClass
                name="MyApp.XamlMetadataProvider"
                threadingModel="both"
                xmlns="urn:schemas-microsoft-com:winrt.v1" />
            <activatableClass
                name="MyApp.MainUserControl"
                threadingModel="both"
                xmlns="urn:schemas-microsoft-com:winrt.v1" />
        </asmv3:file>
    </assembly>
  2. Now the project structure is like as below:

    17.png

  3. Right click the Win32 Project SimpleApp, select Unload Project

  4. Right click the SimpleApp (Unloaded) project, select Edit SimpleApp.vcxproj

  5. Remove the three lines from the SimpleApp.vcxproj project file:

    <ItemGroup>
        <Manifest Include="app.manifest" />
    </ItemGroup>

    Add below properties to the SimpleApp.vcxproj project file before the “<Import Project=”“$(VCTargetsPath).Cpp.targets” />" line:

      <ItemGroup>
        <Manifest Include="app.manifest" />
        <AppxManifest Include="$(SolutionDir)\bin\$(Platform)\$(Configuration)\$(AppProjectName)\AppxManifest.xml" />
      </ItemGroup>
      <PropertyGroup>
        <AppProjectName>MyApp</AppProjectName>
      </PropertyGroup>
      <PropertyGroup>
        <AppIncludeDirectories>$(SolutionDir)\obj\$(Platform)\$(Configuration)\$(AppProjectName)\;$(SolutionDir)\obj\$(Platform)\$(Configuration)\$(AppProjectName)\Generated Files\;</AppIncludeDirectories>
      </PropertyGroup>
        <ItemGroup>
        <NativeReferenceFile Include="$(SolutionDir)\bin\$(Platform)\$(Configuration)\$(AppProjectName)\*.xbf">
          <DeploymentContent>true</DeploymentContent>
          <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </NativeReferenceFile>
        <NativeReferenceFile Include="$(SolutionDir)\bin\$(Platform)\$(Configuration)\$(AppProjectName)\*.dll">
          <DeploymentContent>true</DeploymentContent>
          <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </NativeReferenceFile>
        <NativeReferenceFile Include="$(SolutionDir)\bin\$(Platform)\$(Configuration)\$(AppProjectName)\resources.pri">
          <DeploymentContent>true</DeploymentContent>
          <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </NativeReferenceFile>
      </ItemGroup>
      <------Right Here--------->
      <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
  6. Right click the SimpleApp (Unloaded) project, select Reload Project.

  7. Right click SimpleApp, select Properties, setup $(AppIncludeDirectories) as a part of include file path, this macro has been defined in the above project file:

    18.png

  8. Set “Per Monitor DPI Aware” for DPI Awareness otherwise you may be not able to start this SimpleApp when it is “High DPI Aware” and hit configuration error in Manifest:

    19.png

    20.png

  9. Open framework.h, remove this #define:

    #define WIN32_LEAN_AND_MEAN
  10. In SimpleApp.h, add below code to include necessary winrt header files:

    #include <winrt/Windows.Foundation.Collections.h>
    #include <winrt/Windows.system.h>
    #include <winrt/windows.ui.xaml.hosting.h>
    #include <windows.ui.xaml.hosting.desktopwindowxamlsource.h>
    #include <winrt/windows.ui.xaml.controls.h>
    #include <winrt/Windows.ui.xaml.media.h>
    #include <winrt/Windows.UI.Core.h>
    #include <winrt/myapp.h>
  11. Using winrt namespaces in SimpleAPP.cpp

    using namespace winrt;
    using namespace Windows::UI;
    using namespace Windows::UI::Composition;
    using namespace Windows::UI::Xaml::Hosting;
    using namespace Windows::Foundation::Numerics;
    using namespace Windows::UI::Xaml::Controls;
  12. Declare hostApp, _desktopWindowXamlSource and our custom control in SimpleApp.cpp

         // Global Variables:
        HINSTANCE hInst;                                
        // current instance
        WCHAR szTitle[MAX_LOADSTRING];                  
        // The title bar text
        WCHAR szWindowClass[MAX_LOADSTRING];            
        // the main window class name
    
    
        winrt::MyApp::App hostApp{ nullptr };
        winrt::Windows::UI::Xaml::Hosting::DesktopWindowXamlSource _desktopWindowXamlSource{ nullptr };
        winrt::MyApp::MainUserControl _mainUserControl{ nullptr };
  13. Initalize hostApp, _desktopWindowXamlSource in wWinMain in SimpleApp.CPP

        winrt::init_apartment(winrt::apartment_type::single_threaded);
        hostApp = winrt::MyApp::App{};
        _desktopWindowXamlSource = winrt::Windows::UI::Xaml::Hosting::DesktopWindowXamlSource{};
  14. Add below code in InitInstance in SimpleApp.cpp

        if (_desktopWindowXamlSource != nullptr)
       {
           // Get handle to corewindow
           auto interop = _desktopWindowXamlSource.as<IDesktopWindowXamlSourceNative>();
           // Parent the DesktopWindowXamlSource object to current window
           check_hresult(interop->AttachToWindow(hWnd));
    
           // This Hwnd will be the window handler for the Xaml Island: A child window that contains Xaml.  
           HWND hWndXamlIsland = nullptr;
           // Get the new child window's hwnd 
           interop->get_WindowHandle(&hWndXamlIsland);
    
           RECT windowRect;
           ::GetWindowRect(hWnd, &windowRect);
           ::SetWindowPos(hWndXamlIsland, NULL, 0, 0, windowRect.right - windowRect.left, windowRect.bottom - windowRect.top, SWP_SHOWWINDOW);
    
           _mainUserControl = winrt::MyApp::MainUserControl();
           _desktopWindowXamlSource.Content(_mainUserControl);
       }
       ShowWindow(hWnd, nCmdShow);
       UpdateWindow(hWnd);
  15. Clean up resources when the view is disconstructed in MFCAppView.cpp

     case WM_DESTROY:
        PostQuitMessage(0);
        if (_desktopWindowXamlSource != nullptr)
        {
            _desktopWindowXamlSource.Close();
            _desktopWindowXamlSource = nullptr;
        }
        break;
  16. Add AdjustLayout function to make XAML content layout properly in SimpleApp.cpp :

    void AdjustLayout(HWND hWnd)
    {
        if (_desktopWindowXamlSource != nullptr)
        {
            auto interop = _desktopWindowXamlSource.as<IDesktopWindowXamlSourceNative>();
            HWND xamlHostHwnd = NULL;
            check_hresult(interop->get_WindowHandle(&xamlHostHwnd));
    
            RECT windowRect;
            ::GetWindowRect(hWnd, &windowRect);
            ::SetWindowPos(xamlHostHwnd, NULL, 0, 0, windowRect.right - windowRect.left, windowRect.bottom - windowRect.top, SWP_SHOWWINDOW);
        }
    }
  17. In SimpleApp.CPP handle WM_SIZE in the WinProc function: C++ case WM_SIZE: AdjustLayout(hWnd);

  18. Now you can build and run this SimpleApp. It should display a button in the central of view window:

    21.gif

Using Ink Control in MyApp UWP Project

  1. Add an Assets file folder under SimpleApp on file system, add viewbackground.png file. And then create a new filter of “Assets”, add this existing viewbackground.png into the Assets filter:

    Set the file’s Content property as True

    22.png

    If you cannot see the viewbackground.png file, please click the “Show All Files” tool icon in the solution explorer window.

  2. Add the sample png file into Assets folder of MyApp, and make its Content property as True as well.

  3. Modify MainUserControl.Xaml as below in MyApp:

    <UserControl
        x:Class="MyApp.MainUserControl"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="using:MyApp"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d">
    
        <RelativePanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
            <Image Source="assets/viewbackground.png" RelativePanel.AlignLeftWithPanel="True" 
                   RelativePanel.AlignRightWithPanel="True"
                   RelativePanel.AlignHorizontalCenterWithPanel="True"></Image>
            <InkCanvas x:Name="ic" RelativePanel.AlignLeftWithPanel="True" 
                       RelativePanel.AlignRightWithPanel="True" 
                       RelativePanel.AlignBottomWithPanel="True"
                       RelativePanel.AlignTopWithPanel="True"></InkCanvas>
            <InkToolbar x:Name="it" HorizontalAlignment="Left" VerticalAlignment="Top"></InkToolbar>
        </RelativePanel>
    </UserControl>
  4. Add below code in MainUserControl.CPP, remove the Button ClickHandler code as we don’t use it now:

        MainUserControl::MainUserControl()
        {
            InitializeComponent();
            ic().InkPresenter().InputDeviceTypes((winrt::Windows::UI::Core::CoreInputDeviceTypes)7);
            it().TargetInkCanvas(ic());
        }
  5. Include more winrt header files in MainUserControl.h:

    #include <winrt/Windows.UI.Input.Inking.h>
    #include <winrt/Windows.UI.Xaml.Media.Imaging.h>
  6. Build and run Simple, if steps have been taken exactly as above, it will show as below:

    23.png

  7. You may notice that it doesn’t display the background image, this is because the uri assets/viewbackground.png needs to be used UWP package. In Visual Studio, with “Windows Application Packaging Project (C++)”, it is easily to packaging our SimpleApp project:

    16.png

    Create the packaging project in the solution, right click the Application node, and select Add Reference, add SimpleApp. Now the packaging project structure is like:

    24.png

    For more information about packaging project, refer to: Package a desktop app from source code using Visual Studio

  8. After this, choose the packaging project as Start Up project, Ctrl+F5 to run it. We can see the expected result will show up:

    25.png

    Further more, you can publish this packaging app as MSIX or APPX, and easily deploy it:

    Package a UWP app with Visual Studio

Wrap Up

This article gives detailed steps on how to leverage XamplApplication to host standard XAML control in C++ Win32 project, with this method, it is flexible to leverage Win10 Controls in Win32 project. The whole sample solution can be found from this repo: https://github.com/freistli/ModernizeApp/tree/master/C%2B%2B/SimpleApp

Further Step

To use WinUI 2.x, you can refer to this part and embedded it in your C++ project. The sample solution is also ready from this repo: https://github.com/freistli/ModernizeApp/tree/master/C%2B%2B/SimpleAppWithWinUI/SimpleApp. Its left TreeView is from WinUI 2.4 prerelease:

26.png