| | | 1 | | // ----------------------------------------------------------------------- |
| | | 2 | | // <copyright file="ExportColumnViewModel.cs" company="Stéphane ANDRE"> |
| | | 3 | | // Copyright (c) Stéphane ANDRE. All rights reserved. |
| | | 4 | | // </copyright> |
| | | 5 | | // ----------------------------------------------------------------------- |
| | | 6 | | |
| | | 7 | | namespace MyNet.UI.ViewModels.Export; |
| | | 8 | | |
| | | 9 | | /// <summary> |
| | | 10 | | /// Represents a selectable export column. |
| | | 11 | | /// </summary> |
| | | 12 | | /// <typeparam name="TColumn">The column metadata type.</typeparam> |
| | | 13 | | public sealed class ExportColumnViewModel<TColumn> : ViewModelBase |
| | | 14 | | { |
| | | 15 | | /// <summary> |
| | | 16 | | /// Initializes a new instance of the <see cref="ExportColumnViewModel{TColumn}"/> class. |
| | | 17 | | /// </summary> |
| | | 18 | | /// <param name="column">The column metadata.</param> |
| | | 19 | | /// <param name="key">The unique column key.</param> |
| | | 20 | | /// <param name="isSelected">Whether this column is selected for export.</param> |
| | 0 | 21 | | public ExportColumnViewModel(TColumn column, string key, bool isSelected) |
| | | 22 | | { |
| | 0 | 23 | | Column = column; |
| | 0 | 24 | | Key = key; |
| | 0 | 25 | | IsSelected = isSelected; |
| | 0 | 26 | | } |
| | | 27 | | |
| | | 28 | | /// <summary> |
| | | 29 | | /// Gets the column metadata. |
| | | 30 | | /// </summary> |
| | | 31 | | public TColumn Column { get; } |
| | | 32 | | |
| | | 33 | | /// <summary> |
| | | 34 | | /// Gets the unique column key. |
| | | 35 | | /// </summary> |
| | | 36 | | public string Key { get; } |
| | | 37 | | |
| | | 38 | | /// <summary> |
| | | 39 | | /// Gets or sets a value indicating whether the column is selected. |
| | | 40 | | /// </summary> |
| | 0 | 41 | | public bool IsSelected { get; set => SetProperty(ref field, value); } |
| | | 42 | | } |
| | | 43 | | |