public RecipeDetailViewModel( IRecipeRepository recipesRepository, IMessageDialogService messageDialogService, IMediator mediator, IIngredientAmountDetailViewModel ingredientAmountDetailViewModel) { _recipesRepository = recipesRepository; _messageDialogService = messageDialogService; _mediator = mediator; IngredientAmountDetailViewModel = ingredientAmountDetailViewModel; SaveCommand = new RelayCommand(Save, CanSave); DeleteCommand = new RelayCommand(Delete); mediator.Register <NewMessage <IngredientAmountWrapper> >(NewIngredientAmount); mediator.Register <UpdateMessage <IngredientAmountWrapper> >(UpdateIngredientAmount); mediator.Register <DeleteMessage <IngredientAmountWrapper> >(DeleteIngredientAmount); }
public RecipeDetailViewModel( RecipeFacade recipeFacade, IMessageDialogService messageDialogService, IMediator mediator, IIngredientAmountDetailViewModel ingredientAmountDetailViewModel) { _recipeFacade = recipeFacade; _messageDialogService = messageDialogService; _mediator = mediator; IngredientAmountDetailViewModel = ingredientAmountDetailViewModel; SaveCommand = new AsyncRelayCommand(SaveAsync, CanSave); DeleteCommand = new AsyncRelayCommand(DeleteAsync); mediator.Register <NewMessage <IngredientAmountWrapper> >(NewIngredientAmount); mediator.Register <UpdateMessage <IngredientAmountWrapper> >(UpdateIngredientAmount); mediator.Register <DeleteMessage <IngredientAmountWrapper> >(DeleteIngredientAmount); }