aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/AddItemDialogVM.cs
blob: 0187f3beeda9b8c1ad8dd346b7eb8dc78149c1da (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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.Core.Commands;
using Tango.SharedUI;

namespace Tango.MachineStudio.ThreadExtensions.ViewModels
{
    public class AddItemDialogVM : DialogViewVM
    {
        private string _name;

        public string Name
        {
            get { return _name; }
            set { _name = value;
                RaisePropertyChangedAuto();
                SaveCommand.RaiseCanExecuteChanged();
            }
        }

       
        /// <summary>
        /// Gets or sets the login command.
        /// </summary>
        public RelayCommand SaveCommand { get; set; }

        /// <summary>
        /// Gets or sets the cancel command.
        /// </summary>
        public RelayCommand CancelCommand { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="MachineLoginViewVM"/> class.
        /// </summary>
        public AddItemDialogVM()
        {
            SaveCommand = new RelayCommand(Accept, () => false == String.IsNullOrEmpty(Name));
            CancelCommand = new RelayCommand(Cancel);
        }
        
    }
}