How to declare combobox itemTemplate that has Itemsource as Enum Values in WPF?

Posted by Ashish Ashu on Stack Overflow See other posts from Stack Overflow or by Ashish Ashu
Published on 2010-03-28T12:29:17Z Indexed on 2010/03/28 15:43 UTC
Read the original article Hit count: 461

I have a enum let's say

enum MyEnum
{
  FirstImage,
  SecondImage,
  ThirdImage,
  FourthImage
};

I have binded this Enum to my combobox in XAML.

While defining an combobox I have defined an ItemTemplate of combox to take Two UI element:

  1. TextBlock that show the enum value (Description)
  2. Image

I have done this much in XAML.

I am wondering where I can specify the Image corrosponding to each item of Enum value in a combobox? Is that possible through data trigger ?

I really appreciate if anyone have the XAML for this scenario.

Many Thanks in advance

© Stack Overflow or respective owner

Related posts about wpf

Related posts about databinding