public void ShareNotes( ) { if (Note != null) { string htmlStream; string textStream; Note.GetNotesForEmail(out htmlStream, out textStream); ExportedNoteSource noteSource = new ExportedNoteSource( ); noteSource.HTMLStream = new NSString(htmlStream); noteSource.TextStream = new NSString(textStream); var items = new NSObject[] { noteSource }; UIActivityViewController shareController = new UIActivityViewController(items, null); // set the subject line in case the share to email string emailSubject = string.Format(MobileApp.Shared.Strings.MessagesStrings.Read_Share_Notes, NoteName); shareController.SetValueForKey(new NSString(emailSubject), new NSString("subject")); // if devices like an iPad want an anchor, set it if (shareController.PopoverPresentationController != null) { shareController.PopoverPresentationController.SourceView = Task.NavToolbar; } PresentViewController(shareController, true, null); } }
public void ShareNotes() { if ( Note != null ) { string htmlStream; string textStream; Note.GetNotesForEmail( out htmlStream, out textStream ); ExportedNoteSource noteSource = new ExportedNoteSource(); noteSource.HTMLStream = new NSString( htmlStream ); noteSource.TextStream = new NSString( textStream ); var items = new NSObject[] { noteSource }; UIActivityViewController shareController = new UIActivityViewController( items, null ); // set the subject line in case the share to email string emailSubject = string.Format( App.Shared.Strings.MessagesStrings.Read_Share_Notes, NoteName ); shareController.SetValueForKey( new NSString( emailSubject ), new NSString( "subject" ) ); // if devices like an iPad want an anchor, set it if ( shareController.PopoverPresentationController != null ) { shareController.PopoverPresentationController.SourceView = Task.NavToolbar; } PresentViewController( shareController, true, null ); } }