문제

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?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top