File: ConstraintDesignTypeConverter.cs
Web Access
Project: src\src\Controls\src\Core.Design\Controls.Core.Design.csproj (Microsoft.Maui.Controls.DesignTools)
using System.ComponentModel;
using System.Globalization;
 
namespace Microsoft.Maui.Controls.Design
{
	public class ConstraintDesignTypeConverter : StringConverter
	{
		public override bool IsValid(ITypeDescriptorContext context, object value)
		{
			// MUST MATCH ConstraintTypeConverter.ConvertFrom
			var strValue = value?.ToString();
			return (strValue != null && double.TryParse(strValue, NumberStyles.Number, CultureInfo.InvariantCulture, out _));
		}
	}
}