I have a Custom control in WPF and I need to bind a comboBox on it to an enum I wrote,
searching on the web I found that this is the way to go:
<ObjectDataProvider MethodName="GetDict" ObjectType="{x:Type App:EnumDescriptionValueDict}" x:Key="EnumDescriptionDict"> <ObjectDataProvider.MethodParameters> <x:Type TypeName="App:Transmission"></x:Type> </ObjectDataProvider.MethodParameters> </ObjectDataProvider> <ComboBox ItemsSource="{Binding Source={StaticResource EnumDescriptionDict}}" DisplayMemberPath="Key" SelectedValuePath="Value"/> but my control XAML
<UserControl x:Class="WpfControlFoo.UserControl1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" Width="799" Height="107"> so I don't find a place to insert the ObjectDataProvider XAML
Thanks for the suggestions :)