CommunityToolkit icon indicating copy to clipboard operation
CommunityToolkit copied to clipboard

Documentation is insufficient to describe how to use the CameraView control

Open hunsra opened this issue 11 months ago • 3 comments

Type of issue

Other (describe below)

Description

This is a frustrating set of documentation. There is missing information, and there are typos/bugs in the code.

In general, there is just too little information to help a developer unfamiliar with the control to successfully use it, and the referred sample project is very large and complex, and contains so many other working and non-working features, that it's daunting to try to understand how this control is supposed to work.

This includes, but is not limited to, the control's CaptureImageCommand, StartCameraPreviewCommand, and StopCameraPreviewCommand commands are not documented anywhere. The sample XAML that defines buttons for these three commands all have the same text, so when you build and run the example, the buttons all appear to be the same, but they are not.

Can a normal set of documentation be created that fully describes each field, property, command and event the control offers?

Page URL

https://learn.microsoft.com/en-us/dotnet/communitytoolkit/maui/views/camera-view?tabs=ios

Content source URL

https://github.com/MicrosoftDocs/CommunityToolkit/blob/main/docs/maui/views/camera-view.md

Document Version Independent Id

ddd38b0d-10d0-a000-b6aa-2769c945c4fd

Article author

@bijington

Metadata

  • ID: ddd38b0d-10d0-a000-b6aa-2769c945c4fd
  • PlatformId: f3bd0511-be26-1559-9a30-ad0262677c32
  • Service: dotnet-communitytoolkit
  • Sub-service: dotnet-maui-community-toolkit

hunsra avatar Feb 24 '25 00:02 hunsra

@hunsra the aim of this page was to provide a working sample that builds the further you read down the page. With the API documentation we wanted try and rely on XML documentation. If this is not sufficient I could add a set of tables at the end to explain each event, property and method.

bijington avatar Feb 24 '25 06:02 bijington

@bijington thanks for the response. Yes, it was clear from the documentation that a working sample was the goal, however it didn't give enough information to understand how to use the control in a situation outside the sample, nor was the page's sample usable on its own without the lager sample on GitHub and without modifications to be compatible with the larger sample.

The XML documentation from sourcelink for the commands are essentially just a repeat of the command name:

  • "Gets the Command that triggers an image capture."
  • "Gets the Command that starts the camera preview."
  • "Gets the Command that stops the camera preview."

These don't explain how to use these and what events they trigger when the operate. Relying the XML documentation for the control is also problematic since it doesn't appear when creating/editing the control via XAML (e.g., no Intellisence). It has to be navigated to via "Go To Definition". Not a good experience.

Also, it's not clear from the documentation that dependency injection is used by the control to inject the ICameraProver object into the hosting ContentPage. It would be helpful to know that up front instead of stumbling though a debugger session or fully understanding the larger GitHub sample to find out that it is needed.

So, I think it would be helpful to have the control's members fully documented, as well as a sample that stand alone, instead of relying on the larger sample on GitHub. It would be sufficient to have the documentation be implemented via XML documentation, but only if the XAML editor supported this via Intellisence or something more robust.

hunsra avatar Feb 24 '25 14:02 hunsra

I concur with the OP. For example, there was a Flag that changed tense from -ing to-ed but there was not a list of valid Flag options. I had to recreate that control in c# just so I could see the list of flag options.

VR-Architect avatar Apr 28 '25 14:04 VR-Architect