我在 Visual Studio 2010 Express 中使用 VB.NET 和 WPF。
目前,我有:
- 一个名为downloadListDG的 DataGrid 。这有一个列,它是一个包含图像的模板。
- 自定义DownloadListItem类的ObservableCollection 。
- 此DownloadListItem有一个公共属性,它是另一个自定义类。
- 这个类有一个私有的 dim 是一个 StateType(一个自定义枚举)和一个公共的只读属性,它根据 StateType 是什么返回一个字符串(如果你好奇的话,实际上是一个图像 URI)。
- DownloadListItem还有一个公共属性,它只返回 StateType(这仅用于绑定目的)
我的问题是,每当 StateType 更改时,DataGrid 中的图像列都不会更改。我一直在尝试使用IPropertyChangedNofity,但没有任何改变,所以要么我使用不正确,要么我需要使用另一种方法。
Implements INotifyPropertyChanged
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
AddHandler ControllerRef.StateChanged, AddressOf StateChangeHandler
Private Sub StateChangeHandler(NewState As State)
MsgBox(NewState)
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs("CurrentState"))
End Sub
提前致谢