How do I set Frame.Navigate to happen immediately with no transition?










3















I am working on a Windows Phone 8.1 app as part of a Windows Universal App. Following the tutorial on extending splash screens in Windows Universal Apps I changed my App.xaml.cs to replace



if (!rootFrame.Navigate(typeof(SplashPage), e.Arguments))

throw new Exception("Failed to create splash page");



with



if (e.PreviousExecutionState != ApplicationExecutionState.Running)

var extendedSplash = new SplashPage(e.SplashScreen);
Window.Current.Content = extendedSplash;



However this meant that I lost access to the root frame when I overwrote Window.Current.Content. I would like to instead use



SplashPage.SplashScreen = e.SplashScreen;
if (!rootFrame.Navigate(typeof(SplashPage), e.Arguments))

throw new Exception("Failed to create splash page");



But now the page transitions in. There is an override for Frame.Navigate which takes an additional NavigationTransitionInfo parameter, typically set to one of its subclasses:




  1. CommonNavigationTransitionInfo (i.e. roll in from the right);


  2. SlideNavigationTransitionInfo (i.e. slides up); or


  3. ContinuumNavigationTransitionInfo (i.e. a short zoom-in).

(N.B. James Croft has a good blog post showing these transitions.)



But for a splash screen extension I need the page to show immediately, without a transition (just as one gets by overwriting Window.Current.Content with the new page instance).



How do I set Frame.Navigate to happen immediately with no transition?










share|improve this question






















  • I think it should work, fi you disable default transitions for a frame - in app.xaml.cs file, where the rootFrame is created, just after creation, add rootFrame.ContentTransitions = null;.

    – Romasz
    Apr 10 '15 at 10:31











  • Brilliant. That was already in App.xaml.cs but it lead me on to the Frame.Navigated event where I could change the handler to only add back the transitions if NavigationEventArgs.SourcePageType != typeof(SplashPage)

    – dumbledad
    Apr 10 '15 at 10:40











  • You may also think of disabling frame's transition and define them for every page in xaml if needed.

    – Romasz
    Apr 10 '15 at 10:48















3















I am working on a Windows Phone 8.1 app as part of a Windows Universal App. Following the tutorial on extending splash screens in Windows Universal Apps I changed my App.xaml.cs to replace



if (!rootFrame.Navigate(typeof(SplashPage), e.Arguments))

throw new Exception("Failed to create splash page");



with



if (e.PreviousExecutionState != ApplicationExecutionState.Running)

var extendedSplash = new SplashPage(e.SplashScreen);
Window.Current.Content = extendedSplash;



However this meant that I lost access to the root frame when I overwrote Window.Current.Content. I would like to instead use



SplashPage.SplashScreen = e.SplashScreen;
if (!rootFrame.Navigate(typeof(SplashPage), e.Arguments))

throw new Exception("Failed to create splash page");



But now the page transitions in. There is an override for Frame.Navigate which takes an additional NavigationTransitionInfo parameter, typically set to one of its subclasses:




  1. CommonNavigationTransitionInfo (i.e. roll in from the right);


  2. SlideNavigationTransitionInfo (i.e. slides up); or


  3. ContinuumNavigationTransitionInfo (i.e. a short zoom-in).

(N.B. James Croft has a good blog post showing these transitions.)



But for a splash screen extension I need the page to show immediately, without a transition (just as one gets by overwriting Window.Current.Content with the new page instance).



How do I set Frame.Navigate to happen immediately with no transition?










share|improve this question






















  • I think it should work, fi you disable default transitions for a frame - in app.xaml.cs file, where the rootFrame is created, just after creation, add rootFrame.ContentTransitions = null;.

    – Romasz
    Apr 10 '15 at 10:31











  • Brilliant. That was already in App.xaml.cs but it lead me on to the Frame.Navigated event where I could change the handler to only add back the transitions if NavigationEventArgs.SourcePageType != typeof(SplashPage)

    – dumbledad
    Apr 10 '15 at 10:40











  • You may also think of disabling frame's transition and define them for every page in xaml if needed.

    – Romasz
    Apr 10 '15 at 10:48













