• windows PHONE 开发-入门程序构筑


    1:页面的扩展名为:.xaml文件类似于ASPX一样可以编写客户端显示内容和后台处理内容

    一般的前台页面的形式为:

    <Page
        x:Class="MyFirstApp.MainPage"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="using:MyFirstApp"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d"
    <!-- 引用命名空间-->
    xmlns:TabCtl="using:CustomControl"
    <!-- 调用后台pageSizeChanged方法-->
    SizeChanged="pageSizeChanged"
    <!-- 设置页面背景颜色为白色-->
    Background="White"> <!-- 上面工具栏--> <Page.TopAppBar> <AppBar x:Name="topBar" IsSticky="True" Style="{StaticResource TopBar}" Closed="ModeToolBar_Closed" Opened="topBar_Opened" > <Grid x:Name="MenuGrid" VerticalAlignment="Center"> <Grid.ColumnDefinitions> <ColumnDefinition Width="71"/> <ColumnDefinition MinWidth="615" Width="*" /> <ColumnDefinition Width="105> </Grid.ColumnDefinitions> <AppBarButton x:Name="tooltest1" Label="test1" Click="btntest_Click"></AppBarButton> <AppBarButton x:Name="tooltest2" Grid.Column="2" Label="test2" IsEnabled="False"></AppBarButton> </Grid> </AppBar> </Page.TopAppBar> <!-- 下面工具栏--> <Page.BottomAppBar> <AppBar x:Name="ModeToolBar" IsSticky="True" Style="{StaticResource BottomAppBar}" > <Grid x:Name="EditGrid" VerticalAlignment="Center"> <Grid.ColumnDefinitions> <ColumnDefinition Width="53" /> <ColumnDefinition Width="105" /> </Grid.ColumnDefinitions> <AppBarButton x:Name="tooltest3" Grid.Column="1" HorizontalAlignment="Center" Label="test3" ></AppBarButton> <AppBarButton x:Name="tooltest4" Grid.Column="2" HorizontalAlignment="Center" Label="test4" ></AppBarButton> </Grid> </AppBar> </Page.BottomAppBar> </Page>

    2:利用StaticResource引用样式的一般步骤
    创建Styles文件夹,并在文件夹中创建Styles.xaml文件

    删除Styles.xaml.cs文件

    打开Styles.xaml文件,写入样式代码如下

    <ResourceDictionary
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="using:MyFirstAppStyles">
    <Style x:Key="TopBar" TargetType="AppBar"> <Setter Property="Height" Value="85"/> <Setter Property="Background" Value="#CC222846"/> </Style>
    </ResourceDictionary>

    在App.xaml配置关联文件

    <Application
        x:Class="MyFirstApp.App"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="using:MyFirstApp">
        
        <!--关联Resources文件-->
        <Application.Resources>
            <ResourceDictionary>
                <ResourceDictionary.MergedDictionaries>
                    <ResourceDictionary Source="Styles/Styles.xaml" />
                </ResourceDictionary.MergedDictionaries>
            </ResourceDictionary>
        </Application.Resources>
        
    </Application>


     

  • 相关阅读:
    【笔记】网易微专业-Web安全工程师-04.WEB安全实战-7.SQL回显注入
    【笔记】网易微专业-Web安全工程师-04.WEB安全实战-6.文件上传
    【笔记】网易微专业-Web安全工程师-04.WEB安全实战-5.文件包含
    【笔记】网易微专业-Web安全工程师-04.WEB安全实战-4.CSRF
    zoom和transform:scale的区别
    图片上黑色透明遮罩的实现
    如何实现两行文本增多显示省略号
    H5如何实现一行三列布局
    H5瀑布流如何实现
    H5一行显示两个正方形
  • 原文地址:https://www.cnblogs.com/wequst/p/4031685.html
Copyright © 2020-2023  润新知