Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper usage of AutoNotifyPropertyChangedInterceptor #49

Open
sekulicb opened this issue Jul 17, 2019 · 0 comments
Open

Proper usage of AutoNotifyPropertyChangedInterceptor #49

sekulicb opened this issue Jul 17, 2019 · 0 comments

Comments

@sekulicb
Copy link

sekulicb commented Jul 17, 2019

Hi. How do we set up the binding for AutoNotifyPropertyChangedInterceptor in a custom module? What I have tried so far:

public class MyViewModel : IMyViewModel {
virtual properties and methods marked with [NotifyOfChanges] attribute
public void OnPropertyChanged
}

public IMyViewModel : IAutoPropertyChanged {
}

*My custom module

public class MyModule : NinjectModule {

Bind(typeof(AutoNotifyPropertyChangedInterceptor<>)).ToSelf() - not working
Bind(typeof(IAutoNotifyPropertyChangedIntercertor<>).To(typeof(AutoNotifyPropertyChangedInterceptor<>)(); - not working
.
.
ViewModel binding works without problems

also, what is correct intercept binding method on the ViewModel itself?

binding.Intercept().With<AutoNotifyPropertyChangedInterceptor>().InOrder(1);
...some other interceptor in chain

or

binding.Intercept().With<IAutoNotifyPropertyChangedInterceptor>
.InOrder(1);
...some other interceptor in chain

I have tried both approaches (binding to interface and concrete type) but it throws an exception during kernel build. Should I use InterceptAttribute for this interceptor instead of binding in a module ?

Any help would be appreciated. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant