0
votes

I have done as the youtube video on PictureChooserTask (https://www.youtube.com/watch?v=Dyy6U67ouQI&list=PLR6WI6W1JdeYSXLbm58jwAKYT7RQR31-W&index=16) shows, and it all compiles, but when i push the "Take picture" button that calls the TakePicture-command the app crash and returns to the home screen.

My commands and methods:

private MvxCommand _takePictureCommand;
public ICommand TakePictureCommand
{
    get
    {
        _takePictureCommand = _takePictureCommand ?? new MvxCommand(DoTakePicture);
        return _takePictureCommand;
    }
}

private void DoTakePicture()
{
    _pictureChooserTask.TakePicture(400, 95, OnPicture, () => { });
}

private void OnPicture(Stream pictureStream)
{
    var memoryStream = new MemoryStream();
    pictureStream.CopyTo(memoryStream);
    Bytes = memoryStream.ToArray();
}  
2
What error / output do you get when the app crashes? Did you try stepping through with a debugger? On which line does it crash?Benjamin Diele
+1 for @Benjamin's question. Plus does WindowsPhone 8.1 mean Silverlight or Jupiter/Xaml?Stuart

2 Answers

0
votes

It means Wpf 8.1 RT, thats the new standard for Windows Phone dev i have learned. I get this message: "This object needs to be initialized before the requested operation can be carried out." When i click the button that is bound up against the TakePicture

0
votes

I believe this was fixed in https://github.com/MvvmCross/MvvmCross/pull/818 - so it should be in the 3.2.2 release of MvvmCross