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

  • Home
  • SEARCH
  • 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 145511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:26:12+00:00 2026-05-11T08:26:12+00:00

I have a simple .Net enum. I also have a view model object which

  • 0

I have a simple .Net enum. I also have a view model object which has a ‘CurrentValue’ property of the type of my enum. This property can be data-bound (the object implements INotifyPropertyChanged). Now I’d like to show one UI element for each value of the enum, in a specific order, and have the ‘CurrentValue’ highlighted (bold). I would like the declaration to be something like:

<StackPanel Orientation='Vertical'>                    <ContentControl Content='{x:Static MyEnum.Value1}' />     <ContentControl Content='{x:Static MyEnum.Value2}' Margin='10' />     <ContentControl Content='{x:Static MyEnum.Value3}' /> </StackPanel> 

I’d like to declare each value individually, to specify the order, but also because I want some of the elements to have specific margin values. Also, I will want to display specific icons for each value later on.

Now I’m lost as to how I can declare that I want the control associated with the CurrentValue to be bold. I tried using a generic DataTrigger inside a template to check the content against the CurrentValue, but it seems the Value of a trigger cannot be a binding.

I also considered going for a disabled ListBox, but then I can’t have specific margins for specific items. Or can I?

  • 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-11T08:26:13+00:00Added an answer on May 11, 2026 at 8:26 am

    Try this on for size…

    <ListBox>   <ListBoxItem><local:MyEnum>Value1</local:MyEnum></ListBoxItem>   <ListBoxItem Margin='10'><local:MyEnum>Value2</local:MyEnum></ListBoxItem>   <ListBoxItem><local:MyEnum>Value3</local:MyEnum></ListBoxItem> </ListBox> 

    You’ll need to map the local xmlns to your CLR namespace.

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

Sidebar

Ask A Question

Stats

  • Questions 205k
  • Answers 205k
  • 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 There is an actual hotkey API, which still exists in… May 12, 2026 at 8:52 pm
  • Editorial Team
    Editorial Team added an answer What about Prince? It can handle XHTML and CSS just… May 12, 2026 at 8:52 pm
  • Editorial Team
    Editorial Team added an answer You probably could have them in a static class, with… May 12, 2026 at 8:52 pm

Related Questions

I'm building an ASP.NET 3.5 application and would like to expose an enum I
i wish to create a reusable ASP.NET MVC ViewUserControl which is strongly typed to
I currently have a class and I'm trying to create an easy GUI to
I am using ASP.Net Ajax's Page Methods and I have an issue that an

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.