/// <summary> /// Is called when the user is navigated to the view of this view model. Loads the todo list items from storage. /// </summary> /// <param name="e">The navigation arguments, that contain more information about the navigation.</param> public override Task OnNavigateToAsync(NavigationEventArgs e) { // Clears the current list of todo list items first this.todoListItems.Clear(); // Loads all the todo list items from the repository and stores them in a list, so that the view has access to them this.todoListItems.AddRange(this.todoListItemsRepository.GetTodoListItems().ToList()); // Since no asynchronous operation was performed, an empty task is returned return Task.FromResult(0); }
/// <summary> /// Is called before the view model is navigated away from. Other than OnDeactivate, OnNavigateFrom is called everytime the user navigates away from this view model. /// </summary> /// <param name="e">The event arguments, that allows the navigation to be cancelled.</param> public virtual Task OnNavigateFromAsync(NavigationEventArgs e) { return Task.FromResult(0); }