From 9da3e0256092cc21398bda66b96b996a0de55dd3 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Tue, 13 Jul 2021 12:21:32 +0300 Subject: RML Extension changes --- .../ViewModels/AddItemDialogVM.cs | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/AddItemDialogVM.cs (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/AddItemDialogVM.cs') diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/AddItemDialogVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/AddItemDialogVM.cs new file mode 100644 index 000000000..0187f3bee --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.ThreadExtensions/ViewModels/AddItemDialogVM.cs @@ -0,0 +1,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(); + } + } + + + /// + /// Gets or sets the login command. + /// + public RelayCommand SaveCommand { get; set; } + + /// + /// Gets or sets the cancel command. + /// + public RelayCommand CancelCommand { get; set; } + + /// + /// Initializes a new instance of the class. + /// + public AddItemDialogVM() + { + SaveCommand = new RelayCommand(Accept, () => false == String.IsNullOrEmpty(Name)); + CancelCommand = new RelayCommand(Cancel); + } + + } +} -- cgit v1.3.1