MSDN > 論壇首頁 > Visual Studio WPF Designer > WPF BROWSER APPLICATION NAVIGATION PROBLEM
發問發問
 

已答覆WPF BROWSER APPLICATION NAVIGATION PROBLEM

  • 2009年6月30日 上午 01:01a_Nightblade_ 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    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.

解答

  • 2009年6月30日 上午 02:03Mark Wilson-ThomasMSFT, 版主使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     已答覆
    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'
  • 2009年6月30日 上午 02:05Mark Wilson-ThomasMSFT, 版主使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     已答覆
    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'

所有回覆

  • 2009年6月30日 上午 02:03Mark Wilson-ThomasMSFT, 版主使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     已答覆
    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'
  • 2009年6月30日 上午 02:05Mark Wilson-ThomasMSFT, 版主使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     已答覆
    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'
  • 2009年6月30日 上午 11:48a_Nightblade_ 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    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.
  • 2009年6月30日 下午 09:55Mark Wilson-ThomasMSFT, 版主使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    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'