diff options
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CatsViewVM.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CatsViewVM.cs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CatsViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CatsViewVM.cs new file mode 100644 index 000000000..74a7e29eb --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.DB/ViewModels/CatsViewVM.cs @@ -0,0 +1,41 @@ +using Microsoft.Win32; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.Commands; +using Tango.DAL.Observables; +using Tango.MachineStudio.Common.Notifications; + +namespace Tango.MachineStudio.DB.ViewModels +{ + public class CatsViewVM : DbTableViewModel<Cat> + { + public CatsViewVM(INotificationProvider notification) : base(notification) + { + SelectDataFileCommand = new RelayCommand(SelectDataFile); + } + + public RelayCommand SelectDataFileCommand { get; set; } + + private void SelectDataFile() + { + OpenFileDialog dlg = new OpenFileDialog(); + dlg.Filter = "Color Adjustment Files|*.CAT"; + dlg.Title = "Select Color Adjustment File"; + if (dlg.ShowDialog().Value) + { + try + { + EditEntity.Data = File.ReadAllBytes(dlg.FileName); + } + catch (Exception ex) + { + _notification.ShowError(ex.Message); + } + } + } + } +} |
