diff --git a/MCTG/Model/Recipes/ReadOnlyObservableRecipeCollection.cs b/MCTG/Model/Recipes/ReadOnlyObservableRecipeCollection.cs new file mode 100644 index 0000000..8def54c --- /dev/null +++ b/MCTG/Model/Recipes/ReadOnlyObservableRecipeCollection.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; + +namespace Model +{ + public class ReadOnlyObservableRecipeCollection : ReadOnlyObservableCollection + { + private RecipeCollection _recipeObserved; + + public string Description => _recipeObserved.Description; + + public ReadOnlyObservableRecipeCollection(RecipeCollection recipeCollection) + : base(recipeCollection) + { + _recipeObserved = recipeCollection; + } + } +} diff --git a/MCTG/Model/Recipes/RecipeCollection.cs b/MCTG/Model/Recipes/RecipeCollection.cs index f09baaa..c58bda2 100644 --- a/MCTG/Model/Recipes/RecipeCollection.cs +++ b/MCTG/Model/Recipes/RecipeCollection.cs @@ -2,6 +2,7 @@ using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; +using System.ComponentModel; using System.Text; namespace Model @@ -31,6 +32,8 @@ namespace Model _description = "No description."; else _description = value; + + OnPropertyChanged(new PropertyChangedEventArgs("Description")); } } #endregion diff --git a/MCTG/Views/ContentPages/Home.xaml b/MCTG/Views/ContentPages/Home.xaml index 1f2536b..38b81e3 100644 --- a/MCTG/Views/ContentPages/Home.xaml +++ b/MCTG/Views/ContentPages/Home.xaml @@ -8,8 +8,7 @@ x:Name="homepage"> + NeedReturn="False"> @@ -20,7 +19,7 @@ Margin="20, 10, 15, 0"/> @@ -52,10 +51,11 @@ - +