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

IsInRangeConverter #582

Merged
merged 36 commits into from
Dec 1, 2022
Merged

IsInRangeConverter #582

merged 36 commits into from
Dec 1, 2022

Conversation

GeorgeLeithead
Copy link
Contributor

@GeorgeLeithead GeorgeLeithead commented Sep 2, 2022

Description of Change

Implement the proposed IsInRangeConverter.

Linked Issues

#65

PR Checklist

Additional information

Tested on:

  • Android
  • Windows
  • iOS
  • MacCatalyst

@GeorgeLeithead GeorgeLeithead changed the title IsInrangeConverter IsInRangeConverter Sep 2, 2022
@VladislavAntonyuk
Copy link
Collaborator

The issue is not championed

@GeorgeLeithead
Copy link
Contributor Author

The issue is not championed

My appologies, I jumped the gun. Was ensuring that before my time becomes more restricted starting next week, any work I have done was made available.
Thankfully the other 5 items I haven't created a PR yet, as they too have not yet been championed!

Have been discussing and sharing this with @bijington and didn't check to see if the championed status had been updated.

@brminnick brminnick added do not merge Do not merge this PR needs discussion Discuss it on the next Monthly standup labels Sep 2, 2022
@brminnick
Copy link
Collaborator

Closing PR until Proposal has been Approved

@brminnick brminnick closed this Sep 5, 2022
@brminnick
Copy link
Collaborator

Reopening after Proposal Approval

@brminnick brminnick reopened this Nov 3, 2022
@brminnick brminnick removed do not merge Do not merge this PR needs discussion Discuss it on the next Monthly standup labels Nov 3, 2022
@GeorgeLeithead GeorgeLeithead marked this pull request as ready for review November 3, 2022 19:57
@GeorgeLeithead GeorgeLeithead marked this pull request as draft November 3, 2022 19:59
@GeorgeLeithead
Copy link
Contributor Author

@JoonghyunCho @bijington This is ready for review. Any suggestions, improvements, additions would be very much appreciated. Documentation is also needed, which I will work on!

@GeorgeLeithead
Copy link
Contributor Author

@JoonghyunCho @bijington This is ready for review. Any suggestions, improvements, additions would be very much appreciated. Documentation is also needed, which I will work on!

Please note that I do not have access to any iOS or Mac Catalyst devices (or Tizen), as such, please make sure that any reviewer who does have access, to please update as appropriate the checkbox indicating that it works on that platform.

@JoonghyunCho
Copy link
Member

I will check if it works ok on iOS and Mac devices later tonight :)

@GeorgeLeithead
Copy link
Contributor Author

Also, please be aware that I also need to create the appropriate test cases.

@GeorgeLeithead GeorgeLeithead requested review from JoonghyunCho and pictos and removed request for pictos and JoonghyunCho November 27, 2022 12:22
@JoonghyunCho JoonghyunCho marked this pull request as ready for review November 28, 2022 05:01
JoonghyunCho
JoonghyunCho previously approved these changes Nov 29, 2022
Copy link
Member

@JoonghyunCho JoonghyunCho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@brminnick brminnick added the approved This Proposal has been approved and is ready to be added to the Toolkit label Nov 30, 2022
brminnick
brminnick previously approved these changes Nov 30, 2022
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 George!

Just FYI - I updated the sample app to use a single Grid for its layout. The initial implementation had Grids nested inside of HorizontalStackLayouts nested inside of VerticalStackLayouts.

don't attempt to reproduce the appearance of a specific layout by using combinations of other layouts, as this results in unnecessary layout calculations being performed. For example, don't attempt to reproduce a Grid layout by using a combination of StackLayout instances.

https://learn.microsoft.com/xamarin/xamarin-forms/deploy-test/performance#choose-the-correct-layout

Because of the large number of Rows in the Grid, I ported the IsInRangeConverterPage to C# Markup which allows the naming of rows + columns. This makes it easier to assign UI controls to their respective column + row and helps avoid confusion amongst which row is which in the Grid.

