public EggProductionEntryViewModel(IMessageBroker broker, IEggProductionService service, IConsumableUsageService usageService, IHenHouseService houseService, SaveEggProductionCommand saveCommand, CancelCommand cancelCommand, ShowEggProductionListCommand showListCommand) { this.broker = broker; this.service = service; this.usageService = usageService; ActualSaveCommand = saveCommand; CancelCommand = cancelCommand; ShowListCommand = showListCommand; PropertiesToValidate = new List <string> { "Date", "Details" }; InitializeCommands(); NavigationCommands = new List <CommandBase>() { SaveCommand, CancelCommand, RefreshCommand }; CancelCommand.Action = b => showListCommand.Execute(null); HenHouses = new ObservableCollection <HenHouse>(houseService.GetAll().OrderBy(h => h.Name)); SubscribeMessages(); }
public EggProductionEntryViewModel(IMessageBroker broker, IEggProductionService service,IConsumableUsageService usageService, IHenHouseService houseService, SaveEggProductionCommand saveCommand, CancelCommand cancelCommand, ShowEggProductionListCommand showListCommand) { this.broker = broker; this.service = service; this.usageService = usageService; ActualSaveCommand = saveCommand; CancelCommand = cancelCommand; ShowListCommand = showListCommand; PropertiesToValidate = new List<string> { "Date", "Details" }; InitializeCommands(); NavigationCommands =new List<CommandBase>(){SaveCommand, CancelCommand, RefreshCommand}; CancelCommand.Action = b => showListCommand.Execute(null); HenHouses = new ObservableCollection<HenHouse>(houseService.GetAll().OrderBy(h => h.Name)); SubscribeMessages(); }