Bind enum to combobox

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hello
I am trying to bind enum to combobox. I was looking on several websites, anyway, can not manage it to working.
I am having this error:

{"Type reference cannot find type named {clr-namespace:exTibia;assembly=exTibia}Consts.Directions."}


Below my xaml and class.
<pre class="prettyprint <Window x:Class="exTibia.Settings"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Settings"
Height="350"
Width="550"
WindowStyle="ToolWindow"
ResizeMode="NoResize"
xmlns:local="clr-namespace:exTibia"
xmlns:System="clr-namespace:System;assembly=mscorlib"
Closing="Window_Closing"
WindowStartupLocation="CenterOwner
<Window.Resources>
<ObjectDataProvider x:Key="ConstsDirections" MethodName="GetNames" ObjectType="{x:Type System:Enum}
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="local:Consts.Directions </x:Type>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</Window.Resources>[/code]

<pre class="prettyprint namespace exTibia
{
public class Consts
{
public enum Directions
{
North = 0,
NorthEast = 5,
NorthWest = 8,
South = 2,
SouthEast = 6,
SouthWest = 7,
East = 1,
West = 3
}
}
}[/code]
<br/>
Could anyone help me please?
/panqnik


View the full article
 
Back
Top