aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/CatalogSelectionViewVM.cs
blob: 0c4cd72f6cdca160ef5aecfc49dad382f7b95247 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.BL.Entities;
using Tango.BL.Enumerations;
using Tango.SharedUI;

namespace Tango.PPC.Jobs.Dialogs
{
    /// <summary>
    /// Represents a catalog picker.
    /// </summary>
    /// <seealso cref="Tango.SharedUI.DialogViewVM" />
    public class CatalogSelectionViewVM : DialogViewVM
    {

        private ObservableCollection<ColorCatalog> _catalogs;
        /// <summary>
        /// Gets or sets the catalogs.
        /// </summary>
        public ObservableCollection<ColorCatalog> Catalogs
        {
            get { return _catalogs; }
            set { _catalogs = value; RaisePropertyChangedAuto(); }
        }

        private ColorCatalog _selectedCatalog;
        /// <summary>
        /// Gets or sets the selected catalog.
        /// </summary>
        public ColorCatalog SelectedCatalog
        {
            get { return _selectedCatalog; }
            set { _selectedCatalog = value; RaisePropertyChangedAuto(); }
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="CatalogSelectionViewVM"/> class.
        /// </summary>
        /// <param name="catalogs">The catalogs.</param>
        /// <param name="selectedCatalog">The selected catalog.</param>
        public CatalogSelectionViewVM(List<ColorCatalog> catalogs, ColorCatalog selectedCatalog) : base()
        {
            Catalogs = catalogs.ToObservableCollection();
            SelectedCatalog = selectedCatalog;
        }
    }
}