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

Attempting to change the background of the textbox(SearchView) with a theme fails to change the backgor #2

Closed
martincw2 opened this issue Mar 4, 2016 · 3 comments

Comments

@martincw2
Copy link

When applying a theme across my application, the autocomplete fails to have the same background as the textbox. I have included a picture from a copy of your WPF sample application.
image

In the app.xaml I define the DefaultTextBoxStyle and set the background to Tan,
<Application.Resources> <ResourceDictionary> <Style x:Key="DefaultTextBoxStyle" TargetType="{x:Type TextBox}" > <Setter Property="Background" Value="Tan"/> </Style> </ResourceDictionary> </Application.Resources>

This works as seen in the image, but the drop down is still white. In my actual application the issue is more pronounced since the drop down ends up being black with black text.
What am I missing and/or what additional styling do I need to set for this to take effect? I would be ok to force this control to not follow the theme for all the other textboxes as long as it rendered without issue.

@martincw2
Copy link
Author

I found a workaround by overriding the Style on the SearchView object in the XAML.
<search:SearchView > <search:SearchView.Resources> <Style TargetType="ListBox"> <Setter Property="Background" Value="Tan"/> </Style> </search:SearchView.Resources> </search:SearchView>
So this is working for me.

@GeertvanHorrik
Copy link
Member

Great to hear you were able to fix it.

@lock
Copy link

lock bot commented Aug 26, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants