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

多用户建站系统源码广州番禺发现1例阳性

多用户建站系统源码,广州番禺发现1例阳性,微信网站设计价格,定制化网站开发公司数据绑定是一个很强大且优雅的技能#xff0c;之前用过好多次#xff0c;但有些地方总不是特别清晰#xff0c;常常需要重新翻阅资料来回顾#xff0c;于是这次用了几天时间好好梳理一下#xff0c;记录一下。 首先数据绑定对数据对象的要求#xff1a;需要是公有属性之前用过好多次但有些地方总不是特别清晰常常需要重新翻阅资料来回顾于是这次用了几天时间好好梳理一下记录一下。 首先数据绑定对数据对象的要求需要是公有属性不支持字段和私有属性。 如果需要在数据内容发生变化时自动更新到控件则需要实现INotifyPropertyChanged接口其包含 PropertyChanged事件在属性变化时引发PropertyChanged事件。 如果绑定对象为集合时需要在集合内容发生变化时自动更新到控件则需要INotifyCollectionChanged接口其包含CollectionChanged事件目前内置的泛型集合 ObservableCollection 实现了该接口。 通常在设置绑定时我们需要指定数据上下文DataContext如果控件没有设置DataContext则会去找父容器的DataContext依层级依次查找。也有些控件直接在代码中指定ItemsSource的。如果要绑定的数据依赖于另外一个控件的值可以在DataContext中绑定到另外一个控件的选中项然后设置该控件的数据源或者绑定值。 MainWindow.xaml Window x:ClassTestBinding.MainWindowxmlnshttp://schemas.microsoft.com/winfx/2006/xaml/presentationxmlns:xhttp://schemas.microsoft.com/winfx/2006/xamlxmlns:dhttp://schemas.microsoft.com/expression/blend/2008xmlns:mchttp://schemas.openxmlformats.org/markup-compatibility/2006xmlns:localclr-namespace:TestBindingmc:IgnorabledTitleMainWindow Height450 Width800StackPanel NameparentContainerStackPanel OrientationHorizontalTextBlockBindData:/TextBlockTextBox Text{Binding PathBindData}/TextBox/StackPanelStackPanel OrientationHorizontalTextBlockBindDatas:/TextBlockListBox NameexchangeListBox ItemsSource{Binding PathExchanges} DisplayMemberPathExchangeID/ListBox/StackPanelStackPanelComboBox NameinstrumentCombbox DataContext{Binding ElementNameexchangeListBox, PathSelectedItem} ItemsSource{Binding PathInstruments} DisplayMemberPathInstrumentID//StackPanelStackPanel OrientationHorizontal DataContext{Binding ElementNameinstrumentCombbox, PathSelectedItem}TextBlockExchangeID:/TextBlockTextBox Text{Binding PathExchangeID}/TextBox/StackPanelStackPanel OrientationHorizontal DataContext{Binding ElementNameinstrumentCombbox, PathSelectedItem}TextBlockInstrumentID:/TextBlockTextBox Text{Binding PathInstrumentID}/TextBox/StackPanelStackPanel OrientationHorizontal DataContext{Binding ElementNameinstrumentCombbox, PathSelectedItem}TextBlockInstrumentName:/TextBlockTextBox Text{Binding PathInstrumentName}/TextBox/StackPanel/StackPanel /WindowMainWindow.xaml.cs using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Runtime.CompilerServices; using System.Windows;namespace TestBinding;public class ViewModelBase : INotifyPropertyChanged {public event PropertyChangedEventHandler? PropertyChanged;protected virtual void OnPropertyChanged([CallerMemberName] string? propertyName null){PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));}protected virtual bool SetPropertyT(ref T member, T value, [CallerMemberName] string? propertyName null){if (EqualityComparerT.Default.Equals(member, value)){return false;}member value;OnPropertyChanged(propertyName);return true;} } public class ExchangeViewModel : ViewModelBase {private string exchangeID string.Empty;public string ExchangeID { get exchangeID; set SetProperty(ref exchangeID, value); }public ObservableCollectionInstrumentViewModel Instruments { get; set; } new ObservableCollectionInstrumentViewModel(); } public class InstrumentViewModel : ViewModelBase {public InstrumentViewModel(string exchangeID, string instrumentID, string instrumentName){ExchangeID exchangeID;InstrumentID instrumentID;InstrumentName instrumentName;}private string _exchangeID string.Empty;private string _instrumentID string.Empty;private string _instrumentName string.Empty;public string ExchangeID { get _exchangeID; set SetProperty(ref _exchangeID, value); }public string InstrumentID { get _instrumentID; set SetProperty(ref _instrumentID, value); }public string InstrumentName { get _instrumentName; set SetProperty(ref _instrumentName, value); } } /// summary /// Interaction logic for MainWindow.xaml /// /summary public partial class MainWindow : Window {public MainWindow(){InitializeComponent();parentContainer.DataContext this;Exchanges new();ExchangeViewModel exchange1 new ExchangeViewModel();exchange1.ExchangeID SHSE;exchange1.Instruments.Add(new InstrumentViewModel(SHSE, 601155, 新城控股));exchange1.Instruments.Add(new InstrumentViewModel(SHSE, 600036, 招商银行));exchange1.Instruments.Add(new InstrumentViewModel(SHSE, 600266, 城建发展));exchange1.Instruments.Add(new InstrumentViewModel(SHSE, 600837, 海通证券));exchange1.Instruments.Add(new InstrumentViewModel(SHSE, 601668, 中国建筑));ExchangeViewModel exchange2 new ExchangeViewModel();exchange2.ExchangeID SZSE;exchange2.Instruments.Add(new InstrumentViewModel(SZSE, 000002, 万科A));exchange2.Instruments.Add(new InstrumentViewModel(SZSE, 000001, 平安银行));exchange2.Instruments.Add(new InstrumentViewModel(SZSE, 000623, 吉林敖东));exchange2.Instruments.Add(new InstrumentViewModel(SZSE, 002739, 万达电影));exchange2.Instruments.Add(new InstrumentViewModel(SZSE, 300642, 透景生命));Exchanges.Add(exchange1);Exchanges.Add(exchange2);}public string BindData { get; set; } BindData;public ObservableCollectionExchangeViewModel Exchanges { get; set; } }
http://www.hkea.cn/news/14370070/

