25 lines
744 B
C#
25 lines
744 B
C#
|
|
using CommunityToolkit.Mvvm.Input;
|
|||
|
|
using System.Windows.Input;
|
|||
|
|
|
|||
|
|
namespace Plugin.Cowain.Wcs.ViewModels.ProcessGraph;
|
|||
|
|
|
|||
|
|
public class PendingConnectionViewModel
|
|||
|
|
{
|
|||
|
|
private readonly ProcessEditDialogViewModel _editor;
|
|||
|
|
private ConnectorViewModel? _source;
|
|||
|
|
|
|||
|
|
public PendingConnectionViewModel(ProcessEditDialogViewModel editor)
|
|||
|
|
{
|
|||
|
|
_editor = editor;
|
|||
|
|
StartCommand = new RelayCommand<ConnectorViewModel>(source => _source = source);
|
|||
|
|
FinishCommand = new RelayCommand<ConnectorViewModel>(target =>
|
|||
|
|
{
|
|||
|
|
if (target != null && _source != null)
|
|||
|
|
_editor.Connect(_source, target);
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public ICommand StartCommand { get; }
|
|||
|
|
public ICommand FinishCommand { get; }
|
|||
|
|
}
|