The Load Call:
private void LoadRecipes()
{
try
{
this.Recipes = new ObservableCollection<Recipe>(this._recipeRepository.GetRecipes());
//debug
DumpRecipes();
}
catch (Exception ex)
{
Console.WriteLine("Error in LoadRecipes: " + ex.Message);
}
}
The GetRecipes call:
public IEnumerable<Recipe> GetRecipes()
{
var query = from e in _recipes orderby e.Id select e;
return query.ToList();
}
The XAML:
<ListBox
Name="RecipeNames"
ItemsSource="{Binding Recipes}"
Margin="6"
SelectedItem="{Binding Path=SelectedRecipe, Mode=TwoWay}"
Grid.Row="1"
>
If I add the item right into the ObservableCollection in the viewmodel, the list updates correctly, I just cannot figure out why it is not updating with the above calls.
Thanks.

New Topic/Question
Reply




MultiQuote



|