Hi All,
I recently had a problem where a default view constructor was not found in my iOS deployed app (on the device). This was due to the linker settings and the static analyzer not picking up the references I was using.
I register the types of the view and model classes, and then construct them using a method like this:
public static Page GetPageForViewModel(BaseViewModel viewModel)
{
var viewType = Registered[viewModel.GetType()];
var instance = (BaseView)Activator.CreateInstance(viewType);
instance.BindingContext = viewModel;
return instance;
}
How do I avoid my types being marked as not used?
Thanks.