CommunityToolkit / Maui

The .NET MAUI Community Toolkit is a community-created library that contains .NET MAUI Extensions, Advanced UI/UX Controls, and Behaviors to help make your life as a .NET MAUI developer easier

Home Page:https://learn.microsoft.com/dotnet/communitytoolkit/maui

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Cannot capture image with CameraView using just MVVM

jfversluis opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

Current Behavior

As outlined in our docs we can use the CaptureImageCommand to capture an image while using the MVVM pattern in our .NET MAUI app.

However, to access the actual media that was captured we need to subscribe to the MediaCaptured event. And by having to use an event suddenly I am breaking the MVVM pattern.

Expected Behavior

We need to have a way of also capturing the media in an MVVM fashion to not force people into bad patterns.

Steps To Reproduce

N/A

Link to public reproduction project repository

https://github.com/CommunityToolkit/Maui

Environment

- .NET MAUI CommunityToolkit Camera: 1.0.2
- OS: N/A
- .NET MAUI: 8.0.61

Anything else?

Additionally I think we may want to consider giving the CaptureImageCommand a default value for the CancellationToken or have an override without it. This makes consuming in XAML a bit harder.