public void ActivateMainWindow <T>(T dataContext) { IView view = new ContactsView(); view.DataContext = dataContext; view.Show(); }
public MainWindowViewModel()//View First! { ShowAllContacts = new SimplerCommand { Action = () => { var view = new ContactsView(); view.DataContext = new ContactsViewModel(WorkUnitProvider); view.Show(); } }; }
public static void Contacts(string[] expression = null) { List <Contact> contacts = Model.GetContacts(expression); int contactNumber = ContactsView.Show(contacts); if (contactNumber > 0) { DetailContactController.DetailContact(contacts.ElementAt(contactNumber - 1)); } else { MainMenuController.Menu(); } }
private void OpenContactView(bool isSelectionMode) { if (_contactsView == null) { _logger.Info("show contacts view"); _contactsView = Container.Resolve <ContactsView>(); _contactsView.Show(); var viewmodel = (ContactsViewModel)_contactsView.DataContext; viewmodel.IsSelectionMode = isSelectionMode; } else { _logger.Warn("contacts view already open"); _logger.Info("push view in foreground"); var viewmodel = (ContactsViewModel)_contactsView.DataContext; viewmodel.IsSelectionMode = isSelectionMode; _contactsView.Focus(); } }