protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            _dataTransferManager = DataTransferManager.GetForCurrentView();
            _dataTransferManager.DataRequested += OnDataRequested;

            _navigationHelper.OnNavigatedTo(e);

            if (InstagramModel != null)
            {
                await InstagramModel.LoadItemsAsync();

                InstagramModel.SelectItem(e.Parameter);

                InstagramModel.ViewType = ViewTypes.Detail;
            }
            DataContext = this;

            // Allow this page to rotate
            _currentOrientations = DisplayInformation.AutoRotationPreferences;
            DisplayInformation.AutoRotationPreferences = DisplayOrientations.Portrait
                                                         | DisplayOrientations.Landscape
                                                         | DisplayOrientations.LandscapeFlipped
                                                         | DisplayOrientations.PortraitFlipped;

            // Handle orientation changes
            DisplayInformation.GetForCurrentView().OrientationChanged += this.OnOrientationChanged;
            this.TransitionStoryboardState();
        }
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            _navigationHelper.OnNavigatedTo(e);
            await InstagramModel.LoadItemsAsync();

            DataContext = this;
        }
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            _dataTransferManager = DataTransferManager.GetForCurrentView();
            _dataTransferManager.DataRequested += OnDataRequested;

            _navigationHelper.OnNavigatedTo(e);
            await InstagramModel.LoadItemsAsync();
        }
 /// <summary>
 /// Load ViewModel items asynchronous
 /// </summary>
 public async Task LoadDataAsync(bool forceRefresh = false)
 {
     var loadTasks = new Task[]
     {
         AboutMeModel.LoadItemsAsync(forceRefresh),
         TwitterModel.LoadItemsAsync(forceRefresh),
         InstagramModel.LoadItemsAsync(forceRefresh),
         MyBlogModel.LoadItemsAsync(forceRefresh),
         MyVideosModel.LoadItemsAsync(forceRefresh),
         MyFavoriteMusicModel.LoadItemsAsync(forceRefresh),
     };
     await Task.WhenAll(loadTasks);
 }
示例#5
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            _dataTransferManager = DataTransferManager.GetForCurrentView();
            _dataTransferManager.DataRequested += OnDataRequested;

            _navigationHelper.OnNavigatedTo(e);

            await InstagramModel.LoadItemsAsync();

            InstagramModel.SelectItem(e.Parameter);

            if (InstagramModel != null)
            {
                InstagramModel.ViewType = ViewTypes.Detail;
            }
            DataContext = this;
        }
 protected override async void OnNavigatedTo(NavigationEventArgs e)
 {
     _navigationHelper.OnNavigatedTo(e);
     await InstagramModel.LoadItemsAsync();
 }