Skip to content
This repository has been archived by the owner on Apr 13, 2020. It is now read-only.

Create INotifyPropertyChanged tests / documentation #18

Open
ppittle opened this issue Jul 9, 2014 · 0 comments
Open

Create INotifyPropertyChanged tests / documentation #18

ppittle opened this issue Jul 9, 2014 · 0 comments

Comments

@ppittle
Copy link
Owner

ppittle commented Jul 9, 2014

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;}
    }
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant