using MaterialDesignThemes.Wpf;
using Prism.Commands;
using Prism.Events;
using Prism.Ioc;
using Prism.Mvvm;
using Prism.Regions;
using Prism.Services.Dialogs;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Windows;
using Team.FFFeederService.Interfaces;
using Team.FFFeederService.Models;
using Team.FFFeederService;
using TeamAAS_VP.Controls;
using TeamAAS_VP.Enums;
using TeamAAS_VP.Events;
using TeamAAS_VP.Core;
using TeamAAS_VP.Models;
using TeamAAS_VP.Views.Product;
using TeamAAS_VP;
using Cognex.VisionPro.ToolBlock;
namespace TeamAAS_VP.ViewModels.Product
{
public class ProcedureVisionOutputViewModel : BindableBase
{
IRegionManager _regionManager;
IEventAggregator _eventAggregator;
IContainerProvider _container;
IDialogService _dialogService;
ProductsViewModel productsViewModel;
#region 属性
private ProductModel _SelectProduct;
///
/// 选中的产品
///
public ProductModel SelectProduct
{
get { return _SelectProduct; }
set { SetProperty(ref _SelectProduct, value); }
}
private ProcedureModel _SelectProcedure;
///
/// 选中的流程
///
public ProcedureModel SelectProcedure
{
get { return _SelectProcedure; }
set { SetProperty(ref _SelectProcedure, value); }
}
private ObservableCollection _Outputs;
///
/// VM流程输出集合
///
public ObservableCollection Outputs
{
get { return _Outputs; }
set { SetProperty(ref _Outputs, value); }
}
private ProcedureOutput _SelectOutput;
///
/// 选中的流程输出
///
public ProcedureOutput SelectOutput
{
get { return _SelectOutput; }
set { SetProperty(ref _SelectOutput, value); }
}
private ProcedureOutputOpcAdr _SelectAdrOutput;
///
/// 选中的流程输出
///
public ProcedureOutputOpcAdr SelectAdrOutput
{
get { return _SelectAdrOutput; }
set { SetProperty(ref _SelectAdrOutput, value); }
}
private ProcedureOutput _SelectOutput1;
///
/// 选中的流程输出
///
public ProcedureOutput SelectOutput1
{
get { return _SelectOutput1; }
set { SetProperty(ref _SelectOutput1, value); }
}
public Management management { get; set; }
#endregion
#region 命令
private DelegateCommand _NextCommand;
public DelegateCommand NextCommand =>
_NextCommand ?? (_NextCommand = new DelegateCommand(ExecuteNextCommand));
private DelegateCommand _BackCommand;
public DelegateCommand BackCommand =>
_BackCommand ?? (_BackCommand = new DelegateCommand(ExecuteBackCommand));
private DelegateCommand _LoadedCommand;
public DelegateCommand LoadedCommand =>
_LoadedCommand ?? (_LoadedCommand = new DelegateCommand(ExecuteLoadedCommand));
private DelegateCommand _AddOutputCommand;
public DelegateCommand AddOutputCommand =>
_AddOutputCommand ?? (_AddOutputCommand = new DelegateCommand(ExecuteAddOutputCommand, () => { return SelectOutput != null ? true : false; }).ObservesProperty(()=> SelectOutput));
private DelegateCommand _AddOpcOutputCommand;
public DelegateCommand AddOpcOutputCommand =>
_AddOpcOutputCommand ?? (_AddOpcOutputCommand = new DelegateCommand(ExecuteAddAdrOutputCommand));
private DelegateCommand