Advertisement
Guest User

Untitled

a guest
Mar 10th, 2015
347
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1.  
  2. using FootBallTard.Common;
  3. using FootBallTard.Controls;
  4. using HtmlAgilityPack;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.IO;
  8. using System.Linq;
  9. using System.Net.Http;
  10. using System.Runtime.InteropServices.WindowsRuntime;
  11. using System.Threading.Tasks;
  12. using Windows.ApplicationModel.DataTransfer;
  13. using Windows.Foundation;
  14. using Windows.Foundation.Collections;
  15. using Windows.Storage;
  16. using Windows.UI.Xaml;
  17. using Windows.UI.Xaml.Controls;
  18. using Windows.UI.Xaml.Controls.Primitives;
  19. using Windows.UI.Xaml.Data;
  20. using Windows.UI.Xaml.Input;
  21. using Windows.UI.Xaml.Media;
  22. using Windows.UI.Xaml.Media.Animation;
  23. using Windows.UI.Xaml.Navigation;
  24.  
  25.  
  26. namespace FootBallTard.Views
  27. {
  28. public sealed partial class Browser : Page
  29. {
  30.  
  31. private NavigationHelper _navigationHelper;
  32. DataTransferManager _dataTransferManager;
  33.  
  34.  
  35. public Browser()
  36. {
  37. this.InitializeComponent();
  38. this.NavigationCacheMode = NavigationCacheMode.Required;
  39. _navigationHelper = new NavigationHelper(this);
  40.  
  41. }
  42.  
  43. public NavigationHelper NavigationHelper
  44. {
  45. get { return _navigationHelper; }
  46. }
  47.  
  48. protected override async void OnNavigatedTo(NavigationEventArgs e)
  49. {
  50. _dataTransferManager = DataTransferManager.GetForCurrentView();
  51. _dataTransferManager.DataRequested += OnDataRequested;
  52. _navigationHelper.OnNavigatedTo(e);
  53. DataContext = this;
  54.  
  55. }
  56.  
  57. protected override void OnNavigatedFrom(NavigationEventArgs e)
  58. {
  59. _dataTransferManager.DataRequested -= OnDataRequested;
  60. _navigationHelper.OnNavigatedFrom(e);
  61. in_app_browser.Visibility = Visibility.Collapsed;
  62. Uri uri = new Uri("ms-appx-web:///Assets/WebPage/blank.html");
  63. in_app_browser.Navigate(uri);
  64. }
  65.  
  66.  
  67.  
  68. private void OnDataRequested(DataTransferManager sender, DataRequestedEventArgs e)
  69. {
  70. e.Request.Data.Properties.Title = title;
  71. e.Request.Data.SetWebLink(new Uri(feedurl));
  72. }
  73.  
  74. private void Share_Click(object sender, RoutedEventArgs e)
  75. {
  76. try
  77. {
  78. Windows.ApplicationModel.DataTransfer.DataTransferManager.ShowShareUI();
  79. }
  80. catch(Exception ex)
  81. {
  82. var e1 = ex.Message;
  83. }
  84. }
  85.  
  86.  
  87. }
  88. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement