| | | 1 | | // ----------------------------------------------------------------------- |
| | | 2 | | // <copyright file="AboutViewModel.cs" company="Stéphane ANDRE"> |
| | | 3 | | // Copyright (c) Stéphane ANDRE. All rights reserved. |
| | | 4 | | // </copyright> |
| | | 5 | | // ----------------------------------------------------------------------- |
| | | 6 | | |
| | | 7 | | using System; |
| | | 8 | | using System.Globalization; |
| | | 9 | | using MyNet.Primitives; |
| | | 10 | | using MyNet.UI.Resources; |
| | | 11 | | using MyNet.UI.Services; |
| | | 12 | | using MyNet.UI.ViewModels.Workspace; |
| | | 13 | | |
| | | 14 | | namespace MyNet.UI.ViewModels.Shell.About; |
| | | 15 | | |
| | | 16 | | /// <summary> |
| | | 17 | | /// Workspace view model for the about screen. |
| | | 18 | | /// </summary> |
| | | 19 | | public sealed class AboutViewModel : WorkspaceViewModel |
| | | 20 | | { |
| | | 21 | | /// <summary> |
| | | 22 | | /// Initializes a new instance of the <see cref="AboutViewModel"/> class. |
| | | 23 | | /// </summary> |
| | 0 | 24 | | public AboutViewModel(IApplicationInfo applicationInfo) |
| | | 25 | | { |
| | 0 | 26 | | ArgumentNullException.ThrowIfNull(applicationInfo); |
| | | 27 | | |
| | 0 | 28 | | Version = applicationInfo.Version; |
| | 0 | 29 | | Copyright = applicationInfo.Copyright; |
| | 0 | 30 | | Product = applicationInfo.ProductName; |
| | 0 | 31 | | Company = applicationInfo.Company; |
| | 0 | 32 | | Description = applicationInfo.Description; |
| | 0 | 33 | | } |
| | | 34 | | |
| | | 35 | | /// <summary> |
| | | 36 | | /// Gets the application version. |
| | | 37 | | /// </summary> |
| | | 38 | | public string? Version { get; } |
| | | 39 | | |
| | | 40 | | /// <summary> |
| | | 41 | | /// Gets or sets an optional message. |
| | | 42 | | /// </summary> |
| | 0 | 43 | | public string? Message { get; set => SetProperty(ref field, value); } |
| | | 44 | | |
| | | 45 | | /// <summary> |
| | | 46 | | /// Gets the copyright notice. |
| | | 47 | | /// </summary> |
| | | 48 | | public string? Copyright { get; } |
| | | 49 | | |
| | | 50 | | /// <summary> |
| | | 51 | | /// Gets the product name. |
| | | 52 | | /// </summary> |
| | | 53 | | public string? Product { get; } |
| | | 54 | | |
| | | 55 | | /// <summary> |
| | | 56 | | /// Gets the company name. |
| | | 57 | | /// </summary> |
| | | 58 | | public string? Company { get; } |
| | | 59 | | |
| | | 60 | | /// <summary> |
| | | 61 | | /// Gets the product description. |
| | | 62 | | /// </summary> |
| | | 63 | | public string? Description { get; } |
| | | 64 | | |
| | | 65 | | /// <inheritdoc /> |
| | 0 | 66 | | protected override string CreateTitle(CultureInfo culture) => UiResources.AboutX.FormatWith(culture, Product ?? stri |
| | | 67 | | } |
| | | 68 | | |