Quite simple library for Windows Phone that helps modifying navigation backstack or redirecting to some page depending on some flag.

Feel free to propose patches or fork the code :)

Simply look at an example.

// Code to execute when the application is launching (eg, from Start)      
// This code will not execute when the application is reactivated          
private void Application_Launching(object sender, LaunchingEventArgs e)    
{                                                                          
    var fluent = new FluentNavigation(RootFrame);                          
                                                                           
    fluent.WhenNavigatedTo<MainPage>()                                     
          .ThenTo<LoginPage>()                                             
          .ThenToAnyPage()                                                 
          .RemoveEntriesFromBackStack(1);                                  
                                                                           
    fluent.WhenNavigatedTo<MainPage>()                                     
          .ThenTo<LoginPage>()                                             
          .ThenTo<RegisterPage>()                                          
          .ThenTo<PaymentPage>()                                           
          .RemoveEntriesFromBackStackTill<MainPage>();                     
                                                                           
    fluent.WhenNavigatedTo<MainPage>()                                     
          .ThenTo<SecondPage>()                                            
          .ThenTo<RegisterPage>()                                          
          .ThenOptionallyTo<ForgotPasswordPage>()                          
          .ThenToAnyPage()                                                 
          .RemoveEntriesFromBackStackTill<MainPage>();                     
                                                                           
    fluent.WhenNavigatingTo<PaymentPage>()                                 
          .RedirectTo<LoginPage>();                                        
                                                                           
    fluent.WhenNavigatingTo<PaymentPage>()                                 
          .If(() => false)                                                 
          .RedirectWithReturnUri<LoginPage>("ReturnUri");                  
}                                                                          

Last edited Apr 25, 2013 at 11:16 AM by BelorusBY, version 3