WPF BROWSER APPLICATION NAVIGATION PROBLEM
- I have a wpf browser applicaton
all is working fine but i like to change th looks a little.
I like to navigate from 1 page to another by clicking a button instead of a hyperlink.
I have tryed everything but i can't get it done.
is it even possible or not ?
More knowledge, means more problems.
Respostas
- You can use the NavigationService directly for navigation in XBAPs from any control. For example if you wanted to use a Button for navigation, you might wire up its button event handler like so (this snippet shows me navigating to a new Page called Page2, which is in my XBAP project).
The back and forward functionality in IE is still retained in these cases.
using
System.Windows.Navigation;
....
private void button1_Click(object sender, RoutedEventArgs e)
{
this.ns = NavigationService.GetNavigationService(this);
Page p = new Page2();
ns.Navigate(p);
}
Mark
NB: This sort of question is better posed on the WPF platform forum http://social.msdn.microsoft.com/Forums/en-US/wpf - this forum is really for questions about the Visual Studio WPF and Silverlight Designers.
Mark Wilson-Thomas - Program Team - WPF & SL Designer for Visual Studio - posts are provided 'as-is'- Sugerido como RespostaMark Wilson-ThomasMSFT, Moderadorterça-feira, 30 de junho de 2009 2:03
- Marcado como Respostaa_Nightblade_ terça-feira, 30 de junho de 2009 11:43
- You might also find this MSDN article informative: http://msdn.microsoft.com/en-us/library/ms750478.aspx
Mark Wilson-Thomas - Program Team - WPF & SL Designer for Visual Studio - posts are provided 'as-is'- Marcado como Respostaa_Nightblade_ terça-feira, 30 de junho de 2009 11:43
Todas as Respostas
- You can use the NavigationService directly for navigation in XBAPs from any control. For example if you wanted to use a Button for navigation, you might wire up its button event handler like so (this snippet shows me navigating to a new Page called Page2, which is in my XBAP project).
The back and forward functionality in IE is still retained in these cases.
using
System.Windows.Navigation;
....
private void button1_Click(object sender, RoutedEventArgs e)
{
this.ns = NavigationService.GetNavigationService(this);
Page p = new Page2();
ns.Navigate(p);
}
Mark
NB: This sort of question is better posed on the WPF platform forum http://social.msdn.microsoft.com/Forums/en-US/wpf - this forum is really for questions about the Visual Studio WPF and Silverlight Designers.
Mark Wilson-Thomas - Program Team - WPF & SL Designer for Visual Studio - posts are provided 'as-is'- Sugerido como RespostaMark Wilson-ThomasMSFT, Moderadorterça-feira, 30 de junho de 2009 2:03
- Marcado como Respostaa_Nightblade_ terça-feira, 30 de junho de 2009 11:43
- You might also find this MSDN article informative: http://msdn.microsoft.com/en-us/library/ms750478.aspx
Mark Wilson-Thomas - Program Team - WPF & SL Designer for Visual Studio - posts are provided 'as-is'- Marcado como Respostaa_Nightblade_ terça-feira, 30 de junho de 2009 11:43
- mark.
Thank you for the responce it did solve my problem.
and the page from the library help me out a lot.
Sorry if posted it in the wrong forum but i didn't know
I just have 1 question left.
I see more people work in C# then in VB
is VB limited with options compared to C# ?
or is there another reason.
More knowledge, means more problems. - You are most welcome, a_Nightblade_ - and my comment regarding the correct forum was simply to help with future postings not as a reprimand :-)
With regard to WPF and Silverlight, there is no functional limitation/advantage between the two languages (both are fully supported for building such applications). I do not have data on the percentage of users using each language.
The reason you see many postings in C# is simply because many Microsoft product teams use C# internally, which means that when team members respond to your postings they are likely to use the language they use. If you want to see just how much can be accomplished in VB.NET with WPF and Silverlight, I recommend taking a look at my colleague Karl Shifflett's blog:
http://karlshifflett.wordpress.com/
Karl's language of choice is VB.NET.
Mark
Mark Wilson-Thomas - Program Team - WPF & SL Designer for Visual Studio - posts are provided 'as-is'

