mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-17 23:16:41 +08:00
28 lines
752 B
C#
28 lines
752 B
C#
using System;
|
|
using System.Globalization;
|
|
using System.Windows.Data;
|
|
|
|
namespace AIStudio.Wpf.DiagramDesigner
|
|
{
|
|
public class AdditionConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
if ((value != null) && (parameter != null))
|
|
{
|
|
var firstValue = (double)value;
|
|
var secondValue = double.Parse(parameter?.ToString());
|
|
|
|
return firstValue + secondValue;
|
|
}
|
|
|
|
return 0d;
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
}
|