3












3








3








I am working on a Windows Phone 8.1 app as part of a Windows Universal App. Following the tutorial on extending splash screens in Windows Universal Apps I changed my App.xaml.cs to replace



if (!rootFrame.Navigate(typeof(SplashPage), e.Arguments))

throw new Exception("Failed to create splash page");



with



if (e.PreviousExecutionState != ApplicationExecutionState.Running)

var extendedSplash = new SplashPage(e.SplashScreen);
Window.Current.Content = extendedSplash;



However this meant that I lost access to the root frame when I overwrote Window.Current.Content. I would like to instead use



SplashPage.SplashScreen = e.SplashScreen;
if (!rootFrame.Navigate(typeof(SplashPage), e.Arguments))

throw new Exception("Failed to create splash page");



But now the page transitions in. There is an override for Frame.Navigate which takes an additional NavigationTransitionInfo parameter, typically set to one of its subclasses:




  1. CommonNavigationTransitionInfo (i.e. roll in from the right);


  2. SlideNavigationTransitionInfo (i.e. slides up); or


  3. ContinuumNavigationTransitionInfo (i.e. a short zoom-in).

(N.B. James Croft has a good blog post showing these transitions.)



But for a splash screen extension I need the page to show immediately, without a transition (just as one gets by overwriting Window.Current.Content with the new page instance).



How do I set Frame.Navigate to happen immediately with no transition?










share|improve this question














I am working on a Windows Phone 8.1 app as part of a Windows Universal App. Following the tutorial on extending splash screens in Windows Universal Apps I changed my App.xaml.cs to replace



if (!rootFrame.Navigate(typeof(SplashPage), e.Arguments))

throw new Exception("Failed to create splash page");



with



if (e.PreviousExecutionState != ApplicationExecutionState.Running)

var extendedSplash = new SplashPage(e.SplashScreen);
Window.Current.Content = extendedSplash;



However this meant that I lost access to the root frame when I overwrote Window.Current.Content. I would like to instead use



SplashPage.SplashScreen = e.SplashScreen;
if (!rootFrame.Navigate(typeof(SplashPage), e.Arguments))

throw new Exception("Failed to create splash page");



But now the page transitions in. There is an override for Frame.Navigate which takes an additional NavigationTransitionInfo parameter, typically set to one of its subclasses:




  1. CommonNavigationTransitionInfo (i.e. roll in from the right);


  2. SlideNavigationTransitionInfo (i.e. slides up); or


  3. ContinuumNavigationTransitionInfo (i.e. a short zoom-in).

(N.B. James Croft has a good blog post showing these transitions.)



But for a splash screen extension I need the page to show immediately, without a transition (just as one gets by overwriting Window.Current.Content with the new page instance).



How do I set Frame.Navigate to happen immediately with no transition?







windows-runtime windows-phone-8.1 win-universal-app






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Apr 10 '15 at 10:26









dumbledaddumbledad

5,8051465175




5,8051465175












  • I think it should work, fi you disable default transitions for a frame - in app.xaml.cs file, where the rootFrame is created, just after creation, add rootFrame.ContentTransitions = null;.

    – Romasz
    Apr 10 '15 at 10:31











  • Brilliant. That was already in App.xaml.cs but it lead me on to the Frame.Navigated event where I could change the handler to only add back the transitions if NavigationEventArgs.SourcePageType != typeof(SplashPage)

    – dumbledad
    Apr 10 '15 at 10:40











  • You may also think of disabling frame's transition and define them for every page in xaml if needed.

    – Romasz
    Apr 10 '15 at 10:48

















  • I think it should work, fi you disable default transitions for a frame - in app.xaml.cs file, where the rootFrame is created, just after creation, add rootFrame.ContentTransitions = null;.

    – Romasz
    Apr 10 '15 at 10:31











  • Brilliant. That was already in App.xaml.cs but it lead me on to the Frame.Navigated event where I could change the handler to only add back the transitions if NavigationEventArgs.SourcePageType != typeof(SplashPage)

    – dumbledad
    Apr 10 '15 at 10:40











  • You may also think of disabling frame's transition and define them for every page in xaml if needed.

    – Romasz
    Apr 10 '15 at 10:48
















