Example #1
0
        public override void Execute(object parameter)
        {
            var view              = CreateView();
            var model             = CreateModel();
            var closeCommand      = CreateCloseCommand(view);
            var saveTicketCommand = saveTicketCommandFactory.Create(model, view);
            var viewModel         = CreateViewModel(model, closeCommand, saveTicketCommand);

            view.DataContext = viewModel;
            view.ShowDialog();
        }
Example #2
0
        ITicketDialogViewModel CreateViewModel(ITicketListItemViewModel parameter, ITicketDetailsView view)
        {
            var closeCommand = closeCommandFactory.Create(view);

            var ticket      = ticketRepository.GetAll().FirstOrDefault(p => p.Id == parameter.Id);
            var saveCommand = saveTicketCommandFactory.Create(ticket, view);
            var viewModel   = ticketDialogViewModelFactory.Create(ticket, closeCommand, saveCommand,
                                                                  Strings.TicketDetails.EditHeaderText);

            return(viewModel);
        }