MSDN > Home page del forum > Visual Studio WPF Designer > WPF BROWSER APPLICATION NAVIGATION PROBLEM
Formula una domandaFormula una domanda
 

Con rispostaWPF BROWSER APPLICATION NAVIGATION PROBLEM

  • martedì 30 giugno 2009 1.01a_Nightblade_ Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    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.

Risposte

  • martedì 30 giugno 2009 2.03Mark Wilson-ThomasMSFT, ModeratoreMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     Con risposta
    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'
  • martedì 30 giugno 2009 2.05Mark Wilson-ThomasMSFT, ModeratoreMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     Con risposta
    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'
    • Contrassegnato come rispostaa_Nightblade_ martedì 30 giugno 2009 11.43
    •  

Tutte le risposte

  • martedì 30 giugno 2009 2.03Mark Wilson-ThomasMSFT, ModeratoreMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     Con risposta
    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'
  • martedì 30 giugno 2009 2.05Mark Wilson-ThomasMSFT, ModeratoreMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     Con risposta
    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'
    • Contrassegnato come rispostaa_Nightblade_ martedì 30 giugno 2009 11.43
    •  
  • martedì 30 giugno 2009 11.48a_Nightblade_ Medaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    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.
  • martedì 30 giugno 2009 21.55Mark Wilson-ThomasMSFT, ModeratoreMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utenteMedaglie utente
     
    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'