@brminnick brminnick linked an issue Nov 30, 2022 that may be closed by this pull request
10 tasks
@brminnick brminnick disabled auto-merge November 30, 2022 23:37
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.

Approving again after adding the Bindable Properties defined in #65

@brminnick brminnick enabled auto-merge (squash) November 30, 2022 23:45
@brminnick brminnick merged commit e7bf019 into CommunityToolkit:main Dec 1, 2022
@GeorgeLeithead
Copy link
Contributor Author

Approving again after adding the Bindable Properties defined in #65

@brminnick I used the existing converters as a guide for implementation, especially CompareConverter.shared.cs as it was close to what IsInRangeConverter was to provide. If I KNEW that Bindabale Properties was required, or given time to implement myself, I would have very VERY much have preferred to do so myself!
However, I do also find it very strange that Bindable Properties have been added to this Converter but not to the other existing converters, if they are now 'required'. Especially for from a consistent end user experience.

@GeorgeLeithead
Copy link
Contributor Author

Approving again after adding the Bindable Properties defined in #65

@brminnick I used the existing converters as a guide for implementation, especially CompareConverter.shared.cs as it was close to what IsInRangeConverter was to provide. If I KNEW that Bindabale Properties was required, or given time to implement myself, I would have very VERY much have preferred to do so myself!
However, I do also find it very strange that Bindable Properties

Thanks George!

Just FYI - I updated the sample app to use a single Grid for its layout. The initial implementation had Grids nested inside of HorizontalStackLayouts nested inside of VerticalStackLayouts.

don't attempt to reproduce the appearance of a specific layout by using combinations of other layouts, as this results in unnecessary layout calculations being performed. For example, don't attempt to reproduce a Grid layout by using a combination of StackLayout instances.

https://learn.microsoft.com/xamarin/xamarin-forms/deploy-test/performance#choose-the-correct-layout

Because of the large number of Rows in the Grid, I ported the IsInRangeConverterPage to C# Markup which allows the naming of rows + columns. This makes it easier to assign UI controls to their respective column + row and helps avoid confusion amongst which row is which in the Grid.

@brminnick Originally it started off as 1 sample that I hoped to make multi-use. However it didn't pan out that way. I should have converted to be a grid, and would have been happy to do the work, if I was given a chance to do so from a review.

@brminnick
Copy link
Collaborator

No worries at all, George! You always do fantastic work and we're honored to have you as a strong contributor ❤️

The BindableProperties were in the API Design for the approved Proposal, and I wanted to ensure we honored that spec. I agree it is a bit inconsistent with other Converters today, but I think it opens up an awesome opportunity to add BindableProperties to existing Converters!

And your sample was great too! Since I know many devs will copy/paste our samples, I just wanted to ensure we start them off on the right path using best practices. You'd be surprised how many times I've been blamed in the past because I wrote some quick + dirty code as an example, only to find another dev copy/pasted it and made it the foundation of their app 😳

@GeorgeLeithead
Copy link
Contributor Author

No worries at all, George! You always do fantastic work and we're honored to have you as a strong contributor ❤️

The BindableProperties were in the API Design for the approved Proposal, and I wanted to ensure we honored that spec. I agree it is a bit inconsistent with other Converters today, but I think it opens up an awesome opportunity to add BindableProperties to existing Converters!

And your sample was great too! Since I know many devs will copy/paste our samples, I just wanted to ensure we start them off on the right path using best practices. You'd be surprised how many times I've been blamed in the past because I wrote some quick + dirty code as an example, only to find another dev copy/pasted it and made it the foundation of their app 😳

@brminnick Have you seen all the Unit Tests I put in? :-D
For the Bindable Properties, could be raised as a PROPOSAL, and be an opportunity to bump up the samples, and an opportunity to update the documentation to provide more extensive doc examples.

@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Proposal] Is In Range Converter
5 participants