【问题标题】:How to create bottom to top slide menu like app bar in Windows Phone如何在 Windows Phone 中创建类似应用栏的自下而上滑动菜单
【发布时间】:2015-03-11 07:04:58
【问题描述】:

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

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

【问题讨论】:

  • 我需要一个控件,我可以在另一个控件上滑动..而不是与另一个控件一起滑动...它应该具有类似于 windows phone 中的应用栏的效果..
  • 我告诉你怎么做,看看并尝试一下谢谢@Balraj Singh

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


【解决方案1】:

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

【讨论】:

    【解决方案2】:
        <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>
    

    【讨论】:

    • 我需要这个使用触摸滑动事件有可能吗?
    【解决方案3】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-04-15
      • 1970-01-01
      • 2013-06-03
      • 1970-01-01
      • 1970-01-01
      • 2011-10-20
      • 1970-01-01
      相关资源
      最近更新 更多