Change Notification in MVVM Hierarchies

前端 未结 5 1273
清酒与你
清酒与你 2021-02-01 07:29

Let\'s say in some abstract ViewModel base-class I have a plain-old property as follows:

public Size Size
{
    get { return _size; }
    set
    {
        _size         


        
5条回答
  •  深忆病人
    2021-02-01 08:00

    maybe because im a VB guy, but in your Rectangle code it looks like you are accessing the private _size declaration instead of the Public Size property which would not fire the OnPropertyChanged event to alert the view.

    Also I may be off base, but shouldnt Rectangle be an actual Object while Size is a property of that object? Maybe that is what you are doing..some C# methodologies are still really foreign to me.

提交回复
热议问题