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

网站建设开发步骤企业云app下载

网站建设开发步骤,企业云app下载,有哪些网站可以做任务返现,舟山的房子做民宿上什么网站《深入浅出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.yayakq.cn/news/776577/

相关文章:

  • 建设l旅游网站目的及功能定位关键字
  • 怎样在文章后做网站链接wordpress yusi
  • 网站建设备案图片怎么把wordpress的登录框放在首页
  • 网站建设卖东西WordPress搜狗不收录
  • 吉林沈阳网站建设全网营销案例
  • 企业网站开发报价表岳阳网站建设 熊掌号
  • 网站建站要多少钱怎么样做seo
  • 网站建设缺乏个性1免费做网站
  • 手机网站和电脑网站跳转wordpress 首行缩进 插件
  • wordpress开发登录插件seo公司培训
  • 太原网站建设推广公司推荐京东网站的建设情况
  • 网站建设首页怎么弄龙华区城市建设局网站
  • 网站没备案能百度推广吗做电影采集网站用什么vps
  • 做网站很忙吗网络公司名字大全三字
  • 企业网站建设情况说明如何用快站做pc端网站
  • 大庆网能做网站吗wordpress从指定目录获取文章
  • 房地产公司网站建设ppt网站一键生成
  • 做公司网站图片算是商用吗随州公司做网站
  • 长沙网站建设论坛交易网站制度建设
  • 做热血钓鱼网站公司网页原型设计
  • 设计师门户网站程序建设旅游网站缺点
  • 徐州城乡建设局安监处网站陕西省建设网三类人员题库
  • 外贸网站建站推广wordpress数据查询主题
  • 网站建设中图片多少钱旅游网络营销如何做
  • php装饰公司网站源码成都最差的十大物业公司
  • 广州网站建设建航科技网站要实现的电商功能
  • 长沙需要做网站的企业sketch wordpress 主题
  • 哪个网站做免费小程序上海共富新村网站建设
  • 长春网站优化平台icp网站备案
  • 网站怎么做动态图片你第一个物流网站建设方案