Boman

When hosting a Wpf in windowsForms Is it possible to maintain the relative path to underlying page ( Pagenavigation ) using frame source , I cant get it to work .. only load in one page .. After that I seem to loose the path to other page in my wpf app.

My goal is to have a wpf page containing a menu and a frame for loading other wpf-pages .. hosted in a winforms app .

( How ) Can this be achieved

Please help Smile



Re: Windows Presentation Foundation (WPF) Hosting Wpf in windowsForms

WPCoder

Are you trying to keep a history or just a list The Navigated event on the frame has the Uri of the page that was loaded for example.





Re: Windows Presentation Foundation (WPF) Hosting Wpf in windowsForms

Boman

My problem is to just get the wpf to load the pages .. made a little example file


http://jens-christian-jensen.dk/wpf/WPFinVB.zip

I would just like to make my wpf load other pages when hosted i a winform

Do you know hows its done





Re: Windows Presentation Foundation (WPF) Hosting Wpf in windowsForms

WPCoder

The pack syntax gets trickier when dealing with referenced assemblies:

Me.currentPage.Navigate(New Uri("/" + Me.GetType().Assembly.GetName().Name + ";component/Page1.xaml", UriKind.Relative))


The thing I did here was simply get the name of the assembly where the xaml pages are defined. Then using the pack syntax, specify the name of the Page. The ;component syntax is necessary.





Re: Windows Presentation Foundation (WPF) Hosting Wpf in windowsForms

Boman

Thank you for the quick reply .. really helpfull !!!