当前位置: 首页 > news >正文

适合大学生做的兼职网站有哪些免费网站站长查询

适合大学生做的兼职网站有哪些,免费网站站长查询,兼职学网页设计怎么样,注册公司有什么条件《深入浅出WPF》读书笔记.4名称空间详解 背景 主要讲明名称空间概念,可以理解为命名空间的引用。 xmlns:x"http://schemas.microsoft.com/winfx/2006/xaml" 👆如x可以理解为一些列命名空间的引用。 不一一列举,只讲几个特殊的…

《深入浅出WPF》读书笔记.4名称空间详解

背景

主要讲明名称空间概念,可以理解为命名空间的引用。

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

👆如x可以理解为一些列命名空间的引用。

不一一列举,只讲几个特殊的名称空间x:Type x:Null x:Data x:Code

代码

x:Type

指定数据类型

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;namespace WpfBookDemo
{public class MyButton:Button{public Type UserWindowType {  get; set; }protected override void OnClick(){base.OnClick();Window win=Activator.CreateInstance(this.UserWindowType) as Window;if(win is not null){win.Show();}}}
}
<Window x:Class="WpfBookDemo.MyWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"xmlns:local="clr-namespace:WpfBookDemo"mc:Ignorable="d"Title="MyWindow" Height="300" Width="300" ><Grid><StackPanel VerticalAlignment="Center"><TextBox Width="120" Background="LightGreen" Margin="5"></TextBox><TextBox Width="120" Background="LightGreen" Margin="5"></TextBox><TextBox Width="120" Background="LightGreen" Margin="5"></TextBox><Button Width="120" Background="LightGreen" Content="点击一下" Margin="5"></Button></StackPanel></Grid>
</Window>
<Window x:Class="WpfBookDemo.xTypeDemo"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"xmlns:local="clr-namespace:WpfBookDemo"mc:Ignorable="d"Title="xTypeDemo" Height="450" Width="800"><Grid><local:MyButton x:Name="mbtn" Content="点击一下" Width="120" Height="40"UserWindowType="{x:Type local:MyWindow}"></local:MyButton></Grid>
</Window>

x:Null

为属性设置空值

<Window x:Class="WpfBookDemo.xNullDemo"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"xmlns:local="clr-namespace:WpfBookDemo"mc:Ignorable="d"Title="xNullDemo" Height="450" Width="300"><Window.Resources><Style x:Key="{x:Type Button}" TargetType="{x:Type Button}"><Setter Property="Width" Value="60"></Setter><Setter Property="Height" Value="36"></Setter><Setter Property="Margin" Value="5"></Setter></Style></Window.Resources><Grid><StackPanel VerticalAlignment="Center"><Button></Button><Button ></Button><Button ></Button><Button  Style="{x:Null}" Content="没有样式"></Button></StackPanel></Grid>
</Window>

x:Data

数据提供者

<Window x:Class="WpfBookDemo.xDataDemo"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"xmlns:local="clr-namespace:WpfBookDemo"mc:Ignorable="d"Title="xDataDemo" Height="200" Width="300"><Window.Resources><XmlDataProvider x:Key="InventoryData" XPath="Fruits"><x:XData xmlns=""><Fruits ><Fruit Name="Apple">Apple</Fruit><Fruit Name="Banana">Banana</Fruit><Fruit Name="Orange">Orange</Fruit></Fruits></x:XData></XmlDataProvider></Window.Resources><Grid><StackPanel VerticalAlignment="Center" Height="150"><ListBox ItemsSource="{Binding Source={StaticResource InventoryData}, XPath=Fruit}"></ListBox></StackPanel></Grid>
</Window>

x:Code

可以将后端代码挪到xam中

<Window x:Class="WpfBookDemo.xCodeDemo"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"xmlns:local="clr-namespace:WpfBookDemo"mc:Ignorable="d"Title="xCodeDemo" Height="450" Width="800"><Grid><StackPanel VerticalAlignment="Center" HorizontalAlignment="Center"><Button x:Name="btn" Content="点击一下" Click="btn_Click" Width="120" Height="40"></Button></StackPanel></Grid><x:Code><![CDATA[private void btn_Click(object sender, RoutedEventArgs e){MessageBox.Show("使用x:Code可以将后端代码挪动到前端!");}]]></x:Code>
</Window>

不想写代码,只想干黑悟空,但是菜!

http://www.hotlads.com/news/1073.html

相关文章:

  • 做网站是要编程吗下载百度app最新版并安装
  • 二级网站建设管理制度长沙本地推广
  • 网站维护难做seo优化检测
  • 营销网站设计公司有哪些百度网盘网页
  • 小语种网站建设要点免费推广公司的网站
  • 网站开发技巧淘宝交易指数换算工具
  • 营销型网站建设深圳百度收录量
  • wordpress页面靠左福州seo网站推广优化
  • 南京制作网页培训机构seo培训价格
  • 曲靖网站制作公司网页制作流程
  • html5做服装网站网络销售怎么干
  • 新疆建筑工程网站seo常用工具包括
  • 网站制作开发网络营销企业网站推广
  • 网站开发团队简介如何写长沙本地推广联系电话
  • 四方坪网站建设西安seo盐城
  • wordpress登陆seo高端培训
  • 海洋高端的专业做网站哪里有营销策划培训班
  • 厦门网站设计公司找哪家厦门小程序建设深圳网站建设
  • 广州站到广州南站地铁要多久今日国内新闻大事
  • 马和人做人和牛做网站seo网络营销推广排名
  • 中英文双版网站怎么做制作一个app软件需要多少钱
  • 寻找大连网站建设武汉新一轮疫情
  • seo网站建设 大时代下载百度语音导航地图安装
  • 现在有哪些网址深圳搜索优化排名
  • 深圳本地招聘网站营销策划书范文案例
  • wordpress真实用户ip插件淘宝关键词优化技巧教程
  • 绵阳做网站的软文网站发布平台
  • 官方网站建设pptseo网站诊断价格
  • 常山做网站广点通
  • 东莞网页模板建站环球网最新消息疫情