|
@@ -16,7 +16,7 @@ using TextBox = System.Windows.Controls.TextBox;
|
|
|
|
|
|
namespace PRS.Shared
|
|
|
{
|
|
|
- public class DFAddTaskControl : DynamicFormFieldControl<DFLayoutAddTaskField, DFLayoutAddTaskFieldProperties, int?, int?>
|
|
|
+ public class DFAddTaskControl : DynamicFormFieldControl<DFLayoutAddTaskField, DFLayoutAddTaskFieldProperties, string?, string?>
|
|
|
{
|
|
|
private IntegerTextBox Number = null!; // Late-initialisation
|
|
|
private Button Button = null!; // Late-initialisation
|
|
@@ -62,24 +62,31 @@ namespace PRS.Shared
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public override int? GetSerializedValue()
|
|
|
+ public override string? GetSerializedValue()
|
|
|
{
|
|
|
return GetValue();
|
|
|
}
|
|
|
|
|
|
- public override void SetSerializedValue(int? value)
|
|
|
+ public override void SetSerializedValue(string? value)
|
|
|
{
|
|
|
SetValue(value);
|
|
|
}
|
|
|
|
|
|
- public override int? GetValue()
|
|
|
+ public override string? GetValue()
|
|
|
{
|
|
|
- return Number.Value.HasValue ? Convert.ToInt32(Number.Value.Value) : null;
|
|
|
+ return Number.Value?.ToString();
|
|
|
}
|
|
|
|
|
|
- public override void SetValue(int? value)
|
|
|
+ public override void SetValue(string? value)
|
|
|
{
|
|
|
- Number.Value = value;
|
|
|
+ if(int.TryParse(value, out var i))
|
|
|
+ {
|
|
|
+ Number.Value = i;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Number.Value = null;
|
|
|
+ }
|
|
|
Button.IsEnabled = FormDesignGrid.IsEditing && value == null;
|
|
|
}
|
|
|
|