I have a ResourceDictionary that I added a codebehind to.
In the ResourceDictionary I have a combobox. I want to bind the ItemsSource of that combobox to a List in the codebehind.
How can I set the source of my binding so that it looks in the codebehind?
This one uses the code behind --------+
|
V
<ComboBox PreviewKeyDown="CustomItem_PreviewKeyDown"
ItemsSource="{Binding AllItems, Source={CodeBehind} />
^ ^
| |
But this one doesn't | because the source is not correct |
In case it matters, this is what the start of my ResourceDictionary looks like:
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="MyProject.MyCodeBehindClass"
x:Name="ANameThatSeemsUselessHere">
Any ideas on how I could get the ItemSource binding to the ResourceDictionary codebehind?