Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7921347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T16:33:01+00:00 2026-06-03T16:33:01+00:00

I have looked through all the answers provided on this website for an answer

  • 0

I have looked through all the answers provided on this website for an answer to my problem and I couldn’t find a working solution.

I have a combobox that is bound to a Class using the ItemsSource Property.

The Class Definition is as follows:

public class DataSource
{
    public string DisplayField { get; set; }
    public string ValueField { get; set; }
}

The ComboBox is bound to display the data using the DisplayMemberPath = “DisplayField” and the SelectedValuePath = “ValueField”… This is done in the code behind and loaded when the Window Loads.

The ComboBox is defined as follows:

<ComboBox Grid.Row="0" Grid.Column="1" Margin="5 5 5 0" Name="releaseHoldDropDown" Width="100"/>  

I need a way to change the background to Green and the Foreground to White if the value of the drop down changes to “Release”.

I also need to change the background to Red and the Foreground to White if the value of the drop down changes to “Hold”.

FYI: I am using the ExpressionLight.xaml theme to style the application as a whole.

As a side note I also want a way to change the background on ALL my Comboboxes from the Grey to White to make them more readable. So I need to modify the ExpressionLight.xaml but I have no idea which part to edit to make those changes.

Any Help Will be Appreciated.

thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T16:33:03+00:00Added an answer on June 3, 2026 at 4:33 pm

    why not use a style.trigger?

            <ComboBox.Style>
                <Style TargetType="ComboBox">
                    <Setter Property="Background" Value="Transparent"/>
                    <Setter Property="Foreground" Value="Black"/>
                    <Style.Triggers>
                        <Trigger Property="SelectedValue" Value="Release">
                            <Setter Property="Background" Value="Green"/>
                            <Setter Property="Foreground" Value="White"/>
                        </Trigger>
                        <Trigger Property="SelectedValue" Value="Hold">
                            <Setter Property="Background" Value="Red"/>
                            <Setter Property="Foreground" Value="White"/>
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </ComboBox.Style>
    

    this could be a start for you

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok.. I have looked through this site and just can't seem to find the
Have looked quite hard for this answer but having no luck. I have 3
Disclaimer: I've looked through all the questions I can find and none of them
I have looked all of the place for this and I can't seem to
I have looked and looked and tried to find an answer for what I've
I have read through all the threads out there that looked as if they
I have looked around on the Internet trying to answer this question. It seems
I've looked all over for any answer on this and haven't been able to
I've looked through several posts but I haven't quite found any answers that have
I have looked through several sites for any useful documentation and have come up

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.