I think it should work, fi you disable default transitions for a frame - in app.xaml.cs file, where the rootFrame is created, just after creation, add rootFrame.ContentTransitions = null;.

– Romasz
Apr 10 '15 at 10:31





I think it should work, fi you disable default transitions for a frame - in app.xaml.cs file, where the rootFrame is created, just after creation, add rootFrame.ContentTransitions = null;.

– Romasz
Apr 10 '15 at 10:31













Brilliant. That was already in App.xaml.cs but it lead me on to the Frame.Navigated event where I could change the handler to only add back the transitions if NavigationEventArgs.SourcePageType != typeof(SplashPage)

– dumbledad
Apr 10 '15 at 10:40





Brilliant. That was already in App.xaml.cs but it lead me on to the Frame.Navigated event where I could change the handler to only add back the transitions if NavigationEventArgs.SourcePageType != typeof(SplashPage)

– dumbledad
Apr 10 '15 at 10:40













You may also think of disabling frame's transition and define them for every page in xaml if needed.

– Romasz
Apr 10 '15 at 10:48





You may also think of disabling frame's transition and define them for every page in xaml if needed.

– Romasz
Apr 10 '15 at 10:48












2 Answers
2






active

oldest

votes


















2














I would try to disable default Frame.ContentTransitions by setting it to null, just after the rootFrame is created in App.xaml.cs file (don't forget to handle different events - Launched/ShareTarget/Activated - if needed):



rootFrame.ContentTransitions = null


once you have done that, pages shouldn't have transition. Then if you want, you can bring back or set new transitions for Frame's content upon specific circumstances, or set transitions for pages individually, for example in Page's XAML:



<Page.Transitions>
<TransitionCollection>
<EntranceThemeTransition/>
</TransitionCollection>
</Page.Transitions>





share|improve this answer


















  • 1





    I am using a WebView in a Windows 10 Universal App and the animation was causing a "page load flicker". Removing <Frame.ContentTransitions> in the AppShell.xaml solved the issue.

    – Kris Krause
    Sep 23 '15 at 10:19


















0














For those who want to do the same thing for a Windows 10 UWP app, it can be achieved like this:



// Navigate to your first page without a transition 
Frame.Navigate(typeof(MainPage), null, new SuppressNavigationTransitionInfo());


According to this MSDN document.






share|improve this answer






















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f29559071%2fhow-do-i-set-frame-navigate-to-happen-immediately-with-no-transition%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    I would try to disable default Frame.ContentTransitions by setting it to null, just after the rootFrame is created in App.xaml.cs file (don't forget to handle different events - Launched/ShareTarget/Activated - if needed):



    rootFrame.ContentTransitions = null


    once you have done that, pages shouldn't have transition. Then if you want, you can bring back or set new transitions for Frame's content upon specific circumstances, or set transitions for pages individually, for example in Page's XAML:



    <Page.Transitions>
    <TransitionCollection>
    <EntranceThemeTransition/>
    </TransitionCollection>
    </Page.Transitions>





    share|improve this answer


















    • 1





      I am using a WebView in a Windows 10 Universal App and the animation was causing a "page load flicker". Removing <Frame.ContentTransitions> in the AppShell.xaml solved the issue.

      – Kris Krause
      Sep 23 '15 at 10:19















    2














    I would try to disable default Frame.ContentTransitions by setting it to null, just after the rootFrame is created in App.xaml.cs file (don't forget to handle different events - Launched/ShareTarget/Activated - if needed):



    rootFrame.ContentTransitions = null


    once you have done that, pages shouldn't have transition. Then if you want, you can bring back or set new transitions for Frame's content upon specific circumstances, or set transitions for pages individually, for example in Page's XAML:



    <Page.Transitions>
    <TransitionCollection>
    <EntranceThemeTransition/>
    </TransitionCollection>
    </Page.Transitions>





    share|improve this answer


















    • 1





      I am using a WebView in a Windows 10 Universal App and the animation was causing a "page load flicker". Removing <Frame.ContentTransitions> in the AppShell.xaml solved the issue.

      – Kris Krause
      Sep 23 '15 at 10:19













    2












    2








    2







    I would try to disable default Frame.ContentTransitions by setting it to null, just after the rootFrame is created in App.xaml.cs file (don't forget to handle different events - Launched/ShareTarget/Activated - if needed):



    rootFrame.ContentTransitions = null


    once you have done that, pages shouldn't have transition. Then if you want, you can bring back or set new transitions for Frame's content upon specific circumstances, or set transitions for pages individually, for example in Page's XAML:



    <Page.Transitions>
    <TransitionCollection>
    <EntranceThemeTransition/>
    </TransitionCollection>
    </Page.Transitions>





    share|improve this answer













    I would try to disable default Frame.ContentTransitions by setting it to null, just after the rootFrame is created in App.xaml.cs file (don't forget to handle different events - Launched/ShareTarget/Activated - if needed):



    rootFrame.ContentTransitions = null


    once you have done that, pages shouldn't have transition. Then if you want, you can bring back or set new transitions for Frame's content upon specific circumstances, or set transitions for pages individually, for example in Page's XAML:



    <Page.Transitions>
    <TransitionCollection>
    <EntranceThemeTransition/>
    </TransitionCollection>
    </Page.Transitions>






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Apr 10 '15 at 11:01









    RomaszRomasz

    27.3k1167122




    27.3k1167122







    • 1





      I am using a WebView in a Windows 10 Universal App and the animation was causing a "page load flicker". Removing <Frame.ContentTransitions> in the AppShell.xaml solved the issue.

      – Kris Krause
      Sep 23 '15 at 10:19












    • 1





      I am using a WebView in a Windows 10 Universal App and the animation was causing a "page load flicker". Removing <Frame.ContentTransitions> in the AppShell.xaml solved the issue.

      – Kris Krause
      Sep 23 '15 at 10:19







    1




    1





    I am using a WebView in a Windows 10 Universal App and the animation was causing a "page load flicker". Removing <Frame.ContentTransitions> in the AppShell.xaml solved the issue.

    – Kris Krause
    Sep 23 '15 at 10:19





    I am using a WebView in a Windows 10 Universal App and the animation was causing a "page load flicker". Removing <Frame.ContentTransitions> in the AppShell.xaml solved the issue.

    – Kris Krause
    Sep 23 '15 at 10:19













    0














    For those who want to do the same thing for a Windows 10 UWP app, it can be achieved like this:



    // Navigate to your first page without a transition 
    Frame.Navigate(typeof(MainPage), null, new SuppressNavigationTransitionInfo());


    According to this MSDN document.






    share|improve this answer



























      0














      For those who want to do the same thing for a Windows 10 UWP app, it can be achieved like this:



      // Navigate to your first page without a transition 
      Frame.Navigate(typeof(MainPage), null, new SuppressNavigationTransitionInfo());


      According to this MSDN document.






      share|improve this answer

























        0












        0








        0







        For those who want to do the same thing for a Windows 10 UWP app, it can be achieved like this:



        // Navigate to your first page without a transition 
        Frame.Navigate(typeof(MainPage), null, new SuppressNavigationTransitionInfo());


        According to this MSDN document.






        share|improve this answer













        For those who want to do the same thing for a Windows 10 UWP app, it can be achieved like this:



        // Navigate to your first page without a transition 
        Frame.Navigate(typeof(MainPage), null, new SuppressNavigationTransitionInfo());


        According to this MSDN document.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 14 '18 at 20:26









        t.m.t.m.

        737717




        737717



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f29559071%2fhow-do-i-set-frame-navigate-to-happen-immediately-with-no-transition%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to how show current date and time by default on contact form 7 in WordPress without taking input from user in datetimepicker

            Syphilis

            Darth Vader #20