Q:

RaisePropertyChanged of the whole object if inner property changed

i am looking for a solution to fire PropertyChanged of the whole property, if one of the inner properties changes. so here is the model:
public class MainStatus : ObservableObject
{
    private bool _safety;
    public bool Safety
    {
        get { return _safety; }
        set
        {
            if (_safety == value)
                return;
            _safety = value;
            RaisePropertyChanged("Safety");
        }
    }
    private bool _setupMode
    public bool SetupMode
    {
        get { return _setupMode; }
        set
        {
            if (_setupMode == value)
                return;
            _setupMode = value;
            RaisePropertyChanged("SetupMode");
        }
    }
}

it has some more properties (bool, int and string).
in the vm it is used like this:
private MainStatus _mainStatus;
public MainStatus MainStatus
{
    get { return _mainStatus; }
    set
    {
        if (_mainStatus == value)
            return;
        _mainStatus = value;
        RaisePropertyChanged("MainStatus");
    }
}

i can bind to the inner properties like this:
<DataTrigger Binding="{Binding MainStatus.Safety}" Value="true">

this all works fine. but i need to send the whole MainStatus to other VMs, if one of the inner property changes. so i changed the property like the this:
public MainStatus MainStatus
{
    get { return _mainStatus; }
    set
    {
        if (_mainStatus == value)
            return;
        _mainStatus = value;
        RaisePropertyChanged("MainStatus");
        Messenger.Default.Send<MainStatusMessage>(new MainStatusMessage() { MainStatus = _mainStatus });
    }
}

but this does not work. it seems like the PropertyChanged for the MainStatus is never fired if one of the inner properties changes. how can i fix that?

A:

In your VM, you could subscribe to Mainstatus.PropertyChanged event something like:
 this.MainStatus.PropertyChanged += new PropertyChangedEventHandler(MainStatus_PropertyChanged);

 //..........
 void MainStatus_PropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     RaisePropertyChanged("MainStatus");
 }

