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 106131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:32:54+00:00 2026-05-11T01:32:54+00:00

I have a listview that is binded to a ThreadSafeObservableCollection. The background of each

  • 0

I have a listview that is binded to a ThreadSafeObservableCollection. The background of each of these items is set to an enum that is run through a color converter, here’s the code for these 2 settings.

<UserControl.Resources>     <EncoderView:EncoderStatusToColorConverter x:Key='ColorConverter'/>     <Style x:Key='ItemContStyle' TargetType='{x:Type ListViewItem}'>         <Setter Property='Background' Value='{Binding Converter={StaticResource ColorConverter}}' />         <Setter Property='HorizontalContentAlignment' Value='Stretch' />     </Style> </UserControl.Resources> 

what I want to have happen is that the background color of the listviewItem will change from Red – Yellow – Green based on an enum value. Which is updated based on business logic rules. This is currently working, but only for the initial display of the item. When I make a change to the ‘Status’ property of the object that the listItemView is bound to, the background does not update. If I remove the object from the collection, change the status, and then add it to the collection again, the background IS updated.
I’ve tried making the object IPropertyNotify, and throwing the event on the status property changed setter, but that didn’t work.

does anyone know if there is something special I have to do in order to get the background of a listview item to update. I’m also open for other ideas on how to solve this problem, thanks. here’s the XAML for the ListView. EncoderService.Encoders is my ThreadSafeObservableCollection of Encoder objects.

        <ListView  AutomationProperties.AutomationId='FinishScreen'                      ItemsSource='{Binding Path=EncoderService.Encoders}'                     x:Name='DataListView' Grid.RowSpan='1' Grid.Row='1' Margin='5'                    ItemContainerStyle='{StaticResource ItemContStyle}'                    Background='Azure'>         <ListView.View>             <GridView>                 <GridViewColumn Header='MAC'>                     <GridViewColumn.CellTemplate>                         <DataTemplate>                             <ContentControl Content='{Binding Path=MAC}' ToolTip='{Binding Path=MAC}'/>                         </DataTemplate>                     </GridViewColumn.CellTemplate>                 </GridViewColumn>                 <GridViewColumn Header='IDF'>... 
  • 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. 2026-05-11T01:32:55+00:00Added an answer on May 11, 2026 at 1:32 am

    The issue is that the Binding to Background is taking the entire Encoder object, which doesn’t change unless you remove and add it. Even if Encoder implements INotifyPropertyChanged, the Binding is still looking at the whole Encoder object and has no way of knowing which properties of Encoder are relevant to your EncoderStatusToColorConverter, so it won’t update itself.

    The solution in your case is to narrow the scope of the Binding on Background to just the property (or properties) relevant to EncoderStatusToColorConverter. Any properties in the Path of your Binding will be watched for updates. So, for example, if you only need Status:

    <Style x:Key='ItemContStyle' TargetType='{x:Type ListViewItem}'>     <Setter Property='Background' Value='{Binding Path=Status, Converter={StaticResource ColorConverter}}' />     <Setter Property='HorizontalContentAlignment' Value='Stretch' /> </Style> 

    In this case, if you implement INotifyPropertyChanged on Encoder and notify whenever Status changes, the Binding should update for you. This also means you’ll need to update your EncoderStatusToColorConverter so it only takes a Status type.

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

Sidebar

Ask A Question

Stats

  • Questions 58k
  • Answers 58k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer No. Cons. Noise code. More to write. YAGNI. May 11, 2026 at 8:48 am
  • added an answer Running: M-x sql-rename-buffer On a connected *SQL* buffer will rename… May 11, 2026 at 8:48 am
  • added an answer ie net render 0.9, firefox addon... make the page on… May 11, 2026 at 8:48 am

Related Questions

No related questions found

Top Members

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

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.