How do I implement a gallery picker using FormsApplicationDelegate from Xamarin Forms 1.3?

ArneRstArneRst NOMember
edited June 2015 in Xamarin.Forms

I am trying to initialize my app like this link [developer.xamarin.com/guides/cross-platform/xamarin-forms/working-with/app-lifecycle/](Delegate instantiation), but also I'm using a picker gallery like this [developer.xamarin.com/recipes/ios/media/video_and_photos/choose_a_photo_from_the_gallery/](GalleryPicker documentation), but the problem here, is that this example use this: NavigationController.PresentModalViewController(imagePicker, true); , but now I don't have a UIWindow object or a rootViewController like before to show the picker, now I am using LoadApplication(...) function instead of it. So what should be the way I could show my gallery picker to the screen?

Best Answer

  • adamkempadamkemp US mod
    Accepted Answer

    You can use UIApplication.SharedApplication.KeyWindow.RootViewController wherever you previously used the Window.RootViewController property from your application delegate.

Answers

  • adamkempadamkemp USInsider, Developer Group Leader mod
    Accepted Answer

    You can use UIApplication.SharedApplication.KeyWindow.RootViewController wherever you previously used the Window.RootViewController property from your application delegate.

  • ArneRstArneRst NOMember

    Thank you very much :smile: , now it's working with UIApplication.SharedApplication.KeyWindow.RootViewController

Sign In or Register to comment.