mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-28 20:23:25 +08:00
mind
This commit is contained in:
27
AIStudio.Wpf.DiagramDesigner/Converters/AditionConverter.cs
Normal file
27
AIStudio.Wpf.DiagramDesigner/Converters/AditionConverter.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user