namespace SamaanSystems.IBC.Business >{ > /// <summary> > /// Summary description for Rate. > /// </summary> > public partial class Rate > { > public enum RateType : int > { > Standard = 1, > Mail = 2, > ZipX = 3 > } > } >}>
<ObjectDataProvider x:Key="rateTypes" > MethodName="GetValues" > ObjectType="{x:Type sys:Enum}"> > <ObjectDataProvider.MethodParameters> > <x:Type TypeName="local:RateTypes" /> > </ObjectDataProvider.MethodParameters> > </ObjectDataProvider>>
<local:ABusinessWindow > xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" > xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" > xmlns:mmwpf="clr-namespace:OakLeaf.MM.Main.WPF;assembly=OakLeaf.MM2010.WPF" > xmlns:d="http://schemas.microsoft.com/expression/blend/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" > xmlns:Custom="http://schemas.microsoft.com/wpf/2008/toolkit" > xmlns:SamaanSystems_IBC_Business="clr-namespace:SamaanSystems.IBC.Business;assembly=SamaanSystems.IBC.Business" > xmlns:local="clr-namespace:SamaanSystems.IBC.WPF" > x:Class="SamaanSystems.IBC.WPF.RatesWindow" > x:Name="Window" > Title="Rates" > Width="550" Height="450" AllowsTransparency="False" Background="#FFFFFFFF" WindowStartupLocation="CenterScreen" > > > <ObjectDataProvider x:Key="rateTypes" > MethodName="GetValues" > ObjectType="{x:Type sys:Enum}"> > <ObjectDataProvider.MethodParameters> > <x:Type TypeName="local:RateTypes" /> > </ObjectDataProvider.MethodParameters> > </ObjectDataProvider> > > <mmwpf:mmBusinessWindow.DataContext> > <SamaanSystems_IBC_Business:RateEntity/> > </mmwpf:mmBusinessWindow.DataContext> > > <Border> > <Border.Background> > ...>
<Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local ="clr-namespace:WpfApplication1" xmlns:sys="clr-namespace:System;assembly=mscorlib" Title="MainWindow" Height="350" Width="525"> <Window.Resources> <ObjectDataProvider x:Key="rates" MethodName="GetValues" ObjectType="{x:Type sys:Enum}"> <ObjectDataProvider.MethodParameters> <x:Type TypeName="local:RateType" /> </ObjectDataProvider.MethodParameters> </ObjectDataProvider> </Window.Resources> <ComboBox ItemsSource="{Binding Source={StaticResource rates}}"></ComboBox> </Window>I just tried this with RateType defined in the same window so you'll need to adjust.