diff --git a/MCTG/Model/Recipes/PreparationStep.cs b/MCTG/Model/Recipes/PreparationStep.cs index 32cb2d9..bfa176c 100644 --- a/MCTG/Model/Recipes/PreparationStep.cs +++ b/MCTG/Model/Recipes/PreparationStep.cs @@ -1,6 +1,8 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; +using System.Runtime.CompilerServices; using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; @@ -11,10 +13,13 @@ namespace Model /// Define a step of the preparation of a recipe. /// [DataContract(Name = "preparation-step")] - public class PreparationStep : IEquatable + public class PreparationStep : IEquatable , INotifyPropertyChanged { #region Attributes private string _description = ""; + private int _order = 1; + public event PropertyChangedEventHandler? PropertyChanged; + #endregion #region Properties @@ -22,7 +27,15 @@ namespace Model /// The order of this step in the preparation of the meal. /// [DataMember(Name = "order")] - public int Order { get; init; } + public int Order + { + get { return _order; } + set + { + _order = value; + OnPropertyChanged(); + } + } /// /// The description of the task the user need to do for this step of the preparation.
@@ -40,6 +53,12 @@ namespace Model _description = value; } } + + protected void OnPropertyChanged([CallerMemberName] string? propertyName = null) + { + if (PropertyChanged != null) + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } #endregion #region Constructors diff --git a/MCTG/Views/App.xaml.cs b/MCTG/Views/App.xaml.cs index 02d9d34..d5c1bbf 100644 --- a/MCTG/Views/App.xaml.cs +++ b/MCTG/Views/App.xaml.cs @@ -56,7 +56,7 @@ namespace Views InitializeComponent(); UserAppTheme = AppTheme.Light; - MainPage = new AddRecipe(); + MainPage = new Home(); //MainPage = new MyPosts(); } diff --git a/MCTG/Views/ContentPages/AddRecipe.xaml b/MCTG/Views/ContentPages/AddRecipe.xaml index bae9437..1cc23a1 100644 --- a/MCTG/Views/ContentPages/AddRecipe.xaml +++ b/MCTG/Views/ContentPages/AddRecipe.xaml @@ -6,7 +6,7 @@ xmlns:local="clr-namespace:Views" x:Name="nAddRecipe"> - +