What is Continuum Transition ExitElement and how do I use it?

I am adding ContinuumNavigationTransitionInfo to my application, and I have an issue (I'll get to it in a moment) which I think might be solvable by setting the ExitElement property to something appropriate. So, what does ExitElement do, and how do I use it?

For example I see no difference setting the property (very naively):

<Page.Transitions>
    <TransitionCollection>
        <NavigationThemeTransition>
            <ContinuumNavigationTransitionInfo>
                <ContinuumNavigationTransitionInfo.ExitElement>
                    <Canvas Background="Red" Width="500" Height="500" />
                </ContinuumNavigationTransitionInfo.ExitElement>
            </ContinuumNavigationTransitionInfo>
        </NavigationThemeTransition>
    </TransitionCollection>
</Page.Transitions>

The issue I'm trying to solve, which I'm hoping I might be able to solve with this property, is that I have a page in my app which forces the light theme ( RequestedTheme="Light" ). This page can link to itself, but as I'm running the OS in dark theme, I see a startling black flash in the transition, which I think is the OS theme background color, which I'd like to override as white.


You set the exit element on one of your content elements on your page, not in the TransitionInfo iself. I is only writable, because the page will set the exit element when initiating the transition.

Like for example:

<TextBlock Text="This is the exit element" ContinuumNavigationTransitionInfo.IsExitElement="True" />

If you set this, the exit element will get animated (it kind of flies out to the bottom of your page). You don't have to set it to the ContinuumNavigationTransitionInfo itself, but on one of your pages elements.

Also be aware: The Exit element is set on the page from that you are navigating TO a page with the Continuum Navigation on it.

So:

Page 1 (Set IsExitElement = true here)

Page 2 (Set ContinuumNavigationTransitionInfo here)

链接地址: http://www.djcxy.com/p/68020.html

上一篇: StatusBar的默认ForegroundColor取决于主题

下一篇: 什么是Continuum Transition ExitElement?我该如何使用它?