WF 4.0中的数据绑定不起作用

编程入门 行业动态 更新时间:2024-10-27 11:16:13
本文介绍了WF 4.0中的数据绑定不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

你好,

我想在组合框中显示一些数据类型.数据类型包装在以下类中:

i want to display some datatypes in a combobox. the datatypes are wrapped in the following class:

public class TDataTypeBinder: INotifyPropertyChanged { private string name; public string Name { get { return name ; } set { name = value; OnPropertyChanged("Name" ); } } private DataType datatype; public DataType Datatype { get { return datatype; } set { datatype = value; OnPropertyChanged("Datatype" ); } } /// <summary> /// Initializes a new instance of the <see cref="TDataTypeBinder"/> class. /// </summary> /// <param name="valueToSelect"> The value to select.</param> public TDataTypeBinder(string valueToSelect) { Name = valueToSelect; } public event PropertyChangedEventHandler PropertyChanged; private void OnPropertyChanged(string propName) { PropertyChangedEventHandler eh = this .PropertyChanged; if (null != eh) { eh(this , new PropertyChangedEventArgs(propName)); } } }

推荐答案

Visual Studio的输出窗口是否给您任何绑定表达式错误?您绑定到 ModelItem.DataTypesDisplayed ,但是 ModelItem 是从哪里来的呢? 另外,您在专门谈论WPF 4时,就可以正常工作了在3.5版中? Does your output window of Visual Studio gives you any binding expression errors? You bind to ModelItem.DataTypesDisplayed, but where does ModelItem come from?Also, you are talking about WPF 4 specifically, you got this working in 3.5?

更多推荐

WF 4.0中的数据绑定不起作用

本文发布于:2023-11-13 12:21:32,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1584347.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:绑定   不起作用   数据   WF

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!