开发者

modal popup effect from silverlight usercontrol

I am playing around and trying to learn silverlight4. I have an existing asp.net page with and area of 600 * 400px available for my silverlight form.

My silverlight application has 2 usercontrols. The 1st usercontrol contains a listview of some data, when a user click开发者_运维百科s on a list item I display the 2nd usercontrol.

Is it possible from the 2nd usercontrol to call a clientside function within the page so I can have a similar effect as a modal popup?

Any help would be great!!!!


You should derive your second control from ChildWindow (and make a search on the web for examples of using ChildWindow). This control is designed to deliver this modal pattern you are after.


You can create the modal effect by overlaying the page with a div. Here is a tutorial for creating the modal DIV in the HTML/Javascript:

http://raventools.com/blog/2911/create-a-modal-dialog-using-css-and-javascript

Once you it set up, whenever you wish to trigger it, simply use the DOM interaction from Silverlight to fire the overlay:

Html.Window.Invoke("overlay");
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