zoukankan      html  css  js  c++  java
  • wpf学习笔记初识xaml标签语言

          最近下载了windows sdk,也来凑下热闹学学新技术。顺便也简单的记录下学习过程.此非教程.由于刚接触,一切皆以实用为主.先了解其特性为好.


    一.xaml的结构为xml形式组成,与flex中的标签语言很相似.这个是比html好的地方,不写废话了.写些实用的东西

    二.XAML基本语法

    1.根元素必须声明命名空间,如

    <Page 
      
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x
    ="http://schemas.microsoft.com/winfx/2006/xaml">
      
    </Page>


    2.声明XAML控件(标签)

    <Button Content="Click Me"/>或<Button>Click Me</Button>

    3.定义标签属性

    <Button Background="Blue" Foreground="Red" Content="This is a button"/>


    <Button>
      
    <Button.Background>
        
    <SolidColorBrush Color="Blue"/>
      
    </Button.Background>
      
    <Button.Foreground>
        
    <SolidColorBrush Color="Red"/>
      
    </Button.Foreground>
      
    <Button.Content>
        This is a button
      
    </Button.Content>
    </Button>


    4.触发事件

    <Button Background="Blue" Click="OnClick" Content="This is a button"/>

    void OnClick(object sender, RoutedEventArgs e)
    {

       }



    5.页面跳转

    <Hyperlink NavigateUri="UriOfPageToNavigateTo.xaml">Navigate</Hyperlink>
     
    第一篇还不知道写些什么,先就这样好了
  • 相关阅读:
    Apache Pig的前世今生
    openssl之EVP系列之6---EVP_Encrypt系列函数编程架构及样例
    P3388 【模板】割点(割顶)
    让priority_queue支持小根堆的几种方法
    2017.11.7解题报告
    一个例子教你如何与出题人斗智斗勇
    debug
    树上倍增求LCA及例题
    素数的筛法
    Catalan卡特兰数入门
  • 原文地址:https://www.cnblogs.com/Clingingboy/p/663273.html
Copyright © 2011-2022 走看看