pMixins
pMixins copied to clipboard
Create INotifyPropertyChanged tests / documentation
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;}
}
}