如何在Windows Phone中创建像app栏一样的自下而上的幻灯片菜单

时间:2015-03-11 07:04:59

标签: wpf xaml silverlight windows-phone-7 windows-phone-8

您好我需要创建一个自定义的自下而上的幻灯片菜单...类似于Windows Phone中的应用栏。我怎样才能做到这一点。请任何一点开始?

UI如下图所示:当用户滑动按钮面板时,底部面板的状态应该从1变为2 ....这与app bar的控制非常相似,但我需要添加一个自定义控件...

This is default state

This is state after user slide it

3 个答案:

答案 0 :(得分:0)

    <Grid Name="GridDemo">

        <Grid.Triggers>
            <EventTrigger RoutedEvent="MouseEnter">
                <BeginStoryboard>
                    <Storyboard>
                        <DoubleAnimation 
                        Storyboard.TargetName="ControlsGrid" 
                        Storyboard.TargetProperty="(Grid.Height)"
                        From="0" 
                        To="66" 
                        Duration="0:0:0.5" />
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger>
            <EventTrigger RoutedEvent="MouseLeave">
                <BeginStoryboard>
                    <Storyboard>
                        <DoubleAnimation 
                        Storyboard.TargetName="ControlsGrid"
                        Storyboard.TargetProperty="(Grid.Height)"
                        From="66" 
                        To="0" 
                        Duration="0:0:0.5" />
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger>
        </Grid.Triggers>

        <!-- 
        This is a sample content to demostrate animation;
        Without it 'GridDemo' will be collapsed.
    -->


        <Grid Margin="0" Name="ControlsGrid" VerticalAlignment="Bottom" Background="Black" />
    </Grid>

</Window>

答案 1 :(得分:0)

从头开始开发视图转换并非易事,但幸运的是,有预先编写的库可以为我们做到这一点。到目前为止,我发现的最好的是Transitionals。您可以从CodePlex的Transitionals页面下载dll。

答案 2 :(得分:0)

我已经能够通过操纵翻译效果来解决这个问题。如此处的示例http://blog.scottlogic.com/2012/06/06/a-gesture-driven-windows-phone-to-do-application.html?utm_source=tuicool

所示