protected async override void OnNavigatedTo(NavigationEventArgs e) { _navigationHelper.OnNavigatedTo(e); await ChamindasBlogModel.LoadItemsAsync(); DataContext = this; }
/// <summary> /// Load ViewModel items asynchronous /// </summary> public async Task LoadDataAsync(bool forceRefresh = false) { var loadTasks = new Task[] { AboutModel.LoadItemsAsync(forceRefresh), PrabathsBlogModel.LoadItemsAsync(forceRefresh), JaliyasBlogModel.LoadItemsAsync(forceRefresh), ChamindasBlogModel.LoadItemsAsync(forceRefresh), MalinsBlogModel.LoadItemsAsync(forceRefresh), }; await Task.WhenAll(loadTasks); }
protected override async void OnNavigatedTo(NavigationEventArgs e) { _dataTransferManager = DataTransferManager.GetForCurrentView(); _dataTransferManager.DataRequested += OnDataRequested; _navigationHelper.OnNavigatedTo(e); if (ChamindasBlogModel != null) { await ChamindasBlogModel.LoadItemsAsync(); ChamindasBlogModel.SelectItem(e.Parameter); ChamindasBlogModel.ViewType = ViewTypes.Detail; } DataContext = this; }