Here is an exa开发者_运维技巧mple:
<Grid x:Name="LayoutRoot">
<Control Value="{Binding Parent.Margins.Top, ElementName=LayoutRoot}"/>
</Grid>
I want to get type of the "Top" property to set correct value (null if it's nullable or "empty" parameter). How can I do this?
If you write an IValueConverter, and use that as the Converter for the Binding expression, then inside of the Convert/ConvertBack methods, you should get the value (typed as "object") and you can use GetType() on that to inspect it and decide how you want to act.
精彩评论