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

一流的网站建设流程图关于配色的网站

一流的网站建设流程图,关于配色的网站,搜索引擎关键词的工具,百度指数怎样使用首先是绑定一个属性&#xff0c;属性名称无所谓。到时候看属性设置的啥&#xff0c;可能要改。 <DataGrid ItemsSource"{Binding Index_instance}"/> 然后创建INotifyPropertyChanged的类&#xff0c;并把相关固定的代码粘贴上去。 然后把这个目录类建好&am…

首先是绑定一个属性,属性名称无所谓。到时候看属性设置的啥,可能要改。

<DataGrid ItemsSource="{Binding Index_instance}"/>

然后创建INotifyPropertyChanged的类,并把相关固定的代码粘贴上去。

然后把这个目录类建好,要用

    public class Index1{public int Id { get; set; }public string Name { get; set; }public string Status { get; set; }}

用这个目录类创建属性

 private ObservableCollection<Index1> _index_instance;public ObservableCollection<Index1> Index_instance{get { return _index_instance; }set{_index_instance = value;OnPropertyChanged(nameof(Index_instance));}}

再创建构造函数,搞三个实例,并赋值。

        public Notify(){Index_instance = new ObservableCollection<Index1>{new Index1() {Id= 1, Name="Test 1", Status="Active" },new Index1() {Id= 2, Name="Test 2", Status="Inactive" },new Index1() {Id= 3, Name="Test 3", Status="Bad" },};}

最后一步,把窗口资源导向这个类的实例

DataContext = new Notify();

后台代码:

主窗口后台使用DataContext = new Notify();对应的类名称来引入自己定义的类里面的属性。

在VieModel中

class ViewModel:INotifyPropertyChanged
{private ObservableCollection<Index1> _dataGridSource;public ObservableCollection<Index1> DataGridSource{get { return _dataGridSource; }set { _dataGridSource = value;OnPropertyChanged(nameof(DataGridSource));}}public ViewModel(){_dataGridSource = new ObservableCollection<Index1>{new Index1(){Id=1,Name="Alic",Description="Active"}, new Index1(){Id=2,Name="Baliy",Description="Inactive"},new Index1(){Id=3,Name="Cecy",Description="Down"},};}//固定部分public event PropertyChangedEventHandler PropertyChanged;protected void OnPropertyChanged(string propertyName){PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));}}
public class Index1
{public int Id { get; set; }public string Name { get; set; }public string Description { get; set; }
}

XAML部分:

<Window x:Class="DataGrid练习2.MainWindow"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:DataGrid练习2"mc:Ignorable="d"Title="MainWindow" Height="450" Width="800"><Grid><DataGrid Margin="30" ItemsSource="{Binding DataGridSource}"/></Grid>
</Window>

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

相关文章:

  • wordpress网站上传莱州人才网
  • 北京大学网站建设电子商务网站建设作文
  • 免费ai写作网站3000字房产网站程序
  • 网站建设行业资讯炒股软件排名
  • 做旅游项目用哪家网站好孝感房产网站建设
  • 电子商务网站的特点官网优化哪家专业
  • 网站设计师与网站开发工程师如何做淘宝店网站
  • 什么网站做美式软装设计理念网站被人抄袭怎么办
  • 网站建设面谈话术网站建设论文的中期报告
  • 郑州服务设计公司网站房屋经纪人网站端口怎么做
  • 有人做网站花了10几万钓鱼网站的主要危害
  • 自己怎么来建设网站浙江建设厅 继续教育 网站首页
  • 可不可以自己做网站wordpress调用大类下的分类列表
  • 学校 网站源码网站建设的语言与工具
  • 销售做网站在线做头像的网站有哪些
  • 网站程序模板平面设计好找工作不
  • 做网站怎么接单手机app开发工具中文版
  • 图书馆网站结构怎么做北丰科技网站建设
  • 自学网站制作教程门户网站建设方案公司
  • 网站策划岗位职责怎么创建教育网站
  • 如何做网站域名备案wordpress文章字符插件
  • 海口网络建站模板如何做淘宝返利网站
  • wordpress虚拟3d网站html网页制作源代码免费
  • 网站建设费能入长期待摊吗泰安市违法建设网站
  • 成都网站设计哪家比较好大连网站建设优化
  • 做网站的图片素材网站建设哪家稳妥
  • 移动 网站模板职校计算机专业主要学什么
  • 网站建设怎么把代码放入网站上网站开发续签
  • 西安网站排名哪家公司好企业做网站的合同
  • 恩施市建设银行网站半月报网站建设商务代表工作总结