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

SelectedColor property of SelectableButton in SelectionView is not updating after changing theme #376

Open
MemExplorer opened this issue Oct 27, 2024 · 0 comments
Assignees
Labels
bug Something isn't working target-MAUI
Milestone

Comments

@MemExplorer
Copy link

Describe the bug
First of all, great project and I really appreciate the work put into this project!
As the title says, the SelectorColor of SelectableButton is not updated when I changed my application theme in MAUI, and also when the SelectableButton is under a SelectionView control.

To Reproduce
Steps to reproduce the behavior:

  1. Change the theme
  2. Select any SelectableButton
  3. See that the SelectableButton SelectedColor is the same as the SelectedColor of last theme

Expected behavior
The SelectedColor of SelectableButton should update according to the set theme

Desktop (please complete the following information):

  • Windows 11
  • Chrome

Smartphone (please complete the following information):

  • Device: Pixel 7 Pro
  • OS: Android
  • Stock browser
  • Android 14

Additional context
My temporary workaround for this issue works by looping through all the children of SelectionView and setting the SelectedColor of each SelectableButton to the correct color depending on the theme every time the page is loaded.

My guess is that the problem is around here.
And here is my untested patch for this issue:

public Color Color
{
	get => (Color)GetValue(ColorProperty);
	set
	{
		SetValue(ColorProperty, value);
		OnPropertyChanged();
		foreach (var item in Children)
			if (item is SelectableButton)
				(item as SelectableButton).SelectedColor = value;
	}
}
@enisn enisn added bug Something isn't working target-MAUI labels Nov 5, 2024
@enisn enisn added this to the 4.4 milestone Nov 5, 2024
@enisn enisn self-assigned this Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working target-MAUI
Projects
None yet
Development

No branches or pull requests

2 participants