zoukankan      html  css  js  c++  java
  • Windows 8 应用栏

    Windows 8中右键鼠标或者操作触摸屏,屏幕底层会弹出一个菜单,这个就是应用栏。

    应用栏类似于Windows Phone中的菜单栏:

     1 <Page.BottomAppBar>
     2     <AppBar x:Name="BottomAppBar">
     3         <Grid>
     4             <Grid.ColumnDefinitions>
     5                 <ColumnDefinition Width="50*"/>
     6                 <ColumnDefinition Width="50*"/>
     7             </Grid.ColumnDefinitions>
     8             <StackPanel x:Name="LeftPanel" Orientation="Horizontal" Grid.Column="0" HorizontalAlignment="Left">
     9                 <Button x:Name="Edit" Style="{StaticResource EditAppBarButtonStyle}" Click="Edit_Button_Click"/>
    10                 <Button x:Name="Save" Style="{StaticResource SaveAppBarButtonStyle}"/>
    11                 <Button x:Name="Delete" Style="{StaticResource DeleteAppBarButtonStyle}"/>
    12             </StackPanel>
    13             <StackPanel x:Name="RightPanel" Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Right">
    14                 <Button x:Name="Refresh" Style="{StaticResource RefreshAppBarButtonStyle}"/>
    15             </StackPanel>
    16         </Grid>
    17     </AppBar>
    18 </Page.BottomAppBar>

    AppBar标签中就是一个控件区域,可以设置任意的布局,上例设置的是我们在Win8应用中常见的布局,左侧几个按钮,右侧几个按钮

    按钮直接用Button控件表示,事件或Name自己添加,样式一般是用系统自带的样式,样式文件都在工程文件的路径Common/StandardStyles.xaml中

    默认这些样式的配置都是被注释的,如果需要哪些按钮样式,需要手动取消注释,如下

    <Style x:Key="RefreshAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
            <Setter Property="AutomationProperties.AutomationId" Value="RefreshAppBarButton"/>
            <Setter Property="AutomationProperties.Name" Value="Refresh"/>
            <Setter Property="Content" Value="&#xE117;"/>
        </Style>

    这样就可以通过设置Button属性 Style="{StaticResource RefreshAppBarButtonStyle}" 来更改Button样式

  • 相关阅读:
    android ListView美化-->几个比较特别的属性
    微博开发第一讲 知识点--2014.04.23
    ubuntu snap install 代理设置
    君正X2000开发板试用体验之二:君正X2000引导过程分析
    君正X2000开发板试用体验之一:开箱
    消除USB麦克风的电流声
    IT专业词汇中文译名探讨
    PCI/PCIE总线的历史
    龙芯派ejtag.cfg设置
    uos运行ejtag报错,找不到libreadline.so.6, libncurses.so.5, libusb-0.1.so.4
  • 原文地址:https://www.cnblogs.com/fengbeihong/p/3023537.html
Copyright © 2011-2022 走看看