Guest User

Untitled

a guest
Jan 20th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.44 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Net;
  5. using System.Windows;
  6. using System.Windows.Controls;
  7. using System.Windows.Navigation;
  8. using Microsoft.Phone.Controls;
  9. using Microsoft.Phone.Shell;
  10. using StrategicRoute.Resources;
  11.  
  12. using StrategicRoute.Interfaces;
  13.  
  14. namespace StrategicRoute
  15. {
  16.     public partial class MainPage : PhoneApplicationPage, IUIPage, IWebServicePage
  17.     {
  18.         // Constructor
  19.         public MainPage()
  20.         {
  21.             InitializeComponent();
  22.  
  23.             // Set the data context of the listbox control to the sample data
  24.             DataContext = App.ViewModel;
  25.  
  26.             // Sample code to localize the ApplicationBar
  27.             //BuildLocalizedApplicationBar();
  28.         }
  29.  
  30.         // Load data for the ViewModel Items
  31.         protected override void OnNavigatedTo(NavigationEventArgs e)
  32.         {
  33.             if (!App.ViewModel.IsDataLoaded)
  34.             {
  35.                 App.ViewModel.LoadData();
  36.             }
  37.  
  38.             (IUIPage)this.Load(); // THROWS ERROR
  39.         }
  40.  
  41.         private void NewTrip_Button_Click(object sender, RoutedEventArgs e)
  42.         {
  43.             NavigationService.Navigate(new Uri("/NewTrip.xaml", UriKind.Relative));
  44.         }
  45.  
  46.         public void IUIPage.Load()
  47.         {
  48.             MessageBox.Show("1");
  49.         }
  50.  
  51.         public void IWebServicePage.Load()
  52.         {
  53.             MessageBox.Show("2");
  54.         }
  55.     }
  56. }
Add Comment
Please, Sign In to add comment