mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-02 15:16:37 +08:00
block
This commit is contained in:
39
AIStudio.Wpf.DiagramDesigner/Models/Values/ConstParameter.cs
Normal file
39
AIStudio.Wpf.DiagramDesigner/Models/Values/ConstParameter.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using AIStudio.Wpf.DiagramDesigner;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
public class ConstParameter : BindableBase, IParameter
|
||||
{
|
||||
private object _value;
|
||||
|
||||
public object Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return _value;
|
||||
}
|
||||
set
|
||||
{
|
||||
SetProperty(ref _value, value);
|
||||
}
|
||||
}
|
||||
|
||||
public void Add(object value)
|
||||
{
|
||||
if (double.TryParse(Value?.ToString() ?? "", out var value1) && double.TryParse(value?.ToString() ?? "", out var value2))
|
||||
{
|
||||
Value = value1 + value2;
|
||||
}
|
||||
else
|
||||
{
|
||||
Value = $"{Value}{value}";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user