Skip to content

Add drawing started, cancelled, and on-drawing commands#1440

Merged
TheCodeTraveler merged 14 commits intomainfrom
1419-drawing-events
Oct 31, 2023
Merged

Add drawing started, cancelled, and on-drawing commands#1440
TheCodeTraveler merged 14 commits intomainfrom
1419-drawing-events

Conversation

@VladislavAntonyuk
Copy link
Copy Markdown
Contributor

@VladislavAntonyuk VladislavAntonyuk commented Oct 3, 2023

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.

Description of Change

Linked Issues

PR Checklist

Additional information

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`.
@VladislavAntonyuk VladislavAntonyuk requested a review from a team October 3, 2023 18:03
Comment thread src/CommunityToolkit.Maui.Core/Interfaces/IDrawingView.shared.cs Outdated
@VladislavAntonyuk VladislavAntonyuk self-assigned this Oct 3, 2023
@VladislavAntonyuk VladislavAntonyuk added the needs discussion Discuss it on the next Monthly standup label Oct 3, 2023
- Renamed `DrawingStarted` to `OnDrawingStarted`
- Renamed `DrawingCancelled` to `OnDrawingCancelled`

These changes were made to improve consistency and clarity in the code.
@VladislavAntonyuk VladislavAntonyuk added hacktoberfest-accepted A PR that has been approved during Hacktoberfest and removed needs discussion Discuss it on the next Monthly standup labels Oct 6, 2023
Comment thread src/CommunityToolkit.Maui.Core/Interfaces/IDrawingView.shared.cs Outdated
@TheCodeTraveler TheCodeTraveler added pending documentation This feature requires documentation do not merge Do not merge this PR approved This Proposal has been approved and is ready to be added to the Toolkit labels Oct 30, 2023
TheCodeTraveler

This comment was marked as duplicate.

Copy link
Copy Markdown
Collaborator

@TheCodeTraveler TheCodeTraveler left a 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 This Proposal has been approved and is ready to be added to the Toolkit , do not merge Do not merge this PR , and pending documentation This feature requires documentation labels here so that we don't forget.

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);

@VladislavAntonyuk VladislavAntonyuk removed the do not merge Do not merge this PR label Oct 31, 2023
@VladislavAntonyuk
Copy link
Copy Markdown
Contributor Author

@brminnick documentation PR is ready

@TheCodeTraveler TheCodeTraveler removed the pending documentation This feature requires documentation label Oct 31, 2023
@TheCodeTraveler TheCodeTraveler merged commit 9043e35 into main Oct 31, 2023
@TheCodeTraveler TheCodeTraveler deleted the 1419-drawing-events branch October 31, 2023 21:16
@github-actions github-actions bot locked and limited conversation to collaborators Nov 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

approved This Proposal has been approved and is ready to be added to the Toolkit hacktoberfest-accepted A PR that has been approved during Hacktoberfest

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants