public override void UpdateEditor() { var value = GetValue(); PolarValue CPolarVal = (PolarValue)value; foreach (var item in Items) { if (item.Equals(CPolarVal.Val.ToString())) { Selector.SelectedItem = item; } } }
protected override ValidationResult Validate(object value) { ValidationResult ret = new ValidationResult(); PolarValue CPolarVal = new PolarValue(); string strValue = value.ToString(); if (Math.IsDoubleValid(strValue)) { ret.IsValid = true; CPolarVal.Val = System.Convert.ToDouble(strValue); ret.Value = CPolarVal; } else { ret.IsValid = false; } return(ret); }