コード例 #1
0
        private void NewContact()
        {
            Contact newContact = Root.AddNewContact();

            ContactListViewModel.SelectedContact = newContact;
            ContactListViewModel.FocusItem();
        }
コード例 #2
0
ファイル: ContactController.cs プロジェクト: jbe2277/waf
    private void DeleteContact()
    {
        var nextContact = ContactListViewModel.Contacts.GetNextElementOrDefault(ContactListViewModel.SelectedContact);

        Root.RemoveContact(ContactListViewModel.SelectedContact !);
        ContactListViewModel.SelectedContact = nextContact ?? ContactListViewModel.Contacts.LastOrDefault();
        ContactListViewModel.FocusItem();
    }
コード例 #3
0
        private void DeleteContact()
        {
            // Use the ContactCollectionView, which represents the sorted/filtered state of the contacts, to determine the next contact to select.
            var nextContact = CollectionHelper.GetNextElementOrDefault(ContactListViewModel.ContactCollectionView, ContactListViewModel.SelectedContact);

            Root.RemoveContact(ContactListViewModel.SelectedContact);

            ContactListViewModel.SelectedContact = nextContact ?? ContactListViewModel.ContactCollectionView.LastOrDefault();
            ContactListViewModel.FocusItem();
        }