protected async override void OnNavigatedTo(NavigationEventArgs e) { _navigationHelper.OnNavigatedTo(e); await MyBlogModel.LoadItemsAsync(); DataContext = this; }
/// <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); }
protected async override void OnNavigatedTo(NavigationEventArgs e) { _dataTransferManager = DataTransferManager.GetForCurrentView(); _dataTransferManager.DataRequested += OnDataRequested; _navigationHelper.OnNavigatedTo(e); if (MyBlogModel != null) { await MyBlogModel.LoadItemsAsync(); if (e.NavigationMode != NavigationMode.Back) { MyBlogModel.SelectItem(e.Parameter); } MyBlogModel.ViewType = ViewTypes.Detail; } DataContext = this; }