win8 metro 增加顶部栏,添加上传按钮

   <UserControl.Resources>

        <Style x:Key="UploadViewAppBarButtonStyle" TargetType="Button" 

           BasedOn="{StaticResource AppBarButtonStyle}">

            <Setter Property="AutomationProperties.AutomationId" Value="UploadViewAppBarButton"/>

            <Setter Property="AutomationProperties.Name" Value="上传图片"/>

            <Setter Property="Content" Value="&#xE12B;"/>

        </Style>

       ...

    </UserControl.Resources>



    <Page.TopAppBar>

        <AppBar Padding="10,0,10,0">

            <Grid>

                <Button Click="UploadImage_Click" HorizontalAlignment="Right" 

                    Style="{StaticResource UploadViewAppBarButtonStyle}"/>

            </Grid>

        </AppBar>

    </Page.TopAppBar>

你可能感兴趣的:(metro)