// Constructor public PanoPage() { InitializeComponent(); this.ViewModel = PanoVM.Instance; this.DataContext = this.ViewModel; RecentStopsQueue.Refresh(); CurrentInstance = this; // Sample code to localize the ApplicationBar //BuildLocalizedApplicationBar(); }
/// <summary> /// Finish initialization after setting the viewmodel /// </summary> private void InitializeFromViewModel() { this.DataContext = this.ViewModel; // Initialize progress bar InitializeProgress(); // Get location if necessary if (LocationTracker.Location == null && LocationTracker.GetPermission()) { ProgressIndicatorHelper.Instance.Push(LoadingEnum.Location); LocationTracker.RetrieveLocation(); } // Update recent stops RecentStopsQueue.Push(ViewModel.Context); // Preven further initialization this.startup = false; }