Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Avoiding overly aggressive linking

$
0
0

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.


Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>