private void btShare_Click(object sender, RoutedEventArgs e) { //if (showinfo.Visibility == Visibility.Visible) showinfo.Visibility = Visibility.Collapsed; DataTransferManager.ShowShareUI(); }
void share(string format) { this.format = format; DataTransferManager.ShowShareUI(); }
private void Button_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) { DataTransferManager.ShowShareUI(); }
/// <summary> /// Programmatically initiates the user interface for sharing content with another app. /// </summary> public void ShowShareUI() { DataTransferManager.ShowShareUI(); }
protected void ShowUIButton_Click(object sender, RoutedEventArgs e) { DataTransferManager.ShowShareUI(); }
public void Share(string message, string title = "", ShareType shareType = ShareType.Sms) { _message = message; _title = title; DataTransferManager.ShowShareUI(); }
internal void ShareCurrentAsync() { DataTransferManager.ShowShareUI(); }
private void MenuFlyoutItem_Click_Share(object sender, RoutedEventArgs e) { item_ = (e.OriginalSource as FrameworkElement)?.DataContext as Items; DataTransferManager.ShowShareUI(); }
public void SharePost() { GoogleAnalytics.EasyTracker.GetTracker().SendSocial("WhatsApp", "share", ""); DataTransferManager.ShowShareUI(); }
private void btnShare_Click(object sender, RoutedEventArgs e) { // share on facebook title + description + duration DataTransferManager.GetForCurrentView().DataRequested += OnShareDataRequested; DataTransferManager.ShowShareUI(); }
/// <summary> /// Executed when the Share Button is tapped from the Application bar. The app prepares content form the app to be shared using default installed apps on the phone. /// </summary> /// <param name="sender">Object Sender is a parameter called Sender that contains a reference to the control/object that raised the event.</param> /// <param name="e">RoutedEventArgs e is a parameter called e that contains the event data, see the RoutedEventArgs MSDN page for more information.</param> private void ShareButton_Click(object sender, RoutedEventArgs e) { var datacontext = (e.OriginalSource as FrameworkElement).DataContext; DataTransferManager.ShowShareUI(); }
public void Share(string content) { _content = content; RegisterForShare(); DataTransferManager.ShowShareUI(); }
private void shareBtn_Click(Object sender, TappedRoutedEventArgs e) { DataTransferManager.ShowShareUI(); MySplitView.IsPaneOpen = false; }
public override void ShowShareUI() { DataTransferManager.ShowShareUI(); }
private async void MenuFlyoutItem_Click_2(object sender, RoutedEventArgs e) { one.selectedItem = (sender as FrameworkElement).DataContext as Model.Class1; DataTransferManager.ShowShareUI(); }
private void share_button(object sender, RoutedEventArgs e) // 分享 { DataTransferManager.ShowShareUI(); }
private void shareButton_Tapped(object sender, TappedRoutedEventArgs e) { DataTransferManager.ShowShareUI(); }
void PlatformShare(DataPayload data) { this.data = data; DataTransferManager.ShowShareUI(); }
public async Task ShareItemAsync(ReceivedShareItem item) { //PrepareData if (item == null) { return; } var defaultUri = await App.CurrentAppUri; var sqt = item?.Square30x30Logo?.GetRandowmAccessStreamAsync(); var Square30x30Logo = sqt == null ? null : await sqt; var rbt = item?.Thumbnail?.GetRandowmAccessStreamAsync(); var Thumbnail = rbt == null ? null : await rbt;; var fsitm = item.AvialableShareItems.OfType <FilesShareItem>().FirstOrDefault(); var files = await GetStorageItemsAsync(fsitm); var dm = DataTransferManager.GetForCurrentView(); TaskCompletionSource <object> dataTrasferedCompletion = new TaskCompletionSource <object>(); using (Observable.FromEventPattern <TypedEventHandler <DataTransferManager, DataRequestedEventArgs>, DataRequestedEventArgs> (eh => dm.DataRequested += eh, eh => dm.DataRequested -= eh) //.ObserveOnDispatcher() .Subscribe( e => { var def = e.EventArgs.Request.GetDeferral(); try { //dataTrasferedCompletion.TrySetResult(null); var r = e.EventArgs.Request; var package = r.Data; package.Properties.ContentSourceApplicationLink = item.ContentSourceApplicationLink ?? defaultUri; package.Properties.ContentSourceWebLink = item.ContentSourceWebLink ?? defaultUri; package.Properties.Description = item.Description; package.Properties.PackageFamilyName = item.PackageFamilyName; if (Square30x30Logo != null) { package.Properties.Square30x30Logo = RandomAccessStreamReference.CreateFromStream(Square30x30Logo); package.Properties.LogoBackgroundColor = item.LogoBackgroundColor; } if (Thumbnail != null) { package.Properties.Thumbnail = RandomAccessStreamReference.CreateFromStream(Thumbnail); } //package.SetText(item.Text?? "Reshared by " + Windows.ApplicationModel.Package.Current.DisplayName); package.Properties.Title = item.Title; var order = item.AvialableShareItems.OrderBy(x => x is TextShareItem); //make sure text share item execute last foreach (var subShareItem in order) { FillPackage(files, package, subShareItem); } } catch (Exception ex) { e.EventArgs.Request.FailWithDisplayText(ex.Message); } finally { def.Complete(); } } )) { DataTransferManager.ShowShareUI(); await Task.WhenAny(Task.Delay(500), dataTrasferedCompletion.Task); } }
private void MenuFlyoutShare_Click(object sender, RoutedEventArgs e) { ViewModel1.SelectedItem = (sender as MenuFlyoutItem).DataContext as ListItem; DataTransferManager.ShowShareUI(); }
private void MenuFlyoutItem_Click_Share(object sender, RoutedEventArgs e) { DataTransferManager.ShowShareUI(); }
static void ButtonClick(object sender, RoutedEventArgs e) { DataTransferManager.ShowShareUI(); }
/// <summary> /// Share item via Share menu /// </summary> /// <param name="obj">Shared item</param> public async void ShareItemAsync(T item) { DataTransferManager daTranManaItem = DataTransferManager.GetForCurrentView(); daTranManaItem.DataRequested += DaTranManaItem_DataRequested; string itemTypeName = item.GetType().Name; if (item == null) { return; } CurrentItem = item; // To-Do solve //var typeOfItemList = System.Enum.GetValues(typeof(ItemTypeEnum)).Cast<ItemTypeEnum>().ToList(); var clone = (T)item.Clone(); if (item.Secured) { clone.Name = Crypting.Encrypt(item.Name); clone.Description = Crypting.Encrypt(item.Description); } var sharedData = new ItemStorage <T> { // To-Do solve //TypeOfItem = typeOfItemList[typeOfItemList.IndexOf(typeOfItemList.FirstOrDefault(x => x.ToString() == itemTypeName))], TypeOfItem = itemTypeName, Items = new List <T>() { clone } }; try { XmlSerializer Serializ = new XmlSerializer(typeof(ItemStorage <T>)); using (Stream XmlStream = ApplicationData.Current.LocalFolder.OpenStreamForWriteAsync(ShareFileItem, CreationCollisionOption.ReplaceExisting).GetAwaiter().GetResult()) { Serializ.Serialize(XmlStream, sharedData); } } catch (Exception e) { LogService.AddLogMessage(e.Message); throw new Base.Exceptions.Exception("Unhandled exception", e); } var shareFile = await ApplicationData.Current.LocalFolder.GetFileAsync(ShareFileItem); shareFileList = new List <StorageFile> { shareFile }; DataTransferManager.ShowShareUI(); }
public void CompartilharTransacao() { DataTransferManager.ShowShareUI(); }
//点击分享按钮 private void Share_Click(object sender, RoutedEventArgs e) { DataTransferManager.ShowShareUI(); }
private void OnShareSong(object sender, RoutedEventArgs e) { DataTransferManager.ShowShareUI(); }
private void share_button_Click(object sender, RoutedEventArgs e) { //分享得分 DataTransferManager.ShowShareUI(); }
private void sharePalette(object sender, RoutedEventArgs e) { DataTransferManager.ShowShareUI(); }
public virtual void ShareItem(RoutedEventArgs e) { DataTransferManager manager = DataTransferManager.GetForCurrentView(); manager.DataRequested += new TypedEventHandler <DataTransferManager, DataRequestedEventArgs>(Manager_DataRequested); DataTransferManager.ShowShareUI(new ShareUIOptions { Theme = Enum.IsDefined(typeof(ShareUITheme), ThemeHelper.RootTheme.ToString()) ? (ShareUITheme)ThemeHelper.RootTheme : ShareUITheme.Default }); async void Manager_DataRequested(DataTransferManager sender, DataRequestedEventArgs args) { DataRequestDeferral dataRequestDeferral = args.Request.GetDeferral(); List <IStorageItem> items = new List <IStorageItem>(); DataRequest dataRequest = args.Request; /*dataRequest.Data.Properties.Title = "Data Shared From Files"; * dataRequest.Data.Properties.Description = "The items you selected will be shared";*/ foreach (ListedItem item in SlimContentPage.SelectedItems) { if (item.IsShortcutItem) { if (item.IsLinkItem) { dataRequest.Data.Properties.Title = string.Format("ShareDialogTitle".GetLocalized(), items.First().Name); dataRequest.Data.Properties.Description = "ShareDialogSingleItemDescription".GetLocalized(); dataRequest.Data.SetWebLink(new Uri(((ShortcutItem)item).TargetPath)); dataRequestDeferral.Complete(); return; } } else if (item.PrimaryItemAttribute == StorageItemTypes.Folder) { if (await StorageItemHelpers.ToStorageItem <StorageFolder>(item.ItemPath, associatedInstance) is StorageFolder folder) { items.Add(folder); } } else { if (await StorageItemHelpers.ToStorageItem <StorageFile>(item.ItemPath, associatedInstance) is StorageFile file) { items.Add(file); } } } if (items.Count == 1) { dataRequest.Data.Properties.Title = string.Format("ShareDialogTitle".GetLocalized(), items.First().Name); dataRequest.Data.Properties.Description = "ShareDialogSingleItemDescription".GetLocalized(); } else if (items.Count == 0) { dataRequest.FailWithDisplayText("ShareDialogFailMessage".GetLocalized()); dataRequestDeferral.Complete(); return; } else { dataRequest.Data.Properties.Title = string.Format("ShareDialogTitleMultipleItems".GetLocalized(), items.Count, "ItemsCount.Text".GetLocalized()); dataRequest.Data.Properties.Description = "ShareDialogMultipleItemsDescription".GetLocalized(); } dataRequest.Data.SetStorageItems(items); dataRequestDeferral.Complete(); // TODO: Unhook the event somewhere } }
private void Share_Click(object sender, RoutedEventArgs e) { DataTransferManager.ShowShareUI(); Appbar.IsOpen = true; }