Exemple #1
0
        private async void shareOneItem(object sender, RoutedEventArgs e)
        {
            var dc   = (sender as FrameworkElement).DataContext;
            var item = (MainListView.ContainerFromItem(dc) as ListViewItem).Content as TodoItem;

            sharetitle  = item.Title;
            sharedetail = item.Description;
            string shareimgname = item.ImageUrl;
            var    date         = item.DueDate.Date;

            sharedate = "\nDue date: " + date.Year + '-' + date.Month + '-' + date.Day;
            if (string.IsNullOrEmpty(shareimgname))
            {
                shareimg = await Package.Current.InstalledLocation.GetFileAsync("Assets\\icons8-task-50.png");
            }
            else
            {
                shareimg = await ApplicationData.Current.LocalFolder.GetFileAsync(shareimgname);
            }
            DataTransferManager.ShowShareUI();
        }