Windows 8 Application bar

Source: Internet
Author: User

In Windows 8, right-click or operate the touch screen. A menu is displayed at the bottom of the screen. This is the application bar.

The application bar is similar to the menu bar in 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>

The AppBar label is a control area that allows you to set any layout. In the previous example, we set the layout that is common in Win8 applications. There are several buttons on the left and several buttons on the right.

The button is directly represented by the button control, and the event or name is added by itself. The style is generally the style that comes with the system, and the style file is in the common/standardstyles. XAML path of the project file.

By default, all the configurations of these styles are annotated. If you need button Styles, you need to manually uncomment them, as shown below:

<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>

In this way, you can change the button style by setting the button attribute style = "{staticresource refreshappbarbuttonstyle }".

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.