using Aitex.Core.UI.MVVM;
using Aitex.Core.Util;
using Aitex.Sorter.Common;
using Aitex.Sorter.UI.Controls.Common;
using MECF.Framework.Common.OperationCenter;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using MECF.Framework.Common.Equipment;
using System.Globalization;
namespace Aitex.Sorter.UI.Controls
{
///
/// RobotControl.xaml 的交互逻辑
///
public partial class RobotControlII : ViewModelControl
{
public Dictionary TargetII
{
get { return (Dictionary)GetValue(TargetProperty); }
set { SetValue(TargetProperty, value); }
}
// Using a DependencyProperty as the backing store for Target. This enables animation, styling, binding, etc...
public static readonly DependencyProperty TargetProperty =
DependencyProperty.Register("TargetII", typeof(Dictionary), typeof(RobotControlII), new PropertyMetadata(null));
public bool EnableHighSpeed
{
get { return (bool)GetValue(EnableHighSpeedProperty); }
set { SetValue(EnableHighSpeedProperty, value); }
}
// Using a DependencyProperty as the backing store for Target. This enables animation, styling, binding, etc...
public static readonly DependencyProperty EnableHighSpeedProperty =
DependencyProperty.Register("EnableHighSpeed", typeof(bool), typeof(RobotControl), new PropertyMetadata(null));
public RobotControlII()
{
InitializeComponent();
OperationCommand = new DelegateCommand(Operation, x => !IsMaintenanceMode && !IsAutoMode);
Command = new DelegateCommand(DoCommand, x => !IsMaintenanceMode && !IsAutoMode);
SetSpeedCommand = new DelegateCommand(Operation, CanSetSpeed);
var hands = new List();
hands.Add(Hand.Blade1);
hands.Add(Hand.Blade2);
Hands = hands.ToArray();
EnableHighSpeed = true;
root.DataContext = this;
}
private bool CanSetSpeed(DependencyObject sender)
{
var command = CommandHelper.GetCommandItem(sender);
var lstParameter = new List