Calling WPF pages in VC++
-
Hi, I am working on an application, which calls a WPF page in MFC exe and loads it too, but the backgound for the WPF is coming black. here is code snippet Declaration using namespace System; using namespace System::Windows; using namespace System::Windows::Controls; using namespace System::Windows::Media; ref class Globals { public: static System::Windows::Interop::HwndSource^ gHwndSource; static WpfApplication1::Window1^ gwcContainer; }; i have added in oninitdialog, System::Windows::Interop::HwndSourceParameters^ sourceParams = gcnew System::Windows::Interop::HwndSourceParameters("MyWindowName"); sourceParams->PositionX = 20; sourceParams->PositionY = 30; sourceParams->ParentWindow = System::IntPtr(this->GetSafeHwnd()); sourceParams->WindowStyle = WS_VISIBLE | WS_CHILD; System::Windows::Interop::HwndSource^ source = gcnew System::Windows::Interop::HwndSource(*sourceParams); source->SizeToContent = System::Windows::SizeToContent::WidthAndHeight; Globals::gwcContainer = gcnew WpfApplication1::Window1(); FrameworkElement^ myPage = Globals::gwcContainer; source->RootVisual = myPage; I dont want the black color around. Any help is highly appriciated. Thanks&Regards, KDevloper