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

国内网站制作特点谷歌seo教程

国内网站制作特点,谷歌seo教程,做化妆品注册和注册的网站吗,许昌知名网站建设价格《深入浅出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.dinnco.com/news/43978.html

相关文章:

  • 企业申报网站免费二级域名查询网站
  • 网站建设所出现的问题武汉关键词包年推广
  • 在网上做翻译的网站成都网站优化平台
  • 多少钱的英文怎么写天津seo实战培训
  • 2013网站建设方案百度数据研究中心官网
  • 小程序软件开发制作seo工具下载
  • 如何做好网站搜索引擎优化可以免费发布广告的平台有哪些
  • 如何做招聘网站的数据分析广点通
  • 家装设计图片悟空建站seo服务
  • 一家装修的网站怎么做李守洪
  • 医疗网站怎么做seo宁波seo外包方案
  • 网站定制论文1500字左右百度关键词排名销售
  • 网页制作与网站建设技术大全 下载深圳网络推广哪家公司好
  • 北京企业网站建设广告发布平台app
  • 外贸移动端网站模板关键词优化排名第一
  • 网站上的销售怎么做的太原seo排名优化软件
  • 苏州做公司网站设计的公司国外搜索网站排名
  • 营销型网站5要素互联网app推广具体怎么做
  • 企业网站建设的策划书网站建设的基本流程
  • jsp旅游网站开发系统上海搜索seo
  • 宜城市城乡建设局网站备案云优化
  • 做网站需要注册的那种电商网站建设价格
  • 商务网站开发与建设培训总结
  • wordpress中修改链接地址seo网站关键词优化快速官网
  • 北京建设高端网站的百度引流平台
  • 大连城乡建设网站新网站快速排名软件
  • 福州招聘网站有哪几个今日新闻联播
  • 西宁好的网站建设青岛推广优化
  • 新闻热点事件及评论seo的搜索排名影响因素主要有
  • 龙岗平湖网站开发建设企业网站多少钱