Mar 5 2009

Mike Taulty: 44 Amazing Silverlight 2.0 Screencasts

Category: silverlight 2.0Bil@l @ 23:07

I was browsing online and found this valuable resource for Silverlight 2.0 by Mike Taulty:

Mike Taulty: 44 Amazing Silverlight 2.0 Screencasts

 

Hope this helps,
Regards

Tags:

Feb 20 2009

Microsoft® Silverlight™ Tools for Visual Studio 2008 SP1

Category: silverlight 2.0Bil@l @ 13:27

A new update has been published recently for the Silverlight 2.0.

Read more here: Silverlight 2 GDR1 Now Available...

 

Happy Silvering ;)

Regards

 

 

 

Tags:

Feb 20 2009

Silvelright 2.0 GDR1 Released

Category: silverlight 2.0Bil@l @ 13:27

A new update has been published recently for the Silverlight 2.0.

Read more here: Silverlight 2 GDR1 Now Available...

 

Happy Silvering ;)

Regards

 

 

 

Tags:

Feb 8 2009

How to Popup a Centered Window from inside Silverlight?

Category: silverlight 2.0Bil@l @ 18:48

You have always used JavaScript to pop up Windows from an ASP.NET or HTML page. Now the question comes to my mind, how to show a Popup Window from inside Silverlight territories.

It is so simple! Silverlight contains a class, System.Windows.Browser.HtmlPage, that allows access to the Browser's Document Object Model. It has a method called PopupWindow, that allows a Silverlight developer to open a Popup Window from inside Silverlight.

A sample code can help understand this better:

            HtmlPopupWindowOptions options =
                new HtmlPopupWindowOptions();
            options.Directories = false;
            options.Toolbar = false;
            options.Status = false;
            options.Menubar = false;
            options.Location = false;
            options.Width = 400;
            options.Height = 400;
            options.Top = (Convert.ToInt32(HtmlPage.Window.Eval("screen.height")) - options.Height)/2;
            options.Left = (Convert.ToInt32(HtmlPage.Window.Eval("screen.width")) - options.Width) / 2;
            HtmlPage.PopupWindow(new Uri("http://www.silverlight.net"), "_blank", options);

 

Notice the bolded words above. The HtmlPopupWindowOptions class allows you to set options for the Window that is to be opened. For example, show/hide the Toolbar, Menubar, etc ...

The HtmlPage.PopupWindow is the method that you can use to show the Popped up Window. It takes as input, a URI representing the URL to open, the target of the Popup Window and finally an instance of the HtmlPopupWindowOptions.

Notice how I used the HtmlPage.Window.Eval method to evaluate ANY JAVASCRIPT code you want. In this case, I wanted to grab the "Screen.Width" and "Screen.Height" to use them to center the Popped up Window.

That's it. Now you have a Centered Popup Window triggered from inside Silverlight application.

Hope this helps,
Regards

 

Tags:

Feb 2 2009

How to center the Silveright application inside the ASPX page

Category: silverlight 2.0Bil@l @ 21:29

A very simple CSS trick to center the Silverlight application, check the following:

<%@ Page Language="C#" AutoEventWireup="true" %>

<%@ Register Assembly="System.Web.Silverlight" Namespace="System.Web.UI.SilverlightControls"
    TagPrefix="asp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" style="height:100%;">
<head runat="server">
    <title>SilverlightDataGrid</title>
    <style type= "text/css">
        body { text-align: center; }
        div#container { margin-left: auto; margin-right: auto; width: 50em; }
    </style>

</head>
<body style="height:100%;margin:0;">
    <form id="form1" runat="server" style="height:100%;">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <div id="container" style="height:100%;">
            <asp:Silverlight ID="Xaml1" runat="server" Source="~/ClientBin/SilverlightDataGrid.xap" MinimumVersion="2.0.31005.0" Width="100%" Height="100%" />
        </div>
    </form>
</body>
</html>

 Notice the bolded sections above. This is enough to center your application in the middle of the ASPX page.

 

Hope this helps,
Regards

Tags:

Oct 16 2008

Silverlight 2.0 Released!

Category: silverlight 2.0Bil@l @ 12:21

Silverlight 2 is now released officially.

Check Scott's post here for more information: Silverlight 2 Released

 

Regards

Tags:

Sep 29 2008

Silverlight 2 Release Candidate Now Available

Category: silverlight 2.0Bil@l @ 15:37

It is great to inform you that Silverlight 2 RC is now released for public.

You can read more about it here with this great post of Scott Guthrie: http://weblogs.asp.net/scottgu/archive/2008/09/25/silverlight-2-release-candidate-now-available.aspx

 

Happy Silverlighting :)

Regards

Tags: