Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PropertyGrid绑定的对象与Prism提供的基类不兼容 #486

Closed
tzm1119 opened this issue Sep 28, 2020 · 2 comments
Closed

PropertyGrid绑定的对象与Prism提供的基类不兼容 #486

tzm1119 opened this issue Sep 28, 2020 · 2 comments

Comments

@tzm1119
Copy link

tzm1119 commented Sep 28, 2020

BindableBase是Prism框架提供的实现INotifyPropertyChanged接口的基类,我把下面的类绑定到PropertyGrid上时,直接报错了

public class PropertyGridDemoModel:BindableBase
{
private string bValue="66";
public string BValue
{
get { return bValue; }
set { SetProperty(ref bValue, value); }
}
}
这个异常还没法看详细信息
image

@tzm1119
Copy link
Author

tzm1119 commented Sep 29, 2020

BindableBase是Prism框架提供的实现INotifyPropertyChanged接口的基类,我把下面的类绑定到PropertyGrid上时,直接报错了

public class PropertyGridDemoModel:BindableBase
{
private string bValue="66";
public string BValue
{
get { return bValue; }
set { SetProperty(ref bValue, value); }
}
}
这个异常还没法看详细信息
image

我已经找到问题了,是因为下面的小括号造成的,只要对象实现了INotifyPropertyChanged,如果添加小括号,就会报错
image

@NaBian NaBian closed this as completed in 940117a Oct 11, 2020
@AlexVinci
Copy link

ImagePropertyEditor中override了CreateBinding方法,小括号未删除,所以实现了INotifyPropertyChanged的类,并包含ImageSource属性的话,仍有这个问题。
ImagesourceEditor
BaseEditor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants