Search code examples
postsharp

PostSharp NotifyPropertyChanged manual raised event


I have simple situation here. But NotifyPropertyChanged event is not raised even when I use viewmodel.Test = true. Is there some solution how to do that? Can I use some method to raise event manually? Somethin like OnPropertyChange(nameof(Test))? And is there some way how to track change in config too?

//From viewmodel with aspect NotifyPropertyChanged
private readonly IConfig config;
public bool Test
{
    get { return config.Test; }
    internal set
    {
        config.Test = value;
    } 
}



public class Config : IConfig
{
    public bool Test { get; set; }
}

Solution

  • The Config class must have NotifyPropertyChanged aspect too.

    http://support.sharpcrafters.com/discussions/problems/1862-notifypropertychanged-aspect-does-not-raise-events-for-proxied-objects-that-do-not-implement-inpc