using PLCSharp.Core.Prism;
using Prism.Commands;
using Prism.Dialogs;
using Prism.Events;
using Prism.Ioc;
using System.Windows.Controls;
namespace PLCSharp.VVMs.Robots
{
///
/// Robots视图模型
///
public class RobotsViewModel : DialogAwareBase
{
///
/// Robots视图模型
///
public RobotsViewModel(IContainerExtension container, IEventAggregator ea, IDialogService dialogService) : base(container, ea, dialogService)
{
RobotModel = container.Resolve();
}
///
/// 机器人模型
///
public RobotModel RobotModel { get; set; }
///
/// 打开对话框后要执行的
///
/// parameters
public override void OnDialogOpened(IDialogParameters parameters)
{
}
///
/// 关闭对话框后要执行的
///
public override void OnDialogClosed()
{
}
#region Robot Point CRUD
private Robot _SelectedRobot;
///
/// Selected机器人
///
public Robot SelectedRobot
{
get { return _SelectedRobot; }
set
{
SetProperty(ref _SelectedRobot, value);
switch (_SelectedRobot.Type)
{
case RobotType.Undefined:
break;
case RobotType.Epson:
RobotPointsConfig = new Epson.RobotPointsConfig
{
DataContext = this
};
break;
default:
break;
}
}
}
private DelegateCommand