Validate Vector2Field changes via ConvertValue

This commit is contained in:
John Lewin 2017-09-14 13:27:48 -07:00
parent efc05d544e
commit 9df7cd414e

View file

@ -98,6 +98,12 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
this.Content = container;
}
protected override string ConvertValue(string newValue)
{
// Ensure we have a two value CSV or force to '0,0'
return (newValue?.Split(',').Length == 2) ? newValue.Trim() : "0,0";
}
protected override void OnValueChanged(FieldChangedEventArgs fieldChangedEventArgs)
{
string[] xyValueStrings2 = this.Value.Split(',');