Measurements of units were added
This commit is contained in:
@@ -14,6 +14,8 @@ namespace StructureHelper.Infrastructure.UI.Converters.Units
|
||||
|
||||
public override string unitName { get => "Force"; }
|
||||
|
||||
public override string MeasureUnit => throw new NotImplementedException();
|
||||
|
||||
public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
double val;
|
||||
@@ -26,12 +28,15 @@ namespace StructureHelper.Infrastructure.UI.Converters.Units
|
||||
public override object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
double val;
|
||||
if (value != null)
|
||||
try
|
||||
{
|
||||
var strVal = value as string;
|
||||
double.TryParse(strVal, out val);
|
||||
val = CommonOperation.ConvertToDoubleChangeComma(strVal);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else { throw new Exception($"{unitName} value is null"); }
|
||||
val /= coeffficient;
|
||||
return val;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user