public ContactEventViewModel(FestiMSClient client, IMapper mapper, IEditViewModel <EventViewModel> e) { _client = client; _mapper = mapper; Contacts = client.Contacts.GetContact(e.EntityViewModel.CustomerId); Contacts.LoadMoreItemsAsync(); }
public AddContactViewModel(IEditViewModel <CustomerViewModel> customer, ContactListViewModel contactList, IMapper mapper, IFestiClient client) : base(contactList, mapper, client) { EntityViewModel = new ContactViewModel() { CustomerId = customer.Entity.Id }; }
public EditView(IEditViewModel viewmodel) { InitializeComponent(); DataContext = viewmodel; // Register actions which closes/shows EditView from a IEditViewModel viewmodel.CloseAction = new Action(() => this.Close()); viewmodel.ShowAction = new Action(() => this.ShowDialog()); WindowStartupLocation = WindowStartupLocation.CenterScreen; }
public AdviceEventViewModel(FestiMSClient client, IEditViewModel <EventViewModel> e) { ShowAddEntityCommand = new RelayCommand(ShowAddEntity); EditCommand = new RelayCommand(ShowEditEntity); DeleteCommand = new RelayCommand(DeleteEntity); _client = client; Advices = client.Advices.GetAdvice(e.Entity.Id); Advices.LoadMoreItemsAsync(); }
public QuestionnaireListViewModel(IQuestionnaireRepository repo, FestiMSClient client, IMapper mapper, [Named("ListEv")] IEditViewModel <EventViewModel> eventVm, INetStatusService netService) : base(client, mapper) { _repo = repo; _eventVm = eventVm; OpenPlanCommand = new RelayCommand(OpenPlan, CanPlanInspectorIn); // ReSharper disable once VirtualMemberCallInConstructor Refresh(); NetService = netService; }
public override DataTemplate SelectTemplate(object item, DependencyObject container) { FrameworkElement element = container as FrameworkElement; IEditViewModel editViewModel = item as IEditViewModel; if (element != null && editViewModel != null) { } return(null); }
public EditInspectorViewModel(IUserRepository repository, IEditViewModel <InspectorViewModel> editVm) { _editVm = editVm; CloseCommand = new RelayCommand <IClosable>(CloseWindow); Task.Run(async() => { Emails = await repository.GetEmailsAsync(EntityViewModel.Id); }); _editVm.AddPredicate(CanExecute); }
public AddQuestionnaireViewModel(IQuestionFactory questionFactory, IAddableList <Questionnaire> list, IMapper mapper, IEditViewModel <EventViewModel> editVm, IFestiClient client) : base(list, mapper, client) { DeleteSelectedCommand = new RelayCommand <QuestionViewModel>(DeleteSelected); _questionFactory = questionFactory; SelectedType = QuestionTypes.First(); AddQuestionCommand = new RelayCommand(AddQuestionAsync); ShowDescriptionCommand = new RelayCommand(ShowDescription); _questionnaire = new Questionnaire() { EventId = editVm.Entity.Id }; }
public EditQuestionnaireViewModel(QuestionFactory questionFactory, IQuestionRepository client, IEditViewModel <QuestionnaireViewModel> editVm) { _client = client; _editVm = editVm; _questionFactory = questionFactory; _editVm.AddPredicate(CanExecute); SelectedType = QuestionTypes.First(); Deleted = new List <QuestionViewModel>(); DeleteSelectedCommand = new RelayCommand <QuestionViewModel>(DeleteVM); AddQuestionCommand = new RelayCommand(AddQuestion); ShowDescriptionCommand = new RelayCommand(ShowDescription); AddEntityCommand = new RelayCommand <IClosable>(SaveEntities, (el) => CanExecute()); QuestionViewModels = new ObservableCollection <QuestionViewModel>(); editVm.EntityViewModel.QuestionViewModels = new ObservableCollection <QuestionViewModel>(); GetQuestions(); }
public EventDashboardViewModel(IEditViewModel <EventViewModel> editVm, FestiMSClient client, QuestionnaireListViewModel question, IMapper mapper, INetStatusService statusService) { _editVm = editVm; Questions = question; NetService = statusService; _editVm.AddPredicate(CanExecute); Task.Run(async() => { var customer = await client.Customers.GetCustomer(editVm.EntityViewModel.CustomerId); CustomerVM = mapper.Map <CustomerViewModel>(customer); RaisePropertyChanged("CustomerVM"); }); ShowContactsCommand = new RelayCommand(ShowContacts); ShowAdviceCommand = new RelayCommand(ShowAdviceBuilder, CanShowAdviceBuilder); ShowDescriptionCommand = new RelayCommand(ShowDescription); NetService.SubscribeWithAction(ShowAdviceCommand.RaiseCanExecuteChanged); }
public MainViewModel(IHomeViewModel homeViewModel, IEditViewModel editViewModel) { _context = new LagerListContext(); _homeViewModel = homeViewModel; _homeViewModel.Started += homeViewModel_Started; _homeViewModel.AddNewMaterial += homeViewModel_AddNewMaterial; _homeViewModel.EditSelectedPanel += homeViewModel_EditSelectedPanel; _homeViewModel.DeleteMaterial += homeViewModel_DeleteSelectedMaterial; _homeViewModel.EditSelectedWorkbench += homeViewModel_EditSelectedWorkbench; _editViewModel = editViewModel; _editViewModel.Started += editViewModel_Started; _editViewModel.Succeeded += editViewModel_Succeeded; _editViewModel.CreateNewPanel += editViewModel_CreateNewPanel; _editViewModel.Update += editViewModel_Update; _editViewModel.CreateNewWorkbench += editViewModel_CreateNewWorkbench; setHomePageCurrent(); }
public EditCustomerViewModel(IEditViewModel <CustomerViewModel> editVm) { _editVm = editVm; _editVm.AddPredicate(CanExecute); }
public ContactListViewModel(IEditViewModel <CustomerViewModel> customer, FestiMSClient client, IMapper mapper) : base(client, mapper) { _editViewModel = customer; Refresh(); }
public EditContactViewModel(IEditViewModel <ContactViewModel> editVm) { _editVm = editVm; _editVm.AddPredicate(CanExecute); }