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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:21:28+00:00 2026-05-22T17:21:28+00:00

I am trying to find a simple example where the enums are shown as

  • 0

I am trying to find a simple example where the enums are shown as is. All examples I have seen tries to add nice looking display strings but I don’t want that complexity.

Basically I have a class that holds all the properties that I bind, by first setting the DataContext to this class, and then specifying the binding like this in the xaml file:

<ComboBox ItemsSource="{Binding Path=EffectStyle}"/>

But this doesn’t show the enum values in the ComboBox as items.

  • 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-22T17:21:29+00:00Added an answer on May 22, 2026 at 5:21 pm

    You can do it from code by placing the following code in Window Loaded event handler, for example:

    yourComboBox.ItemsSource = Enum.GetValues(typeof(EffectStyle)).Cast<EffectStyle>();
    

    If you need to bind it in XAML you need to use ObjectDataProvider to create object available as binding source:

    <Window x:Class="YourNamespace.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:System="clr-namespace:System;assembly=mscorlib"
            xmlns:StyleAlias="clr-namespace:Motion.VideoEffects">
        <Window.Resources>
            <ObjectDataProvider x:Key="dataFromEnum" MethodName="GetValues"
                                ObjectType="{x:Type System:Enum}">
                <ObjectDataProvider.MethodParameters>
                    <x:Type TypeName="StyleAlias:EffectStyle"/>
                </ObjectDataProvider.MethodParameters>
            </ObjectDataProvider>
        </Window.Resources>
        <Grid>
            <ComboBox ItemsSource="{Binding Source={StaticResource dataFromEnum}}"
                      SelectedItem="{Binding Path=CurrentEffectStyle}" />
        </Grid>
    </Window>
    

    Draw attention on the next code:

    xmlns:System="clr-namespace:System;assembly=mscorlib"
    xmlns:StyleAlias="clr-namespace:Motion.VideoEffects"
    

    Guide how to map namespace and assembly you can read on MSDN.

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

Sidebar

Related Questions

I've been searching all over trying to find simple code to add multiple markers
I have been looking around for hours trying to find a clear simple solution
I have googled about trying to find a simple example of Haskell being used
Trying to find some simple SQL Server PIVOT examples. Most of the examples that
I'm trying to make a simple php script to find all src attributes from
As a simple example I'm trying to get all the dom objects that contain
I'm trying to find a simple example to detect certain key events on the
I'm looking for a simple example on how to use SlickGrid when trying to
I am trying to find a simple example of displaying data from an SQLite
I'm learning jQuery, and I'm trying to find a simple code example that will

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.