开发者

Silverlight 4 - downloading data into tooltip w/ Bing Maps

I'm adding a syndication (RSS) feed into a Bing maps application where the data is downloaded and populated on a mouse over event. The download is super fast but of course it has to be downloaded asynchronously meaning the user won't see the tooltip populated until the next time they mouse over that tool tip. I know that, for security reasons, I shouldn't necessarily be able to emulate a mouse-over event, but I know there are other things like this where there is a workaround (for example, if a user is logging in and enters their username and password - there's a workaround so that they can press 'ENTER' without the Login/Submit button having focus).

So first I'm wondering if there's a workaround and, if not...is there an eas开发者_如何学编程ier way to do this than emulating a synchronous download via coroutines (worth noting: MVVM can not be used here due to the way the nature of the model - Also, each pin has its own tool tip rather than a single custom tool tip where the position would be determined on mouse over via MapLayer.SetPosition)

Thanks!


figured it out - just attach a boolean property on the mouse enter event and to make sure the mouse is still over the element providing the tool tip - on mouse enter set the mouse leave bool to false and the tool tip's IsOpen property to false. When the download has completed - bind your DataContext to the object with relevant data (or however you want to go about this) then, if mouse leave bool is still equal to false, set the IsOpen property = true

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