Exemplo n.º 1
0
        public static async void UnpinContact(Contact contact)
        {
            //前面应放置API版本检查代码,仅能实装于16299
            if (!(await checkContactAsync(contact)))
            {
                return;
            }
            PinnedContactManager contactManager = PinnedContactManager.GetDefault();
            var contactList = await getContactListAsync();

            await contactManager.RequestUnpinContactAsync(await contactList.GetContactFromRemoteIdAsync(contact.RemoteId), PinnedContactSurface.Taskbar);

            await deleteContactAsync(contact);
        }
        private async void MenuFlyoutItem_Click(object sender, RoutedEventArgs e)
        {
            var menuFlyoutItem = sender as MenuFlyoutItem;
            var appContact     = menuFlyoutItem?.DataContext as AppContact;

            if (appContact != null)
            {
                var contactToPinUnpin = await GetAggregateContactFromAppContactAsync(appContact);

                switch (menuFlyoutItem.Tag)
                {
                case Constants.CONTACT_CONTEXT_MENU_TAG_PIN:
                    await _pinnedContactManager.RequestPinContactAsync(contactToPinUnpin, PinnedContactSurface.Taskbar);

                    break;

                case Constants.CONTACT_CONTEXT_MENU_TAG_UNPIN:
                    await _pinnedContactManager.RequestUnpinContactAsync(contactToPinUnpin, PinnedContactSurface.Taskbar);

                    break;
                }
            }
        }
Exemplo n.º 3
0
 public static async void UnpinContact(Contact contact)
 {
     await pinnedContactManager.RequestUnpinContactAsync(contact, PinnedContactSurface.Taskbar);
 }