pMixins icon indicating copy to clipboard operation
pMixins copied to clipboard

Create INotifyPropertyChanged tests / documentation

Open ppittle opened this issue 10 years ago • 0 comments

Note: This will need to wait for the IMixinDependency to be implemented in the main code base. Note: This may also require events to be mixed in.

public class NotifyPropertyChangedMixin : INotifyPropertyChanged
{
     public event PropertyChangedEventHandler PropertyChanged;
}

public class NotifyPropertyChangedAspect : MixinInterceptorBase, IMixinDependency<INotifyPropertyChanged>
{
    public INotifyPropertyChanged Target {get;set;}

    public override void OnAfterPropertyInvocation(object sender, PropertyEventArgs eventArgs)
    {
            Target.PropertyChanged(Target, new PRopertyChangedEventArgs(eventArgs.MemberName);
     }
}

[pMixins(Mixin = typeof(NotifyPropertyChangedMixin )]
[pMixins(Mixin = typeof(Target.TargetImpl), Interceptors = new []{typeof(NotifyPropertyChangedAspect )]
public partial class Target
{
    private class TargetImpl
    {
          public string SomeProperty {get;set;}
    }
}

ppittle avatar Jul 09 '14 18:07 ppittle