Domanda

I have a ProjectModel and a ProjectViewModel class; my Model handles direct manipulation of a project, while the view model is providing the "view friendly" properties and commands

However, in my ViewModel I'm exposing the read-only project contract for view binding

private ProjectModel Model { get; set; } 

public IProject Project
{
    get
    {
        return Model.Project;
    }
}

So here, the property Model doesn't change, but the property Model.Project will change, and so Model will raise its PropertyChanged event when it does

Now, I know Fody-PropertyChanged has the ability to detect if a property is dependent on another property (in the same class) and raise the change event if the other changes.

I was wondering whether it is possible for Fody-PropertyChanged to raise PropertyChanged("Project") when the Model object raises its changed notifier.

I could do it manually, of course; but I'd prefer to stick with Fody. Is this a bad idea? Alternatively, is this a bad MVVM practice to begin with?

È stato utile?

Soluzione

No Fody-PropertyChanged does not currently support detecting wrapped properties in the way you describe.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top