Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update Switch, ImageButton Visual State Example #2765

Merged
merged 3 commits into from
Feb 11, 2025

Conversation

bhavanesh2001
Copy link
Contributor

The current example of Visual states doesn't work. Wrapping the VisualStateGroup with a VisualStateGroupList to make the example work.

@davidbritch
Copy link
Contributor

@bhavanesh2001 I'm not convinced that this is required. IIRC, VisualStateGroupList is optional and always has been. There used to be a bug in MAUI that made it required, but AFAIK that's been fixed (last time I checked).

@bhavanesh2001
Copy link
Contributor Author

@davidbritch Check this comment by @StephaneDelcroix

The default Maui template contains a style defined for control (Switch) with visual states defined.

While defining our own VisualStateGroup, we need to define VisualStateGroupList explicitly.

@bhavanesh2001
Copy link
Contributor Author

@davidbritch should I close this?

@davidbritch
Copy link
Contributor

@davidbritch should I close this?

Not at all! I've just got a few things to check out before dealing with this.

@bhavanesh2001
Copy link
Contributor Author

@davidbritch Ok. I encountered a similar issue with ImageButton. I'm including a commit for that as well.

@bhavanesh2001 bhavanesh2001 changed the title Update Switch Visual State Example Update Switch, ImageButton Visual State Example Feb 7, 2025
@davidbritch
Copy link
Contributor

Hi @bhavanesh2001

Are you able to also update the sample?

@bhavanesh2001
Copy link
Contributor Author

@davidbritch Here's the PR. Also note that since in the Switch demo's the Styles.xaml was never used . The current example works as it is for now.

Copy link
Contributor

@davidbritch davidbritch left a comment

Choose a reason for hiding this comment

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

Thanks for this @bhavanesh2001 - it's much appreciated!

@davidbritch davidbritch merged commit d38c277 into dotnet:main Feb 11, 2025
4 checks passed
@bhavanesh2001 bhavanesh2001 deleted the patch-1 branch February 11, 2025 12:30
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants