I've just added ReactiveUI to an existing code base. Of course, for the first control I tried it with I hit a snag. I'm using it with a UserControl embedded in a 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 I run the app, I get the following error message:
Don't know how to detect when TabPageControl is activated/deactivated, you may need to implement IActivationForViewFetcher
So, how do I implement IActivationForViewFetcher? I'm not sure what I'm supposed to do with GetAffinityForView
. I'm assuming in GetActivationForView
I need to check to see if the UserControl is the currently visible inside the TabControl?
this.WhenActivated
I get the same error message that you described above. However, in my Xamarin iOS project everything is working fine. Can you explain a little bit more detailed how you have solved the problem? – Tutt