Link to home
Start Free TrialLog in
Avatar of OFGemini
OFGemini

asked on

I Value converter

I need a Ivalue converter to convert enums to names.
example
instead of color = 0   color = Black And White.

using System;

namespace Dokmee_Page_Counter
{
    public enum ColorScheme
    {
        BlackAndWhite = 0,
        Grayscale = 1,
        FullColor = 2,
        ERROR = 3
    }
}

Open in new window

Avatar of Miguel Oz
Miguel Oz
Flag of Australia image

foreach(string s in Enum.GetNames(typeof(ColorScheme )))
            Console.WriteLine(s);
    }

static void Main(string[] args)
{
var cs = ColorScheme.FullColor;
Console.WriteLine(cs.ToString());
}
prints "FullColor"
Avatar of OFGemini
OFGemini

ASKER

good ideas all but I need an IValueConverter in WPF data binding....

ASKER CERTIFIED SOLUTION
Avatar of Miguel Oz
Miguel Oz
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks!