开发者

Passing user control object to another object as dependency property

My xaml is as follows:

<m:Map CredentialsProvider="XXX" x:Name="mainMap"/>
<BingEditableMapControl:BingMapEditingControl BingMap="mainMap" />

For BingEditableMapControl, the property BingMap is a dependency property takes the control of Map. 开发者_C百科How do i pass the mainMap to the BingMap property through xaml?


Try it like this:-

<m:Map CredentialsProvider="XXX" x:Name="mainMap"/>
<BingEditableMapControl:BingMapEditingControl BingMap="{Binding ElementName=mainMap}" />


Make mainMap a static resource and bind the BingMap property like this

BingMap={StaticResource mainMap}

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