Closed LukeOrdelmans closed 1 year ago
Du you think the Name GetValueOnInstance is okay? Maybe something like GetConvertedValueOnInstance would be better? So it indicates that a conversion is done? Do we need a coresponding set method using a converter?
Agreed, GetConvertedValueOnInstance is more clear, I updated the PR. I think a corresponding set method is not required as the ValueOnInstance property is of type object, so it always will accept any assigned value/type directly.
thx
Added GetValueOnInstance<T>() on DesignItemProperty.cs implemented in XamlProperty.cs that uses the TypeConverter when available before doing a direct cast.
This allows users to replace properties on FrameworkElement deratives, e.g.
public new ScriptableThickness Margin { get; set; ]
as long as they provide a matching TypeConverter that can convert to the original type, Thickness in this case.