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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:09:01+00:00 2026-06-14T13:09:01+00:00

I have following rangeobservablecollection: private readonly RangeObservableCollection<coll> _coll; where coll is bunch of checkboxes

  • 0

I have following rangeobservablecollection:

private readonly RangeObservableCollection<coll> _coll;

where coll is bunch of checkboxes that i am adding to this collection. I want to change the foreground color of the checkbox on particular add like this:

_coll.Add( info );

Is there a way to change the color of this?

XAML code:

<StackPanel Orientation="Horizontal">
                <CheckBox Margin="0,0,3,0" Foreground="{Binding Foreground"}">
                    <CheckBox.IsChecked>
                        <Binding Path="IsSelected"
                                 Mode="TwoWay">
                            <Binding.RelativeSource>
                                <RelativeSource Mode="Parent" />
                            </Binding.RelativeSource>
                        </Binding>
                    </CheckBox.IsChecked>
                </CheckBox>
                <ContentPresenter />
            </StackPanel>
  • 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-14T13:09:03+00:00Added an answer on June 14, 2026 at 1:09 pm

    You can use a template on your ui object that binds the foreground color to a SolidColorBrush property on coll class.

    <ListBox ItemsSource="{Binding items}">
        <ListBox.ItemTemplate>
          <DataTemplate>
            <StackPanel Orientation="Horizontal">
              <CheckBox IsChecked="{Binding IsChecked, Mode=TwoWay}" />
              <TextBlock Foreground="{Binding Foreground}" Content="{Binding Description}" />
            </StackPanel>
          </DataTemplate>
        </ListBox.ItemTemplate>
    </ListBox>
    

    your class definition will look something like this:

    public class coll
    {
        public IsChecked { get; set; }
        public string Description { get; set; }
        public SolidColorBrush Foreground { get; set; }
    }
    

    then you can change the foreground:

    info.Foreground = new SolidColorBrush(Colors.Red);
    _coll.Add( info );
    

    There’s a lot of variations you can use here to achieve the same effect: converters, INPC…

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

Sidebar

Related Questions

I have following Html file with javascript. This gives me error that testCircle is
I have following script that executes all the .reg files in the current directory.
I have following code that creates Linq query. I've never used Linq until today
I have following table it shows like this: ABC A B C 123 Hello
I have following json data which I want to pass it to server using
I have following extension method written: static public IQueryable<OutboundPattern> ByClientID(this IQueryable<OutboundPattern> qry, int clientID)
I have following type of data and I want to produce bar graph. Mark
I have following asp hyperlink: <asp:HyperLink ID=a runat=server Text=return NavigateUrl=https://google.com/></asp:HyperLink > What i want
I have following method that I select all the ids from table and append
I have following 3 images and want to use them to draw a background

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.