However this is not recommended as it will drastically slowdown your Silverlight application. Well, there is no point in using a slow Silverlight application.
If you have realized the limitations by now, lets work on the workaround. I have an application called ittiGator( a facebook game http://apps.facebook.com/ittigator ) where we are prompting with a publish dialog on completing the game.
What we will do is, we will create two DIVs sitting one top of other. We will host our Silverlight in one and publish button in other.
DIV – Publish button with some background. |
DIV – Silverlight Content |
We will call a JavaScript method called publish from Silverlight usingDo you want to share your High Score with your friends?
HtmlPage.Window.Invoke("publishScore", new string[] { UserScore.Text, UserName.Text });In this publishscore method we will increase the height of ShowCase div to amount that is enough to push the plugin content just below the visible screen area.
function publishscore (score, usrname) { document.getElementById("Showcase").style.height = '800px'; }Reset the height on the publish dialog call back function
FB.Connect.streamPublish('', g_attachment, g_action_links, null, 'Post your high score and let the world follow you!', stream_callback_resizetheDiv);
This should work if you work with flash based application or even if you have an activex control embedded.
Leave a comment if you need any assistance in implementing this.
No comments:
Post a Comment