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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:08:45+00:00 2026-05-13T19:08:45+00:00

Been googling this problem for hours, and cannot see where I am going wrong.

  • 0

Been googling this problem for hours, and cannot see where I am going wrong.

I have the following converter which just returns Brushes.Red(have tried Colors.Red) as well but still no luck.

public class ColorConverter : IValueConverter
{
    private static ColorConverter instance = new ColorConverter();
    public static ColorConverter Instance
    {
        get
        {
            return instance;
        }
    }

    public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
        return Brushes.Red;
    }
    public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
        throw new Exception("The method or operation is not implemented.");
    }
}

Now in my xaml I have the following code:

<StackPanel Orientation="Vertical">
    <TextBlock Text="{Binding Value}" TextAlignment="Center" Foreground="{Binding Path=color, Converter={x:Static local:ColorConverter.Instance}}" Margin="2"/>
</StackPanel>

I have set teh following namespace at the top:

xmlns:local="clr-namespace:Dashboard"

Now I have the following class that is binded to the stack panel:

public class MyClass : INotifyPropertyChanged
{
    public String Value;
    public Color color;

    // Declare the PropertyChanged event
    public event PropertyChangedEventHandler PropertyChanged;
    public void NotifyPropertyChanged(String info)
    {
        if (PropertyChanged != null)
        {
            PropertyChanged(this, new PropertyChangedEventArgs(info));
        }
    }
}

The data binding (Value) works perfectly fine, but the converter does not want to kick in, I tried to set a breakpoint in the Convert method of the covnerter, but that does not get triggered when debugging, it just seems as if my debugger isn’t being called.

Can anyone shed some light on this?

  • 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-05-13T19:08:45+00:00Added an answer on May 13, 2026 at 7:08 pm

    I’m surprised that you say that the binding itself works because “Value” and “color” are fields and binding to fields is not supposed to work.

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

Sidebar

Ask A Question

Stats

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

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

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Have you tried Gmail contextual gadget? I haven't tried it… May 15, 2026 at 6:32 pm
  • Editorial Team
    Editorial Team added an answer The return of void was done by changeset: e53252d97e670a38b1d2e9723b48077bba11ddda commit… May 15, 2026 at 6:32 pm
  • Editorial Team
    Editorial Team added an answer Use splice() : splice @$a, 1, 1; May 15, 2026 at 6:32 pm

Trending Tags

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

Top Members

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.