Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Modal Popup does not show camera

AndrewPriceAndrewPrice USMember
edited July 2016 in Xamarin.Forms

I have the following code in a xamarin forms project

   `public StackLayout AddImageControl()
       StackLayout layout = new StackLayout();

        layout.BindingContext = new PictureViewModel(DependencyService.Get<ICameraProvider>());
        Button btnTakePicture = new Button()
            Text = "Take a Picture",
            Command = (layout.BindingContext as PictureViewModel).TakePicture

        Button btnSelectPicture = new Button()
            Text = "SelectPicture",
            Command = ((PictureViewModel)layout.BindingContext).SelectPicture

        Image img = new Image()
            HeightRequest = 200,
            WidthRequest = 200

        Binding selectPictureBinding = new Binding();

        selectPictureBinding.Path = "Picture";
        selectPictureBinding.Mode = BindingMode.TwoWay;

        img.SetBinding(Image.SourceProperty, selectPictureBinding);


        return layout;


Then in the parent class I have

StackLayout FormOptions = new StackLayout(); FormOptions.Children.Add(FormQuestionControl.AddImageControl());
If I add this to a page it works, but if I add it to Modal Popup it doesnt. im using an iPhone. Anyone know why this would be the case ?



Sign In or Register to comment.