I'm new to WPF and trying to figure out all this databinding stuff. When I do the following in my code, my ComboBox is populated when I run my application:
public NewForm()
{
InitializeComponent();
Product.ItemsSource = Products;
}
public List<string> Products
{
get { return _productsComponents.Keys.ToList(); }
}
However, in my XAML when I have the following, the ComboBox has no content in it when I run my application:
<ComboBox Height="23" HorizontalAlignment="Left" Margin="138,116,0,0"
Name="Product" VerticalAlignment="Top" Width="120"
ItemsSource="{Binding Path=Products}"/>
Am I referencing something incorrectly? This tutorial was helpful but he never set ItemsSource in XAML, always in C#.