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

cn 域名网站找推网

cn 域名网站,找推网,中国建设网站,自己怎么设计公主裙WPF Property Grid控件使用属性定义定义如何做和显示 本教程示范如何绑定WP Property Grid控件到数据和创建属性定义。 执行如下步骤 第一步-创建属性定义 添加PropertyGridControl组件到项目。 打开工具箱在vs,定位到DX.23.1: Data 面板,选择Prope…

WPF Property Grid控件使用属性定义定义如何做和显示

本教程示范如何绑定WP Property Grid控件到数据和创建属性定义。

执行如下步骤

第一步-创建属性定义

添加PropertyGridControl组件到项目。

打开工具箱在vs,定位到DX.23.1: Data 面板,选择PropertyGridControl工具箱选项,拖动到窗口。

右键点击Property Grid选择Layout | Reset All填充全部窗口:

第二步-创建数据对象

创建数据对象和设置到DataContext

namespace Creating_Definitions {public partial class MainWindow : Window {public MainWindow() {InitializeComponent();DataContext = new Customer() {ID = 1,FirstName = "Nancy",LastName = "Davolio",Gender = Gender.Female,BirthDate = new DateTime(1948, 8, 12),Phone = "7138638137"};}public class Customer {public int ID { get; set; }public string FirstName { get; set; }public string LastName { get; set; }public Gender Gender { get; set; }public DateTime BirthDate { get; set; }public string Phone { get; set; }}public enum Gender { Male, Female }}
}

第三步-绑定Property Grid到Data Object

使用property grid PropertyGridControl.SelectedObject 属性绑定数据

<Windowxmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:dxprg="http://schemas.devexpress.com/winfx/2008/xaml/propertygrid" x:Class="PG_lesson1.MainWindow"Title="MainWindow" Height="250" Width="525"><Grid><dxprg:PropertyGridControl SelectedObject="{Binding}" /></Grid>
</Window>

步骤四-创建属性定义

添加属性定义到Property Grid.设置PropertyGridControl.ShowProperties属性ShowPropertiesMode.WithPropertyDefinitions,隐藏未定义属性:

<Windowxmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:sys="clr-namespace:System;assembly=mscorlib"xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"xmlns:dxprg="http://schemas.devexpress.com/winfx/2008/xaml/propertygrid" x:Class="PG_lesson1.MainWindow"Title="MainWindow" Height="250" Width="525"><Grid><dxprg:PropertyGridControl SelectedObject="{Binding}" ShowProperties="WithPropertyDefinitions" ><dxprg:PropertyDefinition Type="sys:String" /><dxprg:PropertyDefinition Path="Gender" /><dxprg:PropertyDefinition Path="BirthDate" /></dxprg:PropertyGridControl></Grid>
</Window>

运行程序看到结果

http://www.yayakq.cn/news/460468/

相关文章:

  • 免费seo网站自动推广软件网站建设算什么行业
  • 建网站哪家最好汽车零部件公司网站建设方案
  • 外贸网站建设注意什么郑州新闻发布
  • 成都网站建设龙兵网络大牌网站设计
  • 网站建设三个阶段泸州网站建设唐网互联
  • 我公司让别人做网站了怎么办佛山新网站建设咨询
  • 监控摄像机网站建设婚恋网站排名
  • 申请自助建站广东东莞人才招聘网
  • 铭万魔方做网站怎么样海口手机建站模板
  • 介绍北京的网站html网架公司名字大全
  • 网站架构分类广州网络营销外包团队
  • 东城企业网站建设教育类网站源码
  • 长治网站制作的流程莱芜论坛最新消息
  • 公司网站后台更新企业网是什么意思
  • 重庆涪陵网站建设给图像做标注的网站
  • 网站ui用什么做网站统计开放平台
  • 电子商务网站建设百度文库网站开发的要求
  • 做家纺网站哪家好做婚纱网站的图片
  • 厦门企业建网站制作三合一网站建设方案
  • 广州门户网站做网站赔了8万
  • 沧州网站建设哪家好国内最好的seo培训
  • 快递公司网站模板终端客户管理系统
  • 南通做网站公司哪家好企业网站建设全包
  • 网站建设费的税率交换友情链接的平台有哪些
  • 南昌做网站电话微餐饮网站建设比较好
  • 怎样做二维码链接到网站上cms网站开发实验报告
  • 大连甘井子区做网站优化需要做哪些事项
  • 张家界网站seowordpress写文章模板
  • 定制旅游网站有哪些电商类网站建设价格
  • 上海崇明林业建设有限公司网站旅游网站模板html免费下载