73 lines
2.0 KiB
C#
73 lines
2.0 KiB
C#
|
|
using Prism.Ioc;
|
|
using Prism.Services.Dialogs;
|
|
using SWS.CAD.ViewModels.myViewModelBase;
|
|
using SWS.CAD.Views;
|
|
using SWS.CAD.Views.CustomControl;
|
|
using SWS.Commons;
|
|
using System;
|
|
using System.Collections.ObjectModel;
|
|
using System.Windows;
|
|
using System.Windows.Input;
|
|
using Unity;
|
|
using DelegateCommand = Prism.Commands.DelegateCommand;
|
|
|
|
namespace SWS.CAD.ViewModels
|
|
{
|
|
public class DialogSignalPredistributionViewModel : DialogBase, IDialogAware
|
|
{
|
|
private string objectTypeId;
|
|
/// <summary>
|
|
/// 新建位号
|
|
/// </summary>
|
|
public ICommand Command_NewTagNumber { get; set; }
|
|
public DialogSignalPredistributionViewModel()
|
|
{
|
|
title = "电缆信号预分配";
|
|
}
|
|
public string Title => "";
|
|
|
|
public event Action<IDialogResult> RequestClose;
|
|
|
|
public bool CanCloseDialog()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public void OnDialogClosed()
|
|
{
|
|
|
|
}
|
|
|
|
|
|
public void OnDialogOpened(IDialogParameters parameters)
|
|
{
|
|
//listTags = parameters.GetValue<ObservableCollection<KeyValueModel>>(GlobalObject.dialogPar.info.ToString());
|
|
objectTypeId = parameters.GetValue<string>(GlobalObject.dialogPar.id.ToString());
|
|
}
|
|
public override void ExecuteOKCommandAsync(object para)
|
|
{
|
|
|
|
IDialogParameters res = new Prism.Services.Dialogs.DialogParameters();
|
|
//res.Add(GlobalObject.dialogPar.info.ToString(), TagNumber);
|
|
RequestClose.Invoke(new DialogResult(ButtonResult.Yes, res));
|
|
}
|
|
public override void ExecuteCloseCommand(object parameter)
|
|
{
|
|
if (parameter as string == "ClickNo")
|
|
{
|
|
DialogResult res = new DialogResult(ButtonResult.No);
|
|
RequestClose.Invoke(res);
|
|
}
|
|
else
|
|
{
|
|
RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
|
|
}
|
|
this.Dispose();
|
|
}
|
|
|
|
}
|
|
|
|
|
|
}
|