繁体   English   中英

如何从一个 state 平滑过渡到另一个 SplitView UWP

[英]How to make a smooth transition from one state to another SplitView UWP

我正在尝试从封闭面板平稳过渡到开放面板,反之亦然。

但我不知道该怎么做((

我有一个元素

<SplitView Style="{StaticResource SplitViewEditMusicTraskStyle}"               
                   CompactPaneLength="0"
                   PaneBackground="Transparent"
                   DisplayMode="CompactInline"
                   IsPaneOpen="{Binding EditPanelIsOpen, Mode=TwoWay}"
                   OpenPaneLength="308"
                   Background="Transparent"
                   PanePlacement="Right">

我无法附加标准元素模板,因为 stackoverflov 对每个堆栈的字符数有限制

如何从一个 state 平滑过渡到另一个 SplitView UWP

测试过程中,如果正确设置PanePlacement ,为使 SplitView 面板顺利打开,请将 DisplyMode 设置为OverlayCompactOverlay

<SplitView x:Name="splitView" PaneBackground="{ThemeResource SystemControlBackgroundChromeMediumLowBrush}"
       IsPaneOpen="False" OpenPaneLength="328" CompactPaneLength="56" DisplayMode="CompactOverlay">

根据您的要求,您还可以制作弹出控件并将ChildTransitions设置为PaneThemeTransition以存档从关闭面板到打开面板的平滑过渡。 更多请参考以下代码。

Xaml 代码

<Popup
        x:Name="RightMeun"
        Width="200"
        Height="{Binding ElementName=RootGrid, Path=ActualHeight}"
        HorizontalAlignment="Right"
        IsOpen="False">

        <Popup.ChildTransitions>
            <TransitionCollection>
                <PaneThemeTransition Edge="Right" />
            </TransitionCollection>
        </Popup.ChildTransitions>
        <Grid
            Width="200"
            Height="{Binding ElementName=RightMeun, Path=Height}"
            Background="LightBlue">
            <TextBlock
                HorizontalAlignment="Center"
                VerticalAlignment="Center"
                Text="Hello" />
        </Grid>
</Popup>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM