11-28win8 AppBar

来源:互联网 发布:淘宝凤求凰cdk抽奖 编辑:程序博客网 时间:2024/06/05 23:50

  手势向上或者鼠标右键时AppBar出现
看看AppBar是什么,通过查看其Content属性知道AppBar中可以放任何控件
AppBar只是win8提供的在特殊位置显示的占位控件,可以向其中放入任何控件,说到底我们只是通过向其中放置控件来将控件放到顶部或底部(单机右键或者向上手势时出现)
AppBar样式
IsOpen:设置在程序加载时是否默认显示AppBar
IsOpen="True"
IsSticky="True"
Opened事件
Closed事件

 

来个例子吧

********************************xaml中

 <Page.TopAppBar >
        <AppBar IsOpen="True" >
            <StackPanel Orientation="Horizontal"  >
                <Button Click="Button_Click_1" Style="{StaticResource  PlayAppBarButtonStyle}" AutomationProperties.Name =" 播放"></Button>
                <Button Style="{StaticResource  PauseAppBarButtonStyle}" AutomationProperties.Name=" 暂停"></Button>
           </StackPanel>
        </AppBar>
    </Page.TopAppBar>
    <Page.BottomAppBar >
        <AppBar IsSticky="True" Closed="AppBar_Closed_1"  >
            <StackPanel>
                <Button Content=" 同步"></Button>
               
            </StackPanel>

        </AppBar>
    </Page.BottomAppBar>
        <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
        <Button Content=" 按钮"  FontSize="30">
        </Button>
    </Grid>

 

实现其功能其实也很简单,就是写一写属性和样式主要看你的熟练程度了。

 

 

 

 

 


原创粉丝点击