예제 #1
0
        public void ActivateMainWindow <T>(T dataContext)
        {
            IView view = new ContactsView();

            view.DataContext = dataContext;
            view.Show();
        }
예제 #2
0
 public MainWindowViewModel()//View First!
 {
     ShowAllContacts = new SimplerCommand
     {
         Action = () =>
         {
             var view = new ContactsView();
             view.DataContext = new ContactsViewModel(WorkUnitProvider);
             view.Show();
         }
     };
 }
예제 #3
0
        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();
            }
        }
예제 #4
0
        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();
            }
        }