Skip to content
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

Merged
merged 14 commits into from
Oct 31, 2023

Conversation

VladislavAntonyuk
Copy link
Collaborator

@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
@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
@brminnick brminnick 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
brminnick

This comment was marked as duplicate.

Copy link
Collaborator

@brminnick brminnick 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
Collaborator Author

@brminnick documentation PR is ready

@brminnick brminnick removed the pending documentation This feature requires documentation label Oct 31, 2023
@brminnick brminnick merged commit 9043e35 into main Oct 31, 2023
8 checks passed
@brminnick brminnick deleted the 1419-drawing-events branch October 31, 2023 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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