相关文章:

  • 网站关键词百度自然排名优化如何做医疗网站的专题页
  • 做黄金的经常看什么网站制作网页时用的最多的是
  • 做设计找素材的+网站有哪些自己买域名建设网站
  • 站长数据如东建设局网站
  • 厦门邮件网站百度收录不了网站
  • 个人免费自助建站网站门户网站seo前期
  • 吉林市做网站的公司上海国际人才网
  • 景县网址建站做网站上的图片如何设定分辨率
  • 怎么做网站在线玩游戏学平面设计的网站
  • 花瓣官网设计网站怎么学好网站开发
  • 做销售记住这十句口诀黑帽seo什么意思
  • 餐饮网站建设怎样wordpress传媒传媒企业模板
  • 大型网站建设的价格小说网站排名前十
  • 汕头网站建设推广wordpress获取tag地址
  • 桂林网站制作报价万户网络的网站安全吗
  • 云建站自动建站系统源码天津建设集团网站
  • 做网站都需要做什么萨wordpress
  • 凡科网站可以做自适应的吗wordpress 页面名称
  • 怎么做粉丝福利购网站昆明排名优化
  • 北京做网站建设公司dz转wordpress
  • 一个虚拟空间可以放几个网站石家庄关键词排名工具
  • 视频剪辑自学网站模板下载免费网站
  • 网站建设费属于文化事业建设费网站建设需要哪些的ps
  • 东莞设计网宁波seo行业公司推荐
  • ipv6网站制作太原哪家网站建设公司好
  • 网站设计制作多少钱江苏赛华建设监理有限公司网站
  • 注册建公司网站网站设计与制作软件
  • 网站建设中字样图片南宁设计网站
  • 哪些是网站建设sem竞价是什么意思
  • 万网怎么创建网站简历模板免费下载word格式