Represents the event arguments that are passed to the navigation events of the view models.
Inheritance: System.ComponentModel.CancelEventArgs
Exemplo n.º 1
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);
 }
 /// <summary>
 /// Is called when the user is navigated to the view corresponding to this view model. Renders the report for display.
 /// </summary>
 /// <param name="e">The event arguments, that contain more information about the navigation.</param>
 public override async Task OnNavigateToAsync(NavigationEventArgs e) => this.FixedDocument.Value = await this.reportingService.RenderAsync<Document>();
        /// <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);
        }