Skip to content

[Windows] SearchBar PlaceholderColor and BackgroundColor not updating at runtime #29962

@Tamilarasan-Paranthaman

Description

Description

When modifying the PlaceholderColor or BackgroundColor properties of a SearchBar at runtime on the Windows platform, the visual changes are not reflected in the UI.

public class MainPage : ContentPage
{
	public MainPage()
	{
		var searchBar = new SearchBar
		{
			Placeholder = "Search here...",
			BackgroundColor = Colors.Black,
			PlaceholderColor = Colors.Yellow,
			HeightRequest = 50,
		};
		var button = new Button
		{
			Text = "Change PlaceHolder and Background Color",
			VerticalOptions = LayoutOptions.Center,
			HorizontalOptions = LayoutOptions.Center,
			AutomationId = "ColorChangeButton"
		};
		button.Clicked += (sender, e) =>
		{
			searchBar.BackgroundColor = Colors.YellowGreen;
			searchBar.PlaceholderColor = Colors.Red;
		};

		Content = new StackLayout
		{
			Children =
			{
				searchBar,
				button
			}
		};
	}
}

Steps to Reproduce

  1. Create a SearchBar in XAML or C#.
  2. In a button click, update the PlaceholderColor or BackgroundColor of the SearchBar.
  3. Observe that no visual change occurs on the Windows platform.

Link to public reproduction project repository

No response

Version with bug

9.0.70 SR7

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-controls-searchbarSearchBar controlpartner/syncfusionIssues / PR's with Syncfusion collaborationplatform/windowss/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions