开发者

How can I get source property which is binded in Silverlight 4?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