-
Notifications
You must be signed in to change notification settings - Fork 401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add drawing started, cancelled, and on-drawing commands #1440
Conversation
This commit adds the following changes: - Added `DrawingStartedCommand` to handle the event when drawing starts. - Added `DrawingCancelledCommand` to handle the event when drawing is cancelled. - Added `OnDrawingCommand` to handle the event while drawing. These changes allow for better control and handling of the drawing events in the `DrawingViewPage.xaml` and `DrawingViewViewModel.cs`.
src/CommunityToolkit.Maui.Core/Interfaces/IDrawingView.shared.cs
Outdated
Show resolved
Hide resolved
src/CommunityToolkit.Maui.Core/Views/DrawingView/PlatformView/MauiDrawingView.shared.cs
Show resolved
Hide resolved
- Renamed `DrawingStarted` to `OnDrawingStarted` - Renamed `DrawingCancelled` to `OnDrawingCancelled` These changes were made to improve consistency and clarity in the code.
src/CommunityToolkit.Maui.Core/Interfaces/IDrawingView.shared.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Vlad!!
Could you add the docs for the new APIs? I went ahead and added the
approved
I'd love for us to publish v6.1.0 this week before our standup! So if you're able to submit a Docs PR either tomorrow or Wednesday, we can merge this in for v6.1.0 which'll be our final release before .NET 8!!
I went ahead and implemented the new IDrawingView.OnDrawingLineCompleted(IDrawingLine)
API implementing it as a Default Interface Implementation. This avoids breaking changes to our users while still allowing us to implement the new API under the hood. This'll make our lives easier when we remove the Obsolete API in a future PR.
/// <summary>
/// Event occurred when drawing line completed
/// </summary>
/// <param name="lastDrawingLine">Last drawing line</param>
void OnDrawingLineCompleted(IDrawingLine lastDrawingLine) => OnDrawingLineCompleted(lastDrawingLine);
/// <summary>
/// Event occurred when drawing line completed
/// </summary>
/// <param name="lastDrawingLine">Last drawing line</param>
[Obsolete($"Use {nameof(OnDrawingLineCompleted)} instead.")]
void DrawingLineCompleted(IDrawingLine lastDrawingLine);
@brminnick documentation PR is ready |
This commit adds the following changes:
DrawingStartedCommand
to handle the event when drawing starts.DrawingCancelledCommand
to handle the event when drawing is cancelled.OnDrawingCommand
to handle the event while drawing.These changes allow for better control and handling of the drawing events in the
DrawingViewPage.xaml
andDrawingViewViewModel.cs
.Description of Change
Linked Issues
PR Checklist
approved
(bug) orChampioned
(feature/proposal)main
at time of PRAdditional information