port from perforce
This commit is contained in:
40
intromat/Intromat/ViewModels/CodeGenInputViewModel.cs
Normal file
40
intromat/Intromat/ViewModels/CodeGenInputViewModel.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using NodeNetwork.Toolkit.ValueNode;
|
||||
using NodeNetwork.ViewModels;
|
||||
using NodeNetwork.Views;
|
||||
using ReactiveUI;
|
||||
using Splat;
|
||||
|
||||
namespace Intromat.ViewModels
|
||||
{
|
||||
public class CodeGenInputViewModel<T> : ValueNodeInputViewModel<T>
|
||||
{
|
||||
private bool _isMouseOver;
|
||||
|
||||
static CodeGenInputViewModel()
|
||||
{
|
||||
Locator.CurrentMutable.Register(() => new NodeInputView(), typeof(IViewFor<CodeGenInputViewModel<T>>));
|
||||
}
|
||||
|
||||
public CodeGenInputViewModel(EPortType type)
|
||||
{
|
||||
var port = new CodeGenPortViewModel { PortType = type };
|
||||
Port = port;
|
||||
|
||||
if (type == EPortType.Execution)
|
||||
{
|
||||
port.IsPortVisible = true;
|
||||
PortPosition = PortPosition.Right;
|
||||
}
|
||||
else if (type == EPortType.Texture)
|
||||
{
|
||||
port.IsPortVisible = true;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsMouseOver
|
||||
{
|
||||
get => _isMouseOver;
|
||||
set => this.RaiseAndSetIfChanged(ref _isMouseOver, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user