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.BL.Entities;
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);
}
}
}
}
}