| | | 1 | | // ----------------------------------------------------------------------- |
| | | 2 | | // <copyright file="NavigationStateChangedEventArgs.cs" company="Stéphane ANDRE"> |
| | | 3 | | // Copyright (c) Stéphane ANDRE. All rights reserved. |
| | | 4 | | // </copyright> |
| | | 5 | | // ----------------------------------------------------------------------- |
| | | 6 | | |
| | | 7 | | using System; |
| | | 8 | | using MyNet.UI.Navigation.Models; |
| | | 9 | | |
| | | 10 | | namespace MyNet.UI.Navigation; |
| | | 11 | | |
| | | 12 | | /// <summary> |
| | | 13 | | /// Provides data for <see cref="INavigationService.StateChanged"/>. |
| | | 14 | | /// </summary> |
| | | 15 | | /// <remarks> |
| | | 16 | | /// Initializes a new instance of the <see cref="NavigationStateChangedEventArgs"/> class. |
| | | 17 | | /// </remarks> |
| | | 18 | | /// <param name="currentContext">The current navigation context.</param> |
| | | 19 | | /// <param name="canGoBack">Whether backward navigation is available.</param> |
| | | 20 | | /// <param name="canGoForward">Whether forward navigation is available.</param> |
| | 9 | 21 | | public sealed class NavigationStateChangedEventArgs( |
| | 9 | 22 | | NavigationContext? currentContext, |
| | 9 | 23 | | bool canGoBack, |
| | 9 | 24 | | bool canGoForward) : EventArgs |
| | | 25 | | { |
| | | 26 | | /// <summary> |
| | | 27 | | /// Gets the current navigation context after the state change. |
| | | 28 | | /// </summary> |
| | | 29 | | public NavigationContext? CurrentContext { get; } = currentContext; |
| | | 30 | | |
| | | 31 | | /// <summary> |
| | | 32 | | /// Gets a value indicating whether backward navigation is available. |
| | | 33 | | /// </summary> |
| | | 34 | | public bool CanGoBack { get; } = canGoBack; |
| | | 35 | | |
| | | 36 | | /// <summary> |
| | | 37 | | /// Gets a value indicating whether forward navigation is available. |
| | | 38 | | /// </summary> |
| | | 39 | | public bool CanGoForward { get; } = canGoForward; |
| | | 40 | | } |
| | | 41 | | |