using AutoMapper;
using CapMachine.Core;
using CapMachine.Model;
using CapMachine.Wpf.Dtos;
using CapMachine.Wpf.Services;
using Masuit.Tools;
using Prism.Commands;
using Prism.Services.Dialogs;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace CapMachine.Wpf.ViewModels
{
///
/// 逻辑规则配置的弹窗
///
public class DialogLogicRuleViewModel : DialogViewModel
{
public DialogLogicRuleViewModel(IFreeSql freeSql, IMapper mapper, LogicRuleService logicRuleService)
{
Title = "逻辑规则创建";
FreeSql = freeSql;
Mapper = mapper;
LogicRuleService = logicRuleService;
//var Data = Mapper.Map>(LogicRuleService.LogicRuleDtos);
ListLogicRuleDto = LogicRuleService.LogicRuleDtos;
}
public IFreeSql FreeSql { get; }
public IMapper Mapper { get; }
public LogicRuleService LogicRuleService { get; }
private ObservableCollection _ListLogicRuleDto;
///
/// 数据集合
///
public ObservableCollection ListLogicRuleDto
{
get { return _ListLogicRuleDto; }
set { _ListLogicRuleDto = value; RaisePropertyChanged(); }
}
private LogicRuleDto _selectedRule=new LogicRuleDto();
///
/// 当前选中的规则
///
public LogicRuleDto SelectedRule
{
get { return _selectedRule; }
set { _selectedRule = value; RaisePropertyChanged(); }
}
///
/// 选中更改之前的LogicRuleDto
///
public LogicRuleDto SelectedRuleOld { get; set; }
private DelegateCommand