Hello @Shyam Butani,
It works for me that calling WindowsXamlManager winxamlmanager = WindowsXamlManager::InitializeForCurrentThread();
explicitly firstly like Use the XAML hosting API to host a WinRT XAML control does.
// Begin XAML Island section.
// The call to winrt::init_apartment initializes COM; by default, in a multithreaded apartment.
winrt::init_apartment(apartment_type::single_threaded);
// Initialize the XAML framework's core window for the current thread.
WindowsXamlManager winxamlmanager = WindowsXamlManager::InitializeForCurrentThread();
/////////////////////////////////////////////////////////////////////
DesktopWindowXamlSource desktopSource1;
auto interop1 = desktopSource1.as<IDesktopWindowXamlSourceNative>();
check_hresult(interop1->AttachToWindow(_hWnd));
HWND hWndXamlIsland1 = nullptr;
interop1->get_WindowHandle(&hWndXamlIsland1);
SetWindowPos(hWndXamlIsland1, 0, 0, 0, 255, 255, SWP_SHOWWINDOW);
ShowWindow(_hWnd, nCmdShow);
desktopSource1.Close();
/////////////////////////////////////////////////////////////////////
// This DesktopWindowXamlSource is the object that enables a non-UWP desktop application
// to host WinRT XAML controls in any UI element that is associated with a window handle (HWND).
DesktopWindowXamlSource desktopSource;