I just added ReactiveUI to the existing code base. Of course, for the first control I tried this, I hit. I use it with a UserControl built into TabControl. The code looks something like this:
public partial class TabPageControl : UserControl, IViewFor<TestViewModel>
{
public TabPageControl()
{
InitializeComponent();
ViewModel = new TestViewModel();
this.WhenActivated(dispose =>
{
dispose(this.Bind( ... ));
dispose(this.BindCommand( ... ));
});
}
}
When the application starts, the following error message appears:
Don't know how to determine when TabPageControl is activated / deactivated, you may need to implement IActivationForViewFetcher
So how can I implement IActivationForViewFetcher? I'm not sure what I should do with GetAffinityForView. I assume in GetActivationForViewI need to check if UserControl is currently visible inside TabControl?
source
share