<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2921258475179998176</id><updated>2011-07-30T10:19:19.042-07:00</updated><category term='silverlight transformations'/><category term='consuming silverlight web service'/><category term='xaml'/><category term='simple calculator in silverlight'/><category term='creating silverlight application'/><category term='silverlight tools'/><category term='silverlight media player'/><category term='consuming webservices'/><category term='Language Integrated Query'/><category term='silverlight web service'/><category term='silverlight media control skins'/><category term='silverlight geometry'/><category term='silverlight graphics'/><category term='silverlight architecture'/><category term='microsoft silverlight tutorial'/><category term='Visual Studio 2008'/><category term='ajax.net'/><category term='silverlight languages'/><category term='silverlight path'/><category term='rectangle'/><category term='Silverlight Bouncing Ball'/><category term='silverlight rectangle'/><category term='drawing line in silverlight'/><category term='Configure Visual Studio 2008'/><category term='Silverlight Skins'/><category term='professional calculator'/><category term='silverlight tutorial'/><category term='silverlight with ajax'/><category term='drawing ellipse in silverlight'/><category term='silverlight transformation'/><category term='silverlight media control'/><category term='Silverlight Chapters'/><category term='LINQ'/><category term='integrating ajax with silverlight'/><category term='silverlight'/><category term='drawing rectangle'/><category term='webservices'/><category term='ajax'/><category term='Data Access in SIlverlight'/><category term='silverlight versions'/><category term='Silverlight Video'/><category term='Expression Media Encoder'/><category term='transformation'/><category term='silverlight professional calculator'/><category term='silverlight framework'/><category term='silverlight media'/><category term='consuming webservices from silverlight'/><category term='silverlight media player events'/><category term='microsoft silverlight'/><category term='silverlight drawing'/><category term='creating silverlight web service'/><category term='wpf'/><category term='silverlight brushes'/><category term='asp.net'/><category term='silverlight calculator'/><category term='integrating silverlight with ajax'/><category term='silverlight animation'/><category term='drawing in silverlight'/><category term='Data access'/><category term='animation in silverlight'/><category term='Serialization'/><category term='transformations'/><title type='text'>Silverlight and DotNet</title><subtitle type='html'>A complete step by step tutorial for dotnet and silverlight.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>44</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-7594757890990233265</id><published>2009-05-24T02:07:00.000-07:00</published><updated>2009-05-24T02:14:25.976-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='creating silverlight application'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight tutorial'/><title type='text'>Create the Silverlight Application</title><content type='html'>Now that we have checked that the web service is functioning correctly, it is ready to be called by a Silverlight application. Now our next step is to create the silverlight application that will consume the web service created by us just now. The application created by me to test the web method is shown below-&lt;br /&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5339316058762599554" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 371px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_ww9l4AwRrmg/ShkPqqIVXII/AAAAAAAAARM/297D6NENJaQ/s400/SilverlightApplication.JPG" border="0" /&gt;&lt;br /&gt;The code for the above silverlight application is shown below-&lt;br /&gt;&amp;lt;Canvas&lt;br /&gt;xmlns="http://schemas.microsoft.com/client/2007"&lt;br /&gt;xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&lt;br /&gt;xmlns:c1="clr-namespace:C1.Silverlight;assembly=ClientBin/C1.Silverlight.dll"&lt;br /&gt;x:Name="parentCanvas"&lt;br /&gt;Loaded="Page_Loaded"&lt;br /&gt;x:Class="Greeter.Page;assembly=ClientBin/Greeter.dll"&lt;br /&gt;Width="800"&lt;br /&gt;Height="800"&lt;br /&gt;&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;Canvas.Background&amp;gt;&lt;br /&gt;&amp;lt;LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5" SpreadMethod="Pad"&amp;gt;&lt;br /&gt;&amp;lt;GradientStop Color="#FFD2CBD2" Offset="0"/&amp;gt;&lt;br /&gt;&amp;lt;GradientStop Color="#FF4D1E4C" Offset="1"/&amp;gt;&lt;br /&gt;&amp;lt;/LinearGradientBrush&amp;gt;&lt;br /&gt;&amp;lt;/Canvas.Background&amp;gt;&lt;br /&gt;&amp;lt;TextBlock Width="142" Height="20" Canvas.Left="10" Canvas.Top="26"&amp;gt;&lt;br /&gt;&amp;lt;Run FontFamily="Segoe UI" FontSize="12" Foreground="#FF1E2576" Text="Enter Name:"/&amp;gt;&lt;br /&gt;&amp;lt;/TextBlock&amp;gt;&lt;br /&gt;&amp;lt;c1:TextBox Canvas.Top="25" Canvas.Left="90" Width="200" x:Name="txtName" /&amp;gt;&lt;br /&gt;&amp;lt;c1:Button AutoWidth="False" Width="100" Canvas.Top="25" Canvas.Left="292" Text="Greet Me" Click="GetGreeting"/&amp;gt;&lt;br /&gt;&amp;lt;TextBlock x:Name="tbGreeting" Width="506" Height="68" Canvas.Left="10" Canvas.Top="50" TextWrapping="Wrap"&amp;gt;&lt;br /&gt;&amp;lt;Run Text="" FontFamily="Segoe UI" FontSize="12" Foreground="#FF330909"/&amp;gt;&lt;br /&gt;&amp;lt;/TextBlock&amp;gt;&lt;br /&gt;&amp;lt;/Canvas&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-7594757890990233265?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/7594757890990233265/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=7594757890990233265' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/7594757890990233265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/7594757890990233265'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2009/05/create-silverlight-application.html' title='Create the Silverlight Application'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_ww9l4AwRrmg/ShkPqqIVXII/AAAAAAAAARM/297D6NENJaQ/s72-c/SilverlightApplication.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-1586969566883661382</id><published>2009-05-18T12:36:00.000-07:00</published><updated>2009-05-18T12:50:22.046-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight web service'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Configure Visual Studio 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='creating silverlight web service'/><title type='text'>Configuring Visual Studio 2008</title><content type='html'>Several additions are provided by the ASP.NET future extensions for use in ASP.NEY Ajax and Silverlight. One of these additions is the ability to create an ASP.Net future website in Visual Studio 2008. Asp.Net Future Website is idea to test the asp.net web services from a silverlight application.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;div&gt;&lt;p&gt;&lt;strong&gt;Creating the Web Service &lt;/strong&gt;&lt;br /&gt;For configuring a Web service for calls from a Silverlight application and testing those calls, the first step is to create an Asp.Net Future website. The figure below shows the New Website dialog box:&lt;/p&gt;&lt;img id="BLOGGER_PHOTO_ID_5337252289903260610" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 262px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_ww9l4AwRrmg/ShG6rgBS88I/AAAAAAAAAQc/LHi5sovXgkw/s400/NewWebsiteDialogBox.JPG" border="0" /&gt; &lt;p&gt;Similar to earlier Asp.Net, when a new Asp.Net website is created, a Default.aspx page is created. The difference here is that this Default.aspx page already includes a &amp;lt;ScriptManager&amp;gt;element ready to work with Ajax. The next step here is to add a new Asp.Net Web Service to the project which can be added through the Add New Item dialog box, which is shown below:&lt;br /&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5337252665100908706" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 248px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_ww9l4AwRrmg/ShG7BVvYuKI/AAAAAAAAAQs/EskS8ejDMbM/s400/AddNewItemDialogBox.JPG" border="0" /&gt;&lt;br /&gt;When we create a new web service by using Asp.Net 2.0 or higher version, the code behind file of the Web Service is placed in the App_Code folder in the solution. The attribute to direct the new web service to transport data by using JSON is already given in this code behind file, which is commented by default. All we have to do to direct the new Web service to transport data by using JSON, is to uncomment the [System.Web.Script.Services.ScriptService] attribute at the top of the Web service code behind file. Next, we have to create one or more methods in the Web service class that can be called. The code to do a simple greeting is shown below:&lt;br /&gt;&lt;br /&gt;[WebMethod]&lt;br /&gt;public string Greet(string name) {&lt;br /&gt;return "Hey, " + name + ", how's it going?";&lt;br /&gt;}&lt;br /&gt;Test this Web service to ensure that it is functioning as it is intended to do. &lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-1586969566883661382?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/1586969566883661382/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=1586969566883661382' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/1586969566883661382'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/1586969566883661382'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2009/05/configuring-visual-studio-2008.html' title='Configuring Visual Studio 2008'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_ww9l4AwRrmg/ShG6rgBS88I/AAAAAAAAAQc/LHi5sovXgkw/s72-c/NewWebsiteDialogBox.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-2056778429481331342</id><published>2009-05-16T10:09:00.000-07:00</published><updated>2009-05-16T10:15:52.582-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight web service'/><category scheme='http://www.blogger.com/atom/ns#' term='consuming webservices from silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='consuming silverlight web service'/><title type='text'>Consuming a Web Service From Silverlight</title><content type='html'>What do we mean by consuming a web service? When a client's machine calls a method of the web service, it is said to consume the web service. In the current version of silverlight, there are some limitations to consuming a web service. The current version of silverlight, that is, Silverlight 2.0 supports the consumption of only that web service, that is hosted on the same web server, as the server as the Silverlight application that is consuming it. In order to consume a Web service that is not hosted on the same Web server, its required to make a call to a different domain or we can say, its required to make a cross-domain call. But due to security concerns, Silverlight 2.0 does not support cross domain calls. However, cross domain cals might be supported in future version of Silverlight.&lt;br /&gt;&lt;br /&gt;There are several ways in which web service can be consumed by a silverlight 2.0 application-&lt;br /&gt;&lt;br /&gt;• By configuring a call to a Web service method programmatically, and passing standard, well-formed, XML that does not follow to the SOAP schema by including a SOAP envelope or wrapper. The XML that is passed to a web service in this manner is called Plain Old XML (POX). To place a call to a Web method, System.Net.BrowserHttpWebRequest class is used and to capture the response,System.Net.HttpWebResponse class is used. Calling a Web method by using POX is fairly easy, and this call can a synchronous call or an asynchronous call. However, calling a Web method in this manner,programmatically, it is difficult to test by using the built-in Web server in Visual Studio 2008.&lt;br /&gt;&lt;br /&gt;• By making a call to the web service, by passing data formatted in JavaScript Object Notation (JSON). JSON is an industry-standard data exchange format which is compact and ideal for both ASP.NET AJAX applications as well as Silverlight applications. As mentioned earlier, by default, ASP.NET Web services transport data with the help of SOAP, an extended XML grammar. However, it's fairly very easy to direct an ASP.NET Web service to transport data using JSON. The ASP.NET AJAX extensions, now incorporated into the .NET Framework, provide a new attribute called the System.Web.Script.Services.ScriptServiceAttribute attribute, which can be applied to a Web service class to direct the ASP.NET Web service to transport data using JSON. Any ASP.NET Web service that is to be called from JavaScript in an ASP.NET AJAX or code in a Silverlight application must be marked up using the ScriptService attribute. Configuring an ASP.NET Web service to be called by a Silverlight application will be explained in the next section.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-2056778429481331342?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/2056778429481331342/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=2056778429481331342' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/2056778429481331342'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/2056778429481331342'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2009/05/consuming-web-service-from-silverlight.html' title='Consuming a Web Service From Silverlight'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-8720613931424762815</id><published>2009-05-09T08:39:00.000-07:00</published><updated>2009-05-09T08:42:01.416-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='consuming webservices'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='webservices'/><title type='text'>Consuming Web Services</title><content type='html'>One of the primary functions of an ASP.NET application is the ability to interact with a Web server. In a standard ASP.NET application, each page refresh causes a postback to the server and, thus, interaction the occurs. In an ASP.NET AJAX application, interaction with the server is minimized however postbacks to the server still occur. In either case, interaction with a Web server can be optimized with the help of making calls to a Web service. In a Silverlight application, once the application is downloaded into the client's machine, interaction with the server does not occur unless a call is initiated at the client. The most common method to interact with a Web server using a Silverlight application is to make a call to a Web service.&lt;br /&gt; What is web service? A Web service is a component, similar to an object with methods or a procedure file, that si capable of being called over the web by using web protocols. A webservice functions in the same way as a procedure file or object with methods does. Like an object with methods or a procedure file is called from code to provide a service or benefit to the calling code, a web service also benefits to the calling application.Code that has the access to the Web service calls the Web service in order to provide some type of additional functionality. For communication, the protocol that is used by web service is the HTTP protocol and an XML grammar called the Simple Object Access Protocol (SOAP) by default, to transport data. Just as any client with a Web browser can view any Web page(using the web standards), similarly any programming language that is capable of working with open Web standards can call a Web service. And a benifit that web services have with using HTTP as a communication protocol, is that the web services are generally accessible through firewalls.&lt;br /&gt; Similar to most of the popular web techonologies, web services include many additional technologies, that enhance and extend the basic functionality of the web services. In addition to that, the technologies that surrounds the Web services have been evolving at an astronomical rate and its been tough for the development environments to keep up with the supported technologies.  The supporting technologies that I am mentioning here include enhancements to security, ability to manage messages being sent to and from a Web service,ensure reliability, and the functionality for working with messages in transactions. &lt;br /&gt; Its extremely simple and straight forward to consume a Web service from a Silverlight application. However,a point to note is that Web services reside on a Web server, whereas Silverlight applications reside on a client workstation. Therefore testing communications between a Silverlight application and a Web service on a single machine can be a little tricky. The section below describes how to consume a web service and test the communication between Silverlight and web service.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-8720613931424762815?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/8720613931424762815/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=8720613931424762815' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/8720613931424762815'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/8720613931424762815'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2009/05/consuming-web-services.html' title='Consuming Web Services'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-1975797584321594552</id><published>2009-05-07T02:21:00.000-07:00</published><updated>2009-05-07T02:30:22.290-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight media player'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight media player events'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight media'/><title type='text'>Handling Media Player Events</title><content type='html'>Microsoft Silverlight plug-in includes a framework containing namespaces, classes, and functionalities that are used to interact with the media player and create applications. The class named "Sys.Preview.UI.Xaml.Media.Player" used to directly control the Silverlight media player. In Silverlight documentation, Classes are referred to as "Client Types". This makes sense as in object oriented terminology, a class is defined as representing a particular type of entity.&lt;br /&gt;The Player type is tightly coupled to the media player. XAML is used to define media player and its active skin. The XAML used to define the player skin must follow specific XML grammar so that the Player type can assume that particular elements exist within the player skin XAML. If the player skin XAML includes the correct elements,then its an easy task to identify functions to handle player events by using the asp:Media control. Function handlers can be identified easily either declaratively or through the designer by using Visual Studio 2008. The full markup of the page required along with the OnClientChapterStarted function handler defined is shown in the code below-&lt;br /&gt;&lt;br /&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %&amp;gt;&lt;br /&gt;&amp;lt;%@ Register Assembly="Microsoft.Web.Preview" Namespace="Microsoft.Web.Preview.UI.Controls" TagPrefix="asp" %&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;&lt;br /&gt;&amp;lt;head runat="server"&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;My Videos&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;script type="text/JavaScript"&amp;gt;&lt;br /&gt;function onChapterStarted(sender, chapterEventArgs)&lt;br /&gt;{&lt;br /&gt;var chapters = sender.get_chapters();&lt;br /&gt;var ci = chapterEventArgs.get_chapterIndex();&lt;br /&gt;var chapter = chapters[ci];&lt;br /&gt;Sys.Debug.trace("Chapter Info" + chapter.imageUrl + " " + chapter.title);&lt;br /&gt;}&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;form id="form1" runat="server"&amp;gt;&lt;br /&gt;&amp;lt;asp:ScriptManager ID="smCardinalVideos" runat="server"&amp;gt; &amp;lt;/asp:ScriptManager&amp;gt;&lt;br /&gt;&amp;lt;div&amp;gt;&lt;br /&gt;&amp;lt;asp:Media ID="MyCardVideo" AutoPlay="true" runat="server" Height="388px" MediaUrl="~/Videos/MyVideo.wmv" Width="512px" XamlUrl="~/CustomProfessional.xaml" OnClientChapterStarted="onChapterStarted"&amp;gt;&lt;br /&gt;&amp;lt;Chapters&amp;gt;&lt;br /&gt;&amp;lt;asp:MediaChapter Title="Start" TimeIndex="0.0" ImageUrl="~/Videos/Image1.jpg" /&amp;gt;&lt;br /&gt;&amp;lt;asp:MediaChapter Title="Reception" TimeIndex="6.6253847" ImageUrl="~/Videos/Image2.jpg" /&amp;gt;&lt;br /&gt;&amp;lt;asp:MediaChapter Title="Broken Tackle" TimeIndex="10.5280086" ImageUrl="~/Videos/Image2.jpg" /&amp;gt;&lt;br /&gt;&amp;lt;asp:MediaChapter Title="End Zone" TimeIndex="13.1600108" ImageUrl="~/Videos/Image3.jpg" /&amp;gt;&lt;br /&gt;&amp;lt;asp:MediaChapter Title="Replay" TimeIndex="17.3349108" ImageUrl="~/Videos/Image4.jpg" /&amp;gt;&lt;br /&gt;&amp;lt;asp:MediaChapter Title="Celebration" TimeIndex="55.1768291" ImageUrl="~/Videos/Image5.jpg" /&amp;gt;&lt;br /&gt;&amp;lt;asp:MediaChapter Title="End" TimeIndex="71.2455760" ImageUrl="~/Videos/Image6.jpg" /&amp;gt;&lt;br /&gt;&amp;lt;/Chapters&amp;gt;&lt;br /&gt;&amp;lt;/asp:Media&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;br /&gt;The resulting Output window of Visual Studio 2008 is shown in the figure below-&lt;br /&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5333011300346232562" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 121px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_ww9l4AwRrmg/SgKphaxH_vI/AAAAAAAAAPk/LIuqhzXIbLI/s400/OutputWindow.JPG" border="0" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-1975797584321594552?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/1975797584321594552/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=1975797584321594552' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/1975797584321594552'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/1975797584321594552'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2009/05/handling-media-player-events.html' title='Handling Media Player Events'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_ww9l4AwRrmg/SgKphaxH_vI/AAAAAAAAAPk/LIuqhzXIbLI/s72-c/OutputWindow.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-1836004729106964824</id><published>2009-05-05T10:58:00.000-07:00</published><updated>2009-05-05T11:06:27.902-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight Skins'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight media control skins'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight media control'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight media'/><title type='text'>Skins</title><content type='html'>Skins are used to change the appearance of the media player. The asp:Media control includes several built-in skins. The built-in skin of the media player can easily be changed using Visual Studio 2008 either declaratively in the markup with the help of intellisense or visually in the designer. We can also provide a custom skin for the media player by creating a custom XAML file and referencing the XAML file through the XamlUrl attribute of the asp:Media control.&lt;br /&gt;&lt;p&gt;An easier method of creating custom player skins is to export an existing skin and modify it. To export and modify a skin using Visual Studio 2008, use the asp:Media control smart tag menu in design view and select Configure Skin. The Configure Player Skin offers options to select or export a built-in skin, and select a custom skin. Just select the skin to be exported and then click the Export button. Modify the skin XAML and then select this modified XAML as a custom skin. For example, in the figure below, the Professional skin exported and modified to add some orange highlights, and then selected as the active skin.&lt;/p&gt;&lt;img id="BLOGGER_PHOTO_ID_5332401562857839282" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 259px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_ww9l4AwRrmg/SgB--BnhGrI/AAAAAAAAAO0/H1XBGQ_egd8/s400/MediaPlayerSkin.JPG" border="0" /&gt; &lt;div&gt;More interesting features of Silverlight Media Control still to come. &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-1836004729106964824?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/1836004729106964824/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=1836004729106964824' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/1836004729106964824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/1836004729106964824'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2009/05/skins.html' title='Skins'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_ww9l4AwRrmg/SgB--BnhGrI/AAAAAAAAAO0/H1XBGQ_egd8/s72-c/MediaPlayerSkin.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-6072464865428040751</id><published>2009-04-26T10:28:00.000-07:00</published><updated>2009-04-26T10:50:26.668-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight media control'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight tutorial'/><title type='text'>The asp:Media Control</title><content type='html'>The asp:Media control includes functionality to navigate through defined markers, or chapters, in encoded media. The asp:Media control includes a child element named &amp;lt;Chapters&amp;gt; , this element is used to define the chapters in the encoded media. This &amp;lt;Chapters&amp;gt; element in turn, contains a series of &amp;lt;asp:MediaChapter&amp;gt; elements that correlate to each chapter in the media. Each of the elements of &amp;lt;asp:MediaChapter&amp;gt; may contain three attributes-Title: defines the title of a chapter and is displayed by the media player to identify the chapter.TimeIndex: defines the location in the encoded media where the chapter begins.ImageUrl: identifies an image being displayed by the media player to visually identify the chapter. There are many ways to provide values for each of these attributes. The easiest method among them is by using the marker definitions in EME. However the value of the TimeIndex attribute should be represented such that it can be converted to a double numeric value, hence it might be necessary to convert values from EME to asp:Media. For example, as shown in the code below, the marker at the end of the media is shown at 1.11.2455760 in EME whereas it must be converted to the actual number of minutes in the TimeIndex attribute as 71.2455760. The resulting asp:Media element definition is shown below-&amp;lt;asp:Media ID="myCardVideo" AutoPlay="true" runat="server" Height="240px" MediaSkin="Professional" MediaUrl="SteveBreastonCardinalsPuntReturn.wmv" Width="320px"&amp;gt; &amp;lt;Chapters&amp;gt; &amp;lt;asp:MediaChapter Title="Start" TimeIndex="0.0" ImageUrl="~/Images/Image1.jpg" /&amp;gt; &amp;lt;asp:MediaChapter Title="Reception" TimeIndex="6.6253847" ImageUrl="~/Images/Image2.jpg" /&amp;gt; &amp;lt;asp:MediaChapter Title="Broken Tackle" TimeIndex="10.5280086" ImageUrl="~/EMEOutput/SteveBreastonCardinalsPuntReturn_MarkerThumb 00.00.10.5280086.jpg" /&amp;gt; &amp;lt;asp:MediaChapter Title="End Zone" TimeIndex="13.1600108" ImageUrl="~/EMEOutput/SteveBreastonCardinalsPuntReturn_MarkerThumb 00.00.13.1600108.jpg" /&amp;gt; &amp;lt;asp:MediaChapter Title="Replay" TimeIndex="17.3349108" ImageUrl="~/EMEOutput/SteveBreastonCardinalsPuntReturn_MarkerThumb 00.00.17.3349108.jpg" /&amp;gt; &amp;lt;asp:MediaChapter Title="Celebration" TimeIndex="55.1768291" ImageUrl="~/EMEOutput/SteveBreastonCardinalsPuntReturn_MarkerThumb 00.00.55.1768291.jpg" /&amp;gt; &amp;lt;asp:MediaChapter Title="End" TimeIndex="71.2455760" ImageUrl="~/EMEOutput/SteveBreastonCardinalsPuntReturn_MarkerThumb 00.01.11.2455760.jpg" /&amp;gt; &amp;lt;/Chapters&amp;gt; &amp;lt;/asp:Media&amp;gt;&lt;br /&gt;&lt;br /&gt;Once the chapters are defined Silverlight media player is capable of navigating the chapters in the encoded media. To navigate the chapters, hover the mouse over the bottom of the player and the chapter images will be displayed. Now, clicking one of the chapter images, the media jumps to that chapter. The resulting player is shown in the image below-&lt;br /&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5329057038226876242" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 250px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_ww9l4AwRrmg/SfSdJEdO51I/AAAAAAAAAOs/zdOHFSHy810/s400/SilverlightMediaControl.JPG" border="0" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-6072464865428040751?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/6072464865428040751/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=6072464865428040751' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/6072464865428040751'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/6072464865428040751'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2009/04/aspmedia-control.html' title='The asp:Media Control'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_ww9l4AwRrmg/SfSdJEdO51I/AAAAAAAAAOs/zdOHFSHy810/s72-c/SilverlightMediaControl.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-6032873263550591</id><published>2009-04-02T12:23:00.000-07:00</published><updated>2009-04-02T12:32:13.533-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight media control'/><category scheme='http://www.blogger.com/atom/ns#' term='Expression Media Encoder'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight Chapters'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight media'/><title type='text'>Chapters in Silverlight Media Control</title><content type='html'>Media is a combination of audio and video and media can exist in various formats. Most of the media vendors, such as Microsoft, Apple, and Real, distribute and save media in proprietary formats. Most media players play media in multiple formats. There are industry standards and players support these formats as well. Media can be stored in a particular format when it is saved after being recorded. And media can as well be converted from one format to another using a converter tool. Preparing media for playback in a particular format is known as "Media Encoding". Media encoding process may also manipulate and modify the stream of media bits. For example, a media (audio / video) stream may be played by a madia encoder to a certain point and then another media source may be interjected. This is the type of encoding action that Television production studios perform to interject a commercial into a live or recorded media stream (television show) that is being broadcast.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The Expression Media Encoder (EME) is released by Microsoft with the Expression Suite of designer tools. By using EME, we can define markers, similar to bookmarks, in a media stream. These markers can be detected by the asp:Media control in the media stream and hence the asp:Media control can respond to them. In Silverlight player, the user can jump in the media playback from one marker to another. Furthermore, events can be fired automatically also when a new marker is encountered. These markers are generally referred to as chapters. An EME with media imported into it and with markers defined is shown in the figure below-&lt;/p&gt;&lt;p&gt;&lt;img id="BLOGGER_PHOTO_ID_5320178180008653090" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 241px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_ww9l4AwRrmg/SdUR3gEzMSI/AAAAAAAAANc/3kXvmhBEXPw/s400/SilverlightMediaControl.JPG" border="0" /&gt;&lt;/p&gt;&lt;p&gt;When the media is prepared and encoded with the help of EME, including markers, the output in Visual Studio 2008 appears as shown in the figure below-&lt;/p&gt;&lt;img id="BLOGGER_PHOTO_ID_5320178474085368210" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 287px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_ww9l4AwRrmg/SdUSInmJwZI/AAAAAAAAANk/ZiXnQIh46z8/s400/OutputWindow.JPG" border="0" /&gt;&lt;br /&gt;&lt;p&gt;Still more articles to come on this amazing Silverlight Media Control. So keep in touch.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-6032873263550591?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/6032873263550591/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=6032873263550591' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/6032873263550591'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/6032873263550591'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2009/04/chapters-in-silverlight-media-control.html' title='Chapters in Silverlight Media Control'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_ww9l4AwRrmg/SdUR3gEzMSI/AAAAAAAAANc/3kXvmhBEXPw/s72-c/SilverlightMediaControl.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-697252547733924737</id><published>2009-03-27T22:56:00.000-07:00</published><updated>2009-03-27T23:04:49.240-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight Video'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight media control'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight media'/><title type='text'>More on Silverlight MediaControl</title><content type='html'>The asp:Media control includes functionality to navigate through defined markers, or chapters, in encoded media. The asp:Media control includes a child element named &amp;lt;Chapters&amp;gt; , this element is used to define the chapters in the encoded media. This &amp;lt;Chapters&amp;gt; element in turn, contains a series of &amp;lt;asp:MediaChapter&amp;gt; elements that correlate to each chapter in the media. Each of the elements of &amp;lt;asp:MediaChapter&amp;gt; may contain three attributes-&lt;br /&gt;• Title: defines the title of a chapter and is displayed by the media player to identify the chapter.&lt;br /&gt;• TimeIndex: defines the location in the encoded media where the chapter begins.&lt;br /&gt;• ImageUrl: identifies an image being displayed by the media player to visually identify the chapter.&lt;br /&gt;There are many ways to provide values for each of these attributes. The easiest method among them is by using the marker definitions in EME. However the value of the TimeIndex attribute should be represented such that it can be converted to a double numeric value, hence it might be necessary to convert values from EME to asp:Media. For example, as shown in the code below, the marker at the end of the media is shown at 1.11.2455760 in EME whereas it must be converted to the actual number of minutes in the TimeIndex attribute as 71.2455760. The resulting asp:Media element definition is shown below-&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:Media ID="myCardVideo" AutoPlay="true" runat="server" Height="240px" MediaSkin="Professional" MediaUrl="SteveBreastonCardinalsPuntReturn.wmv"&lt;br /&gt;Width="320px"&amp;gt;&lt;br /&gt;&amp;lt;Chapters&amp;gt;&lt;br /&gt;&amp;lt;asp:MediaChapter Title="Start" TimeIndex="0.0" ImageUrl="~/Images/Image1.jpg" /&amp;gt;&lt;br /&gt;&amp;lt;asp:MediaChapter Title="Reception" TimeIndex="6.6253847" ImageUrl="~/Images/Image2.jpg" /&amp;gt;&lt;br /&gt;&amp;lt;asp:MediaChapter Title="Broken Tackle" TimeIndex="10.5280086" ImageUrl="~/EMEOutput/SteveBreastonCardinalsPuntReturn_MarkerThumb 00.00.10.5280086.jpg" /&amp;gt;&lt;br /&gt;&amp;lt;asp:MediaChapter Title="End Zone" TimeIndex="13.1600108" ImageUrl="~/EMEOutput/SteveBreastonCardinalsPuntReturn_MarkerThumb 00.00.13.1600108.jpg" /&amp;gt;&lt;br /&gt;&amp;lt;asp:MediaChapter Title="Replay" TimeIndex="17.3349108" ImageUrl="~/EMEOutput/SteveBreastonCardinalsPuntReturn_MarkerThumb 00.00.17.3349108.jpg" /&amp;gt;&lt;br /&gt;&amp;lt;asp:MediaChapter Title="Celebration" TimeIndex="55.1768291" ImageUrl="~/EMEOutput/SteveBreastonCardinalsPuntReturn_MarkerThumb 00.00.55.1768291.jpg" /&amp;gt;&lt;br /&gt;&amp;lt;asp:MediaChapter Title="End" TimeIndex="71.2455760" ImageUrl="~/EMEOutput/SteveBreastonCardinalsPuntReturn_MarkerThumb 00.01.11.2455760.jpg" /&amp;gt;&lt;br /&gt;&amp;lt;/Chapters&amp;gt;&lt;br /&gt;&amp;lt;/asp:Media&amp;gt; &lt;div&gt;&lt;br /&gt;Once the chapters are defined Silverlight media player is capable of navigating the chapters in the encoded media. To navigate the chapters, hover the mouse over the bottom of the player and the chapter images will be displayed. Now, clicking one of the chapter images, the media jumps to that chapter. The resulting player is shown in the image below- &lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;img id="BLOGGER_PHOTO_ID_5318115088466655266" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 259px; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_ww9l4AwRrmg/Sc29fxKzOCI/AAAAAAAAAMc/x099tNpKiqA/s400/SilveightMediaControl.JPG" border="0" /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-697252547733924737?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/697252547733924737/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=697252547733924737' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/697252547733924737'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/697252547733924737'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2009/03/more-on-silverlight-mediacontrol.html' title='More on Silverlight MediaControl'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_ww9l4AwRrmg/Sc29fxKzOCI/AAAAAAAAAMc/x099tNpKiqA/s72-c/SilveightMediaControl.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-1563828617872245463</id><published>2009-03-24T11:12:00.000-07:00</published><updated>2009-03-24T12:04:48.863-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight Video'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight media control'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight Chapters'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight media'/><title type='text'>Media Control and Chapters</title><content type='html'>Media is a combination of audio and video and media can exist in various formats. Most of the media vendors, such as Microsoft, Apple, and Real, distribute and save media in proprietary formats. Most media players play media in multiple formats. There are industry standards and players support these formats as well. Media can be stored in a particular format when it is saved after being recorded. And media can as well be converted from one format to another using a converter tool. Preparing media for playback in a particular format is known as "Media Encoding". Media encoding process may also manipulate and modify the stream of media bits. For example, a media (audio / video) stream may be played by a madia encoder to a certain point and then another media source may be interjected. This is the type of encoding action that Television production studios perform to interject a commercial into a live or recorded media stream (television show) that is being broadcast.&lt;br /&gt;The Expression Media Encoder (EME) is released by Microsoft with the Expression Suite of designer tools. By using EME, we can define markers, similar to bookmarks, in a media stream. These markers can be detected by the asp:Media control in the media stream and hence the asp:Media control can respond to them. In Silverlight player, the user can jump in the media playback from one marker to another. Furthermore, events can be fired automatically also when a new marker is encountered. These markers are generally referred to as chapters. An EME with media imported into it and with markers defined is shown in the figure below-&lt;br /&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5316831862933145346" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 240px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_ww9l4AwRrmg/SckuaNibxwI/AAAAAAAAAME/1nLT8fC0ras/s400/Silverlight-Chapters.JPG" border="0" /&gt;&lt;br /&gt;When the media is prepared and encoded with the help of EME, including markers, the output in Visual Studio 2008 appears as shown in the figure below-&lt;br /&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5316831870301777682" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 285px; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_ww9l4AwRrmg/Sckuao_QLxI/AAAAAAAAAMM/Vi7Hd2TnN3Y/s400/SilverlightChaptersOutput.JPG" border="0" /&gt;More on Media control chapters will be discussed in the next session.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-1563828617872245463?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/1563828617872245463/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=1563828617872245463' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/1563828617872245463'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/1563828617872245463'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2009/03/media-control-and-chapters.html' title='Media Control and Chapters'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_ww9l4AwRrmg/SckuaNibxwI/AAAAAAAAAME/1nLT8fC0ras/s72-c/Silverlight-Chapters.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-7838623372797595599</id><published>2009-03-20T20:52:00.000-07:00</published><updated>2009-03-20T21:05:38.249-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight Video'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight media'/><title type='text'>The asp:Media Control</title><content type='html'>The asp:Media control is included in the ASP.NET Futures release which is used to integrate audio and video into an ASP.NET or ASP.NET AJAX application.&lt;br /&gt;This asp:Media control is designed to integrate Silverlight audio and video. The benefit of using the asp:Media control is that through it integration of Silverlight audio and video can be done without the developer being required to have knowledge of XAML or JavaScript. Thus the asp:Media control allows for quick Silverlight integration into an ASP.NET application or an ASP.NET AJAX application while giving the developer time to get up to speed on the new technologies.&lt;br /&gt;The media formats supported by Silverlight are-&lt;br /&gt;· Windows Video (WMV)&lt;br /&gt;· Windows Media Audio (WMA)&lt;br /&gt;· MP3&lt;br /&gt;Properties, Events, and Methods&lt;br /&gt;The asp:Media control has a large number of properties and methods. The asp:Media control inherits from the System.Web.UI.Controls.WebControl.XamlControl and therefore also includes all of the properties, events, and methods included in the XamlControl.&lt;br /&gt;The MediaUrl and the MediaSkin are the most commonly used properties supported by the asp:Media control. As the names suggest, the MediaUrl property is used to identify the URL or location of the media file that is to be played by the asp:Media control and the MediaSkin property is used to specify the skin that the asp:Media control should display while playing the media file. There are several predefined skins that are supported by the asp:Media control and can be easily selected and it also has custom skins available.&lt;br /&gt;There are also a number of built-in events including the onClientMediaOpened event and the onClientChapterStarted event that the asp:Media control supports.&lt;br /&gt;Using asp:Media control is extremely easy right out of the box. Once the ASP.NET Futures extensions are installed, we can add the asp:Media control to ASP.NET pages declaratively or by dragging and dropping the control from the ASP.NET Futures tab in the Toolbox. After bringing the asp:Media control onto the asp.net page, and assigning the MediaUrl property a valid value, the page is media enabled. However, the ASP.NET Futures controls(including the asp:Media control) requires the use of the ASP.NET AJAX script library, hence any page utilizing the asp:Media control must have an asp:ScriptManager control on the page as well. Just by dropping the asp:Media control on a new ASP.NET page and assigning a value to the MediaUrl property will result in the markup shown below-&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %&amp;gt;&lt;br /&gt;&amp;lt;%@ Register Assembly="Microsoft.Web.Preview" Namespace="Microsoft.Web.Preview.UI.Controls" TagPrefix="asp" %&amp;gt;&lt;br /&gt;&amp;lt;DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;gt;&lt;br /&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml&amp;gt;&lt;br /&gt;&amp;lt;head runat="server&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;My Videos&amp;lt;title&amp;amp;gt&amp;amp;;&amp;lt;script type="text/JavaScript&amp;gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;function onChapterStarted(sender, chapterEventArgs)&lt;br /&gt;{&lt;br /&gt;var chapters = sender.get_chapters();&lt;br /&gt;var ci = chapterEventArgs.get_chapterIndex();&lt;br /&gt;var chapter = chapters[ci];&lt;br /&gt;Sys.Debug.trace("Chapter Info" + chapter.imageUrl + " " + chapter.title);&lt;br /&gt;}&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;form id="form1" runat="server"&amp;gt;&lt;br /&gt;&amp;lt;asp:ScriptManager ID="ScriptManager1" runat="server"&amp;gt; &amp;lt;/asp:ScriptManager&amp;gt;&lt;br /&gt;&amp;lt;div&amp;gt;&lt;br /&gt;&amp;lt;asp:Media ID="MyVideo" AutoPlay="true" runat="server" Height="388px" MediaUrl="~/Media/Marriage.wmv" Width="512px" XamlUrl="~/CustomProfessional.xaml" OnClientChapterStarted="onChapterStarted"&amp;gt;&lt;br /&gt;&amp;lt;Chapters&amp;gt;&lt;br /&gt;&amp;lt;asp:MediaChapter Title="Start" TimeIndex="0.0" ImageUrl="~/Images/Start.jpg" /&amp;gt;&lt;br /&gt;&amp;lt;asp:MediaChapter Title="Reception" TimeIndex="6.6253847" ImageUrl="~/Images/Reception.jpg" /&amp;gt;&lt;br /&gt;&amp;lt;asp:MediaChapter Title="Dinner" TimeIndex="10.5280086" ImageUrl="~/Images/Dinner.jpg" /&amp;gt;&lt;br /&gt;&amp;lt;asp:MediaChapter Title="Reception End" TimeIndex="13.1600108" ImageUrl="~/Images/ReceptionEnd.jpg" /&amp;gt;&lt;br /&gt;&amp;lt;asp:MediaChapter Title="Replay" TimeIndex="17.3349108" ImageUrl="~/Images/Replay.jpg" /&amp;gt;&lt;br /&gt;&amp;lt;asp:MediaChapter Title="Celebration" TimeIndex="55.1768291" ImageUrl="~/Images/Celebration.jpg" /&amp;gt;&lt;br /&gt;&amp;lt;asp:MediaChapter Title="End" TimeIndex="71.2455760" ImageUrl="~/Images/End.jpg" /&amp;gt;&lt;br /&gt;&amp;lt;/Chapters&amp;gt;&lt;br /&gt;&amp;lt;/asp:Media&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;The same page when displayed in the design view shows the Silverlight media player as shown in the figure below-&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;img id="BLOGGER_PHOTO_ID_5315485931467388194" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 261px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_ww9l4AwRrmg/ScRmSsGzNSI/AAAAAAAAAK8/qdzyvMk6uXs/s400/Media1.JPG" border="0" /&gt; &lt;div&gt;When played (cliking on the play button of the media player), the ASP.NET page plays the media file targeted by the asp:Media control as shown below:&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;img id="BLOGGER_PHOTO_ID_5315485940350883282" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 267px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_ww9l4AwRrmg/ScRmTNMyldI/AAAAAAAAALE/r6dEhMLjtt0/s400/Media2.JPG" border="0" /&gt; &lt;div&gt;Stay tune as more interesting tutorial articles on silverlight are coming soon.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-7838623372797595599?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/7838623372797595599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=7838623372797595599' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/7838623372797595599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/7838623372797595599'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2009/03/aspmedia-control.html' title='The asp:Media Control'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_ww9l4AwRrmg/ScRmSsGzNSI/AAAAAAAAAK8/qdzyvMk6uXs/s72-c/Media1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-7251432046256755984</id><published>2009-03-18T09:18:00.000-07:00</published><updated>2009-03-18T09:22:24.895-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='xaml'/><title type='text'>The asp:Xaml Control</title><content type='html'>Silverlight framework provides a generic class or type, for working with XAML, the Sys.Preview.UI.Xaml.Control. asp:Xaml control is used to insert XAML into an ASP.NET AJAX page in a very generic manner. asp:Xaml control is typically extended through JavaScript or managed code or dynamic code to provide a specialized implementation of the control. The attribute of the asp:Xaml control that is most commonly used is the XamlUrl attribute. It identifies the XAML file to be included in the page. asp:Xaml control exposes only three minimal events out of which one is fired upon an error and one is fired upon the XAML loading.&lt;br /&gt;Below is the code as an example of including XAML in an ASP.NET AJAX page by using the asp:Xaml control -&lt;br /&gt;&lt;br /&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %&amp;gt;&lt;br /&gt;&amp;lt;%@ Register assembly="Microsoft.Web.Preview" namespace="Microsoft.Web.Preview.UI.Controls" tagprefix="asp" %&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;&lt;br /&gt;&amp;lt;head runat="server"&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;Simple XAML Example&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;form id="form1" runat="server"&amp;gt;&lt;br /&gt;&amp;lt;asp:ScriptManager ID="ScriptManager1" runat="server"&amp;gt;&lt;br /&gt;&amp;lt;/asp:ScriptManager&amp;gt;&lt;br /&gt;&amp;lt;div&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;asp:Xaml ID="Xaml1" runat="server" Height="500px" Width="500px" XamlUrl="~/Scene.xaml" /&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-7251432046256755984?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/7251432046256755984/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=7251432046256755984' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/7251432046256755984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/7251432046256755984'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2009/03/aspxaml-control.html' title='The asp:Xaml Control'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-3024916260160403981</id><published>2009-03-16T10:20:00.000-07:00</published><updated>2009-03-16T10:24:48.732-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ajax.net'/><category scheme='http://www.blogger.com/atom/ns#' term='integrating silverlight with ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='integrating ajax with silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight with ajax'/><title type='text'>Integrating Silverlight With Asp.Net Ajax</title><content type='html'>When Asp.Net was released in the market, it was heavily adopted in the industry. Asp.Net expanded the market. Besides proliferating the market, Asp.Net still had a plenty of time to establish itself as a stable product in the market. Currently there are plenty of asp.net applications in the market that are still in production and that would really benefit from upgrading to Silverlight. However, keep it in mind that ASP.NET is processed on the server. ASP.NET AJAX is also processed on the server through the ASP.NET page event life cycle, although through the use of AJAX more of the processing occurs on the client's machine so as to avoid unnecessary postbacks.&lt;br /&gt;&lt;br /&gt;     A Silverlight application is hosted on a Web server so that a user can make a request for it from anywhere over the Web and once a request is made for a Silverlight application, the entire contents of the application are sent to the client's machine and processed there. Once a Silverlight application is executing on a client's machine, calls can be made to the server or to a Web service and by default, no postbacks occur to the server. The application is executing in an isolated and independent environment.&lt;br /&gt;&lt;br /&gt;     Although there are times when an application will benefit from merging the server-side and client-side worlds so that postbacks do occur to the server. For example, a Silverlight application that must continually be updated from server-side content may benefit from postbacks. Moreover, completely redesigning a Web application around a new technology is a time-consuming and considerable task. Many ASP.NET and ASP.NET AJAX applications that are already developed and deployed and are stable may benefit from integrating Silverlight without being fully redesigned.Soon Microsoft realized the need to merge the two worlds of Web computing and released some controls to do so in the ASP.NET Futures extensions. &lt;br /&gt;&lt;br /&gt;     The Microsoft ASP.NET Future extensions include new features and functionalites that are being considered for integration into ASP.NET, ASP.NET AJAX, and Silverlight and are made available for developers to begin experimenting with and adopting. Components that are released in ASP.NET Futures are normally somewhat stable and are therefore generally included in the next release of ASP.NET, ASP.NET AJAX, and Silverlight.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-3024916260160403981?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/3024916260160403981/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=3024916260160403981' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/3024916260160403981'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/3024916260160403981'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2009/03/integrating-silverlight-with-aspnet.html' title='Integrating Silverlight With Asp.Net Ajax'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-2785932103201542060</id><published>2009-03-13T08:57:00.000-07:00</published><updated>2009-03-13T09:27:13.114-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight calculator'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='professional calculator'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight professional calculator'/><title type='text'>The Professional Calculator</title><content type='html'>Remember the previous example of Simple Calculator. In this example, I will show you how to develop a professional calculator.&lt;br /&gt;&lt;br /&gt;Steps:&lt;br /&gt;&lt;br /&gt;1.First of all I will add a canvas on which I will develop my professional calculator. In the canvas I will add a rectangle specifying the boundaries of the calculator.&lt;br /&gt;&lt;br /&gt;&amp;lt;UserControl x:Class="MyCalculator.Page"&lt;br /&gt;xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;br /&gt;xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&amp;gt;&lt;br /&gt;&amp;lt;Canvas Background="Black" Loaded="Canvas_Loaded"&amp;gt;&lt;br /&gt;&amp;lt;Rectangle Width="200" Height="120" Canvas.Top="100" Canvas.Left="150" Fill="DimGray"&amp;gt;&amp;lt;/Rectangle&amp;gt;&lt;br /&gt;&amp;lt;/Canvas&amp;gt;&lt;br /&gt;&amp;lt;/UserControl&amp;gt;&lt;br /&gt;&lt;br /&gt;Remember each control is having an enevt specified by us, like Canvas_Loaded event for the canvas, all of which will be defines in the code file(Page.xaml.cs).&lt;br /&gt;&lt;br /&gt;2.Then I will add a textbox where I will see my operations being performed and will specify its location(Canvas.Top,Canvas.Left).&lt;br /&gt;&lt;br /&gt;Canvas.Top - Distance in pixels from the top of the screen.&lt;br /&gt;Canvas.Left - Distance in pixels from the left of the screen.&lt;br /&gt;IsReadOnly - To make sure user cannot type in the textbox directly from keyboard, the "IsReadOnly" property of the textbox is set to true.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;UserControl x:Class="MyCalculator.Page"&lt;br /&gt;xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;br /&gt;xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&amp;gt;&lt;br /&gt;&amp;lt;Canvas Background="Black" Loaded="Canvas_Loaded"&amp;gt;&lt;br /&gt;&amp;lt;Rectangle Width="200" Height="120" Canvas.Top="100" Canvas.Left="150" Fill="DimGray"&amp;gt;&amp;lt;/Rectangle&amp;gt;&lt;br /&gt;&amp;lt;TextBox x:Name="txtnum" Width="200" Canvas.Left="150" Canvas.Top="100" IsReadOnly="True"&amp;gt;&amp;lt;/TextBox&amp;gt;&lt;br /&gt;&amp;lt;/Canvas&amp;gt;&amp;lt;/UserControl&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3. Then I will add numeric buttons for the calculator.(Remember the properties like height,width,canvas.left,canvas.top can be set according to our need,the way we want the controls to be placed on the screen).&lt;br /&gt;&lt;br /&gt;&amp;lt;UserControl x:Class="MyCalculator.Page"&lt;br /&gt;xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;br /&gt;xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&amp;gt;&lt;br /&gt;&amp;lt;Canvas Background="Black" Loaded="Canvas_Loaded"&amp;gt;&lt;br /&gt;&amp;lt;Rectangle Width="200" Height="120" Canvas.Top="100" Canvas.Left="150" Fill="DimGray"&amp;gt;&amp;lt;/Rectangle&amp;gt;&lt;br /&gt;&amp;lt;TextBox x:Name="txtnum" Width="200" Canvas.Left="150" Canvas.Top="100" IsReadOnly="True"&amp;gt;&amp;lt;/TextBox&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btn1" Content="1" Height="25" Width="40" Canvas.Left="150" Canvas.Top="120" Click="btn1_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btn2" Content="2" Height="25" Width="40" Canvas.Left="190" Canvas.Top="120" Click="btn2_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btn3" Content="3" Height="25" Width="40" Canvas.Left="230" Canvas.Top="120" Click="btn3_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btn4" Content="4" Height="25" Width="40" Canvas.Left="150" Canvas.Top="145" Click="btn4_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btn5" Content="5" Height="25" Width="40" Canvas.Left="190" Canvas.Top="145" Click="btn5_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btn6" Content="6" Height="25" Width="40" Canvas.Left="230" Canvas.Top="145" Click="btn6_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btn7" Content="7" Height="25" Width="40" Canvas.Left="150" Canvas.Top="170" Click="btn7_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btn8" Content="8" Height="25" Width="40" Canvas.Left="190" Canvas.Top="170" Click="btn8_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btn9" Content="9" Height="25" Width="40" Canvas.Left="230" Canvas.Top="170" Click="btn9_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btn0" Content="0" Height="25" Width="40" Canvas.Left="150" Canvas.Top="195" Click="btn0_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btndot" Content="." Height="25" Width="40" Canvas.Left="190" Canvas.Top="195" Click="btndot_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btn00" Content="00" Height="25" Width="40" Canvas.Left="230" Canvas.Top="195" Click="btn00_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4. Then I will add the operator buttons on whose click,mathematical operations are to be performed.&lt;br /&gt;&lt;br /&gt;&amp;lt;UserControl x:Class="MyCalculator.Page"&lt;br /&gt;xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;br /&gt;xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&amp;gt;&lt;br /&gt;&amp;lt;Canvas Background="Black" Loaded="Canvas_Loaded"&amp;gt;&lt;br /&gt;&amp;lt;Rectangle Width="200" Height="120" Canvas.Top="100" Canvas.Left="150" Fill="DimGray"&amp;gt;&amp;lt;/Rectangle&amp;gt;&lt;br /&gt;&amp;lt;TextBox x:Name="txtnum" Width="200" Canvas.Left="150" Canvas.Top="100" IsReadOnly="True"&amp;gt;&amp;lt;/TextBox&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btn1" Content="1" Height="25" Width="40" Canvas.Left="150" Canvas.Top="120" Click="btn1_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btn2" Content="2" Height="25" Width="40" Canvas.Left="190" Canvas.Top="120" Click="btn2_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btn3" Content="3" Height="25" Width="40" Canvas.Left="230" Canvas.Top="120" Click="btn3_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btn4" Content="4" Height="25" Width="40" Canvas.Left="150" Canvas.Top="145" Click="btn4_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btn5" Content="5" Height="25" Width="40" Canvas.Left="190" Canvas.Top="145" Click="btn5_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btn6" Content="6" Height="25" Width="40" Canvas.Left="230" Canvas.Top="145" Click="btn6_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btn7" Content="7" Height="25" Width="40" Canvas.Left="150" Canvas.Top="170" Click="btn7_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btn8" Content="8" Height="25" Width="40" Canvas.Left="190" Canvas.Top="170" Click="btn8_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btn9" Content="9" Height="25" Width="40" Canvas.Left="230" Canvas.Top="170" Click="btn9_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btn0" Content="0" Height="25" Width="40" Canvas.Left="150" Canvas.Top="195" Click="btn0_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btndot" Content="." Height="25" Width="40" Canvas.Left="190" Canvas.Top="195" Click="btndot_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btn00" Content="00" Height="25" Width="40" Canvas.Left="230" Canvas.Top="195" Click="btn00_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btnplus" Content="+" Height="25" Width="40" Canvas.Left="270" Canvas.Top="120" Click="btnplus_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btnminus" Content="-" Height="25" Width="40" Canvas.Left="310" Canvas.Top="120" Click="btnminus_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btnmul" Content="*" Height="25" Width="40" Canvas.Left="270" Canvas.Top="145" Click="btnmul_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btndiv" Content="/" Height="25" Width="40" Canvas.Left="310" Canvas.Top="145" Click="btndiv_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btnequal" Content="=" Height="25" Width="40" Canvas.Left="270" Canvas.Top="170" Click="btnequal_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btnperc" Content="%" Height="25" Width="40" Canvas.Left="310" Canvas.Top="170" Click="btnperc_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btnclear" Content="Clear" Height="25" Width="40" Canvas.Left="270" Canvas.Top="195" Click="btnclear_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btnback" Content="Back" Height="25" Width="40" Canvas.Left="310" Canvas.Top="195" Click="btnback_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;/Canvas&amp;gt;&lt;br /&gt;&amp;lt;/UserControl&amp;gt;&lt;br /&gt;&lt;br /&gt;5.Now I have my user interface, and the events structure ready. These events are created in the MyCalculator.xaml.cs file.Now I will go to the code file and define the operations to be performed in the events created by me.&lt;br /&gt;&lt;br /&gt;6. Now I have taken certain varables of different datatype. Here is the explanation for these variables-&lt;br /&gt;&lt;br /&gt;[i] prevres - I have used the double type variable "prevres" to store the result of a previous mathetical operation in case I am performing further operation on the result of a previous operation.&lt;br /&gt;For example- say i multiplied 9 and 5 to get the result 45. Now to perform further operation on the result, i will move this value to the variable prevres and take the other value from the textbox txtnum and perform the operation.&lt;br /&gt;&lt;br /&gt;[ii] op - I have used string type variable op to keep track of the operator pressed so as to determine the type of arthemetic operation thatis to be performed.&lt;br /&gt;For example- say i click "num9" then operator "*" and then num5. When I click num9, 9 appears in the textbox. When I click operator *, 9 is stored in the prevres variable and * is stored in string variable "op".&lt;br /&gt;&lt;br /&gt;[iii] equalclick - I have used double type variable equalclick which will have values 0 or 1. It will have value 0 if equalto button is not clicked after clicking clear button or from the start and value 1 if it is clicked after these conditions.&lt;br /&gt;&lt;br /&gt;[iv] opclick - Similarly I have used double type variable opclick which will also have values 0 and 1 indicating whether an operator is clicked or not.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Net;&lt;br /&gt;using System.Windows;&lt;br /&gt;using System.Windows.Controls;&lt;br /&gt;using System.Windows.Documents;&lt;br /&gt;using System.Windows.Input;&lt;br /&gt;using System.Windows.Media;&lt;br /&gt;using System.Windows.Media.Animation;&lt;br /&gt;using System.Windows.Shapes;&lt;br /&gt;&lt;br /&gt;namespace MyCalculator&lt;br /&gt;{&lt;br /&gt;public partial class Page : UserControl&lt;br /&gt;{&lt;br /&gt;Double prevres=0;&lt;br /&gt;String op = "";&lt;br /&gt;Double equalclick = 0;&lt;br /&gt;Double opclick;&lt;br /&gt;public Page()&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Page.xaml&lt;br /&gt;&lt;br /&gt;&amp;lt;UserControl x:Class="MyCalculator.Page"&lt;br /&gt;xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;br /&gt;xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&amp;gt;&lt;br /&gt;&amp;lt;Canvas Background="Black" Loaded="Canvas_Loaded"&amp;gt;&lt;br /&gt;&amp;lt;Rectangle Width="200" Height="120" Canvas.Top="100" Canvas.Left="150" Fill="DimGray"&amp;gt;&amp;lt;/Rectangle&amp;gt;&lt;br /&gt;&amp;lt;TextBox x:Name="txtnum" Width="200" Canvas.Left="150" Canvas.Top="100" IsReadOnly="True"&amp;gt;&amp;lt;/TextBox&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btn1" Content="1" Height="25" Width="40" Canvas.Left="150" Canvas.Top="120" Click="btn1_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btn2" Content="2" Height="25" Width="40" Canvas.Left="190" Canvas.Top="120" Click="btn2_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btn3" Content="3" Height="25" Width="40" Canvas.Left="230" Canvas.Top="120" Click="btn3_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btn4" Content="4" Height="25" Width="40" Canvas.Left="150" Canvas.Top="145" Click="btn4_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btn5" Content="5" Height="25" Width="40" Canvas.Left="190" Canvas.Top="145" Click="btn5_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btn6" Content="6" Height="25" Width="40" Canvas.Left="230" Canvas.Top="145" Click="btn6_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btn7" Content="7" Height="25" Width="40" Canvas.Left="150" Canvas.Top="170" Click="btn7_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btn8" Content="8" Height="25" Width="40" Canvas.Left="190" Canvas.Top="170" Click="btn8_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btn9" Content="9" Height="25" Width="40" Canvas.Left="230" Canvas.Top="170" Click="btn9_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btn0" Content="0" Height="25" Width="40" Canvas.Left="150" Canvas.Top="195" Click="btn0_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btndot" Content="." Height="25" Width="40" Canvas.Left="190" Canvas.Top="195" Click="btndot_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btn00" Content="00" Height="25" Width="40" Canvas.Left="230" Canvas.Top="195" Click="btn00_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btnplus" Content="+" Height="25" Width="40" Canvas.Left="270" Canvas.Top="120" Click="btnplus_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btnminus" Content="-" Height="25" Width="40" Canvas.Left="310" Canvas.Top="120" Click="btnminus_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btnmul" Content="*" Height="25" Width="40" Canvas.Left="270" Canvas.Top="145" Click="btnmul_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btndiv" Content="/" Height="25" Width="40" Canvas.Left="310" Canvas.Top="145" Click="btndiv_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btnequal" Content="=" Height="25" Width="40" Canvas.Left="270" Canvas.Top="170" Click="btnequal_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btnperc" Content="%" Height="25" Width="40" Canvas.Left="310" Canvas.Top="170" Click="btnperc_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btnclear" Content="Clear" Height="25" Width="40" Canvas.Left="270" Canvas.Top="195" Click="btnclear_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btnback" Content="Back" Height="25" Width="40" Canvas.Left="310" Canvas.Top="195" Click="btnback_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;/Canvas&amp;gt;&lt;br /&gt;&amp;lt;/UserControl&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;7.Now I will define the operations in the events one by one.&lt;br /&gt;&lt;br /&gt;[1]Plus Click- On clicking plus operator, I will save the number currently in the txtnum textbox, in some variable of type double(prevres in this example and make the txtnum textbox text=0 so that I can enter the second operand and will also save the operand "+" in a string variable op.&lt;br /&gt;&lt;br /&gt;[2]Minus Click- Similarly on clicking minus operator, I will save the number currently in the txtnum textbox, in some variable of type double and make the txtnum textbox text=0 so that I can enter the second operand and will also save the operand "-" in the string variable op.&lt;br /&gt;&lt;br /&gt;[3]Multiply Click &amp;amp; Divide click- Similar operation needs to be performed in the click event of multiply button and divide button.&lt;br /&gt;&lt;br /&gt;[4]EqualTo Click- Now I have my first operand in the variable "prevres", the operator in the variable in the variable "op" and the second operand in the textbox "txtnum".&lt;br /&gt;&lt;br /&gt;Thats all I needed. Now i will simply check which operator is stored in variable op and accordingly perform the operation&lt;br /&gt;&lt;br /&gt;if(op=="+")&lt;br /&gt;{&lt;br /&gt;txtnum.Text=Convert.ToString(Convert.ToInt32(prevres) + Convert.ToInt32(txtnum.Text));&lt;br /&gt;}&lt;br /&gt;else if(op=="-")&lt;br /&gt;{&lt;br /&gt;txtnum.Text=Convert.ToString(Convert.ToInt32(prevres) - Convert.ToInt32(txtnum.Text));&lt;br /&gt;}&lt;br /&gt;else if(op=="*")&lt;br /&gt;{&lt;br /&gt;txtnum.Text=Convert.ToString(Convert.ToString(prevres) * Convert.ToInt32(txtnum.Text));&lt;br /&gt;}&lt;br /&gt;else if(op=="\\")&lt;br /&gt;{&lt;br /&gt;txtnum.Text=Convert.ToString(Convert.ToString(prevres) \ Convert.ToInt32(txtnum.Text));&lt;br /&gt;}&lt;br /&gt;op = "";&lt;br /&gt;equalclick = 1;&lt;br /&gt;prevres = 0;&lt;br /&gt;opclick = 1;&lt;br /&gt;&lt;br /&gt;Value of the variable "op" is cleared , equalclick variable is set to 1 to specify thats it has been clicked, prevres is cleared to 0, and opclick is set to 1 to specify that operator has been clicked.&lt;br /&gt;&lt;br /&gt;That is all you need to creat a professional calculator. You can add further trigonometric operations if you want. Its also similar to what you have learnt in this.&lt;br /&gt;&lt;br /&gt;You can find the complete program for the Professional Calculator and the snaoshots of the program running below.&lt;br /&gt;&lt;br /&gt;Page.xaml.cs&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Net;&lt;br /&gt;using System.Windows;&lt;br /&gt;using System.Windows.Controls;&lt;br /&gt;using System.Windows.Documents;&lt;br /&gt;using System.Windows.Input;&lt;br /&gt;using System.Windows.Media;&lt;br /&gt;using System.Windows.Media.Animation;&lt;br /&gt;using System.Windows.Shapes;&lt;br /&gt;&lt;br /&gt;namespace MyCalculator&lt;br /&gt;{&lt;br /&gt;public partial class Page : UserControl&lt;br /&gt;{&lt;br /&gt;Double prevres=0;&lt;br /&gt;String op = "";&lt;br /&gt;Double equalclick = 0;&lt;br /&gt;Double opclick;&lt;br /&gt;public Page()&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private void btnplus_Click(object sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;prevres += Convert.ToDouble(txtnum.Text);&lt;br /&gt;txtnum.Text = "0";&lt;br /&gt;op = "+";&lt;br /&gt;opclick = 1;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private void btnminus_Click(object sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;prevres += Convert.ToDouble(txtnum.Text);&lt;br /&gt;txtnum.Text = "0";&lt;br /&gt;op = "-";&lt;br /&gt;opclick = 1;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private void btnmul_Click(object sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;prevres += Convert.ToDouble(txtnum.Text);&lt;br /&gt;txtnum.Text = "0";&lt;br /&gt;op = "*";&lt;br /&gt;opclick = 1;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private void btndiv_Click(object sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;prevres += Convert.ToDouble(txtnum.Text);&lt;br /&gt;txtnum.Text = "0";&lt;br /&gt;op = "\\";&lt;br /&gt;opclick = 1;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private void btnequal_Click(object sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;if (op == "+")&lt;br /&gt;{&lt;br /&gt;txtnum.Text = Convert.ToString(prevres + Convert.ToDouble(txtnum.Text));&lt;br /&gt;}&lt;br /&gt;else if (op == "-")&lt;br /&gt;{&lt;br /&gt;txtnum.Text = Convert.ToString(prevres - Convert.ToDouble(txtnum.Text));&lt;br /&gt;}&lt;br /&gt;else if (op == "*")&lt;br /&gt;{&lt;br /&gt;txtnum.Text = Convert.ToString(prevres * Convert.ToDouble(txtnum.Text));&lt;br /&gt;}&lt;br /&gt;else if (op == "\\")&lt;br /&gt;{&lt;br /&gt;txtnum.Text = Convert.ToString(prevres / Convert.ToDouble(txtnum.Text));&lt;br /&gt;}&lt;br /&gt;op = "";&lt;br /&gt;equalclick = 1;&lt;br /&gt;prevres = 0;&lt;br /&gt;opclick = 1;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private void btnperc_Click(object sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;txtnum.Text =Convert.ToString(Convert.ToDouble(txtnum.Text) / 100);&lt;br /&gt;opclick = 1;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private void btnclear_Click(object sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;prevres = 0;&lt;br /&gt;op = "";&lt;br /&gt;equalclick = 0;&lt;br /&gt;txtnum.Text = "0";&lt;br /&gt;opclick = 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private void btnback_Click(object sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;if (txtnum.Text.Length &amp;gt; 1)&lt;br /&gt;{&lt;br /&gt;txtnum.Text = txtnum.Text.Substring(0, txtnum.Text.Length - 1);&lt;br /&gt;}&lt;br /&gt;else if (txtnum.Text.Length == 1)&lt;br /&gt;{&lt;br /&gt;txtnum.Text = "0";&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private void btn1_Click(object sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;if ((txtnum.Text == "0")(equalclick==1))&lt;br /&gt;{&lt;br /&gt;txtnum.Text = "1";&lt;br /&gt;equalclick = 0;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;txtnum.Text += "1";&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private void btn2_Click(object sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;if ((txtnum.Text == "0") (equalclick == 1))&lt;br /&gt;{&lt;br /&gt;txtnum.Text = "2";&lt;br /&gt;equalclick = 0;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;txtnum.Text += "2";&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private void btn3_Click(object sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;if ((txtnum.Text == "0") (equalclick == 1))&lt;br /&gt;{&lt;br /&gt;txtnum.Text = "3";&lt;br /&gt;equalclick = 0;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;txtnum.Text += "3";&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private void btn4_Click(object sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;if ((txtnum.Text == "0") (equalclick == 1))&lt;br /&gt;{&lt;br /&gt;txtnum.Text = "4";&lt;br /&gt;equalclick = 0;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;txtnum.Text += "4";&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private void btn5_Click(object sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;if ((txtnum.Text == "0") (equalclick == 1))&lt;br /&gt;{&lt;br /&gt;txtnum.Text = "5";&lt;br /&gt;equalclick = 0;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;txtnum.Text += "5";&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private void btn6_Click(object sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;if ((txtnum.Text == "0") (equalclick == 1))&lt;br /&gt;{&lt;br /&gt;txtnum.Text = "6";&lt;br /&gt;equalclick = 0;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;txtnum.Text += "6";&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private void btn7_Click(object sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;if ((txtnum.Text == "0") (equalclick == 1))&lt;br /&gt;{&lt;br /&gt;txtnum.Text = "7";&lt;br /&gt;equalclick = 0;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;txtnum.Text += "7";&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private void btn8_Click(object sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;if ((txtnum.Text == "0") (equalclick == 1))&lt;br /&gt;{&lt;br /&gt;txtnum.Text = "8";&lt;br /&gt;equalclick = 0;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;txtnum.Text += "8";&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private void btn9_Click(object sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;if ((txtnum.Text == "0") (equalclick == 1))&lt;br /&gt;{&lt;br /&gt;txtnum.Text = "9";&lt;br /&gt;equalclick = 0;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;txtnum.Text += "9";&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private void btn0_Click(object sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;if ((txtnum.Text == "0") (equalclick == 1))&lt;br /&gt;{&lt;br /&gt;txtnum.Text = "0";&lt;br /&gt;equalclick = 0;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;txtnum.Text += "0";&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private void btndot_Click(object sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;Double pos = txtnum.Text.IndexOf(".");&lt;br /&gt;if (pos &amp;lt; 0)&lt;br /&gt;{&lt;br /&gt;txtnum.Text += ".";&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private void btn00_Click(object sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;if (txtnum.Text == "0")&lt;br /&gt;{&lt;br /&gt;txtnum.Text = "0";&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;txtnum.Text += "00";&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private void Canvas_Loaded(object sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;txtnum.Text = "0";&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Running the program&lt;br /&gt;&lt;br /&gt;Let us check the application by performing a simple multiplication operation.&lt;br /&gt;Follow the simple steps explained below-&lt;br /&gt;&lt;br /&gt;1.When the program starts, 0 is displayed on the screen as it happens in any calculator. &lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;p&gt;&lt;/p&gt;&lt;img id="BLOGGER_PHOTO_ID_5312704732491960194" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 300px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_ww9l4AwRrmg/SbqEzmi4T4I/AAAAAAAAAIc/osp3Ohs_gv8/s400/Calculator_1.JPG" border="0" /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2.I clicked on number 9 and the number is displayed on the calculator's screen.&lt;/div&gt;&lt;img id="BLOGGER_PHOTO_ID_5312704738311588018" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 300px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_ww9l4AwRrmg/SbqEz8OYyLI/AAAAAAAAAIk/Xnjss_dCZ8Y/s400/Calculator_2.JPG" border="0" /&gt; &lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;3. Now I clicked on the multiplication operator which brings 0 on the calculator's screen making it ready to accept the next operand for the multiplication operation.&lt;/div&gt;&lt;img id="BLOGGER_PHOTO_ID_5312704741551880786" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 300px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_ww9l4AwRrmg/SbqE0IS7ulI/AAAAAAAAAIs/jwpds4i_e98/s400/Calculator_3.JPG" border="0" /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;4. Now I clicked on number 5 and the second operand is displayed on the calculator screen.&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;img id="BLOGGER_PHOTO_ID_5312704749393211314" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 300px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_ww9l4AwRrmg/SbqE0lgc77I/AAAAAAAAAI0/9fkA0GKxaeo/s400/Calculator_4.JPG" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;5. Now I clicked on the "equal to" operator and the result is displayed on the screen. &lt;/div&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5312704748966522866" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 300px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_ww9l4AwRrmg/SbqE0j6uL_I/AAAAAAAAAI8/ykbWSWmoVHg/s400/Calculator_5.JPG" border="0" /&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;So, you can see how easy it is to use silverlight. You will experience the difference between silverlight and other web technologies when you will run this application. The user friendliness and the beauty of the presentation makes silverlight extremely attractive and even being a web application the silverlight application appears to work as a desktop application(i.e. no page refreshes). Trust me, you will love it when you will see a professional looking "professional calculator in your Silverlight application. Keep in touch as much more interesting and knowledgable stuffs coming soon.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-2785932103201542060?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/2785932103201542060/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=2785932103201542060' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/2785932103201542060'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/2785932103201542060'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2009/03/professional-calculator.html' title='The Professional Calculator'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_ww9l4AwRrmg/SbqEzmi4T4I/AAAAAAAAAIc/osp3Ohs_gv8/s72-c/Calculator_1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-5582817205918390708</id><published>2009-03-08T07:50:00.000-07:00</published><updated>2009-03-08T07:56:42.551-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight Bouncing Ball'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight animation'/><title type='text'>BOUNCING BALL Example of Silverlight Animation</title><content type='html'>A more complex example is provided in the code below to create an animation that includes a bouncing ball with a background that changes color-&lt;br /&gt;&lt;br /&gt;BOUNCING BALL&lt;br /&gt;&amp;lt;Canvas&lt;br /&gt;xmlns="http://schemas.microsoft.com/client/2007"&lt;br /&gt;xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&lt;br /&gt;x:Name="ParentCanvas"&lt;br /&gt;Loaded="Page_Loaded"&lt;br /&gt;x:Class="BouncingBall.Page;assembly=ClientBin/BouncingBall.dll"&lt;br /&gt;Width="480"&lt;br /&gt;Height="240"&lt;br /&gt;&amp;gt;&lt;br /&gt;&amp;lt;Canvas.Background&amp;gt;&lt;br /&gt;&amp;lt;LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5"&amp;gt;&lt;br /&gt;&amp;lt;GradientStop Color="#FF000000" Offset="0"/&amp;gt;&lt;br /&gt;&amp;lt;GradientStop Color="#FFFFFFFF" Offset="1"/&amp;gt;&lt;br /&gt;&amp;lt;/LinearGradientBrush&amp;gt;&lt;br /&gt;&amp;lt;/Canvas.Background&amp;gt;&lt;br /&gt;&amp;lt;Canvas.Triggers&amp;gt;&lt;br /&gt;&amp;lt;EventTrigger RoutedEvent="Canvas.Loaded"&amp;gt;&lt;br /&gt;&amp;lt;BeginStoryboard&amp;gt;&lt;br /&gt;&amp;lt;Storyboard x:Name="SBBouncingBall"&amp;gt;&lt;br /&gt;&amp;lt;DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ellipse" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)"&amp;gt;&lt;br /&gt;&amp;lt;SplineDoubleKeyFrame KeyTime="00:00:01" Value="168"/&amp;gt;&lt;br /&gt;&amp;lt;SplineDoubleKeyFrame KeyTime="00:00:02" Value="16"/&amp;gt;&lt;br /&gt;&amp;lt;SplineDoubleKeyFrame KeyTime="00:00:03" Value="168"/&amp;gt;&lt;br /&gt;&amp;lt;SplineDoubleKeyFrame KeyTime="00:00:04" Value="96"/&amp;gt;&lt;br /&gt;&amp;lt;SplineDoubleKeyFrame KeyTime="00:00:05" Value="168"/&amp;gt;&lt;br /&gt;&amp;lt;SplineDoubleKeyFrame KeyTime="00:00:06" Value="152"/&amp;gt;&lt;br /&gt;&amp;lt;SplineDoubleKeyFrame KeyTime="00:00:07" Value="168"/&amp;gt;&lt;br /&gt;&amp;lt;SplineDoubleKeyFrame KeyTime="00:00:08.1000000" Value="168"/&amp;gt;&lt;br /&gt;&amp;lt;/DoubleAnimationUsingKeyFrames&amp;gt;&lt;br /&gt;&amp;lt;DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ellipse" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)"&amp;gt;&lt;br /&gt;&amp;lt;SplineDoubleKeyFrame KeyTime="00:00:01" Value="64"/&amp;gt;&lt;br /&gt;&amp;lt;SplineDoubleKeyFrame KeyTime="00:00:02" Value="128"/&amp;gt;&lt;br /&gt;&amp;lt;SplineDoubleKeyFrame KeyTime="00:00:03" Value="200"/&amp;gt;&lt;br /&gt;&amp;lt;SplineDoubleKeyFrame KeyTime="00:00:04" Value="264"/&amp;gt;&lt;br /&gt;&amp;lt;SplineDoubleKeyFrame KeyTime="00:00:05" Value="320"/&amp;gt;&lt;br /&gt;&amp;lt;SplineDoubleKeyFrame KeyTime="00:00:06" Value="360"/&amp;gt;&lt;br /&gt;&amp;lt;SplineDoubleKeyFrame KeyTime="00:00:07" Value="392"/&amp;gt;&lt;br /&gt;&amp;lt;SplineDoubleKeyFrame KeyTime="00:00:08.1000000" Value="456"/&amp;gt;&lt;br /&gt;&amp;lt;/DoubleAnimationUsingKeyFrames&amp;gt;&lt;br /&gt;&amp;lt;ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="parentCanvas" Storyboard.TargetProperty="(Panel.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)"&amp;gt;&lt;br /&gt;&amp;lt;SplineColorKeyFrame KeyTime="00:00:02" Value="#FFBF6262"/&amp;gt;&lt;br /&gt;&amp;lt;SplineColorKeyFrame KeyTime="00:00:04" Value="#FF6277BF"/&amp;gt;&lt;br /&gt;&amp;lt;SplineColorKeyFrame KeyTime="00:00:06.2000000" Value="#FF7824A5"/&amp;gt;&lt;br /&gt;&amp;lt;/ColorAnimationUsingKeyFrames&amp;gt;&lt;br /&gt;&amp;lt;/Storyboard&amp;gt;&lt;br /&gt;&amp;lt;/BeginStoryboard&amp;gt;&lt;br /&gt;&amp;lt;/EventTrigger&amp;gt;&lt;br /&gt;&amp;lt;/Canvas.Triggers&amp;gt;&lt;br /&gt;&amp;lt;Ellipse RenderTransformOrigin="0.5,0.5" x:Name="ellipse" Width="65" Height="65" Fill="#FF27DE3C" Stroke="#FFECAE28" StrokeThickness="2" Canvas.Left="10" Canvas.Top="10"&amp;gt;&lt;br /&gt;&amp;lt;Ellipse.RenderTransform&amp;gt;&lt;br /&gt;&amp;lt;TransformGroup&amp;gt;&lt;br /&gt;&amp;lt;ScaleTransform ScaleX="1" ScaleY="1"/&amp;gt;&lt;br /&gt;&amp;lt;SkewTransform AngleX="0" AngleY="0"/&amp;gt;&lt;br /&gt;&amp;lt;RotateTransform Angle="0"/&amp;gt;&lt;br /&gt;&amp;lt;TranslateTransform X="0" Y="0"/&amp;gt;&lt;br /&gt;&amp;lt;/TransformGroup&amp;gt;&lt;br /&gt;&amp;lt;/Ellipse.RenderTransform&amp;gt;&lt;br /&gt;&amp;lt;/Ellipse&amp;gt;&lt;br /&gt;&amp;lt;/Canvas&amp;gt;&lt;br /&gt;&lt;br /&gt;The result of the code above is shown in the figure below-&lt;br /&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5310830323537967682" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 275px; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_ww9l4AwRrmg/SbPcCpDaekI/AAAAAAAAAIE/gjCQH6KwmDU/s400/SilverlightAnimationExample.JPG" border="0" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-5582817205918390708?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/5582817205918390708/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=5582817205918390708' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/5582817205918390708'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/5582817205918390708'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2009/03/bouncing-ball-example-of-silverlight.html' title='BOUNCING BALL Example of Silverlight Animation'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_ww9l4AwRrmg/SbPcCpDaekI/AAAAAAAAAIE/gjCQH6KwmDU/s72-c/SilverlightAnimationExample.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-8697956986808732126</id><published>2009-03-05T09:13:00.000-08:00</published><updated>2009-03-05T09:17:27.840-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight drawing'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='xaml'/><category scheme='http://www.blogger.com/atom/ns#' term='animation in silverlight'/><title type='text'>Animations in Silverlight</title><content type='html'>Elements in the Silverlight XAML represent objects in the .NET Framework and Silverlight. Objects have properties which in turn have values that can be modified. An animation in software occurs through the progressive modification of a property value such an location, shape, size etc over a period of time. For example, the angle property of a rotation transformation can be modified progressively over a period of time say in seconds to cause text affected by the transformation to spin.&lt;br /&gt;Animation in Silverlight is divided into 2 categories-&lt;br /&gt;1. from / to / by animations&lt;br /&gt;2. key-frame animations&lt;br /&gt;1. from / to / by animations - In from / to / by animations, the time periods over which the animations occur are handled by the duration property, and the starting value of the property and the ending value of the property are specified using the from and to properties respectively.&lt;br /&gt;2. key-frame animations - Key-frame animations are comparitively more complex to implement but the animation capabilities offered by key-frame animations more powerful. We will be discussing from/to/by animations here.&lt;br /&gt;In Silverlight, the various types of animations are implemented through animation objects. All the animation objects are derived from the Timeline object. The only properties that can be animated are the properties with values of type of datatype double,Color or Point. And the derived animation object types are DoubleAnimation, ColorAnimation and PointAnimation. These animation object types are described below-&lt;br /&gt;1. DoubleAnimation Object - DoubleAnimation objects are used to animate object property values of double type.&lt;br /&gt;2. ColorAnimation Object - ColorAnimation objects are used to animate object property values of Color type.&lt;br /&gt;3. Point Animation Object - PointAnimation objects are used to animate object property values of Point type.&lt;br /&gt;The code below increases the font size of the text in tbWebucator text block from 5.0 to 50.0 over a period of 5 seconds-&lt;br /&gt;&amp;lt;TextBlock&lt;br /&gt;FontFamily = "Arial"&lt;br /&gt;FontSize = "50"&lt;br /&gt;Width = "300"&lt;br /&gt;Height = "100"&lt;br /&gt;Canvas.Left = "100"&lt;br /&gt;Canvas.Top = "100"&lt;br /&gt;Text = "Webucator"&lt;br /&gt;x : Name = "tbwebucator"&amp;gt;&lt;br /&gt;&amp;lt;TextBlock.Triggers&amp;gt;&lt;br /&gt;&amp;lt;EventTrigger RoutedEvent="TextBlock.Loaded"&amp;gt;&lt;br /&gt;&amp;lt;BeginStoryboard&amp;gt;&lt;br /&gt;&amp;lt;Storyboard&amp;gt;&lt;br /&gt;&amp;lt;DoubleAnimation&lt;br /&gt;Storyboard.TargetName="tbWebucator"&lt;br /&gt;Storyboard.TargetProperty="FontSize"&lt;br /&gt;From="5.0" To="50.0" Duration="0:0:5" /&amp;gt;&lt;br /&gt;&amp;lt;/Storyboard&amp;gt;&lt;br /&gt;&amp;lt;/BeginStoryboard&amp;gt;&lt;br /&gt;&amp;lt;/EventTrigger&amp;gt;&lt;br /&gt;&amp;lt;/TextBlock.Triggers&amp;gt;&lt;br /&gt;&amp;lt;/TextBlock&amp;gt;&lt;br /&gt;As shown in the code above, a DoubleAnimation must be contained inside of the &amp;lt;StoryBoard&amp;gt; element. A &amp;lt;StoryBoard&amp;gt; element may contain more than one animation. It is must to associate a &amp;lt;StoryBoard&amp;gt; with an event action. In the code above, the &amp;lt;StoryBoard&amp;gt; is associated with a &amp;lt;BeginStoryBoard&amp;gt; event action.&lt;br /&gt;An event action must be initiated and for that an &amp;lt;EventTrigger&amp;gt; element is used. The containing &amp;lt;EventTrigger&amp;gt; in the above code fires on the Loaded event of the TextBlock. Each of the elements can contain multiple triggers and all the triggers associated with an element must be contained inside the triggers collection for that element.&lt;br /&gt;The code above is written so as to start automatically upon the text block loading. Animations can also be controlled programmatically. To control an animation programmatically, the animation element must have a name assigned to it so that it can be referred through coding and then call the method associated with the desired action. For example, to start an animation, call the Begin method.&lt;br /&gt;Additional attributes are provided to further control the behavior of an animation. For example, the animation in the code written above will play for a single time only. If we want the code to continue playing the same animation repeatedly, the RepeatBehavior can be set to the number of repeations required. If we want the animation to play continuously for indefinite time, the RepeatBehavior property should be set to "Forever".&lt;br /&gt;An animation can also be configured to animate in reverse as soon as it completes it original animation, by setting the AutoReverse property to "True".&lt;br /&gt;&lt;br /&gt;Keep in touch to see a more complex and interesting example of Silverlight Animation.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-8697956986808732126?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/8697956986808732126/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=8697956986808732126' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/8697956986808732126'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/8697956986808732126'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2009/03/animations-in-silverlight.html' title='Animations in Silverlight'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-6530967899805607786</id><published>2009-02-20T09:31:00.000-08:00</published><updated>2009-02-20T09:44:31.728-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight graphics'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight transformations'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='drawing in silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight transformation'/><category scheme='http://www.blogger.com/atom/ns#' term='transformations'/><category scheme='http://www.blogger.com/atom/ns#' term='transformation'/><title type='text'>Transformations</title><content type='html'>Transformation objects are those objects that are used to transform other Shape objects. Transformations are of various types which includes rotations, scales, translations and skews. A rotation transformation rotates an object. A scale transformation resizes the object. A translation transformation moves the object. Askew transformation skews the shape of the object.&lt;br /&gt;I wil define one of these transformations here, say rotation transformation. Let us rotate the text above through an angle of 45 degree. The code shown below does this with ease-&lt;br /&gt;&lt;br /&gt;&amp;lt;TextBlock RenderTransformOrigin="0.5,0.5" Width="320" Height="80" Canvas.Left="80" Canvas.Top="104" TextWrapping="Wrap"&amp;gt; &amp;lt;TextBlock.RenderTransform&amp;gt;&lt;br /&gt;&amp;lt;TransformGroup&amp;gt;&lt;br /&gt;&amp;lt;ScaleTransform ScaleX="1" ScaleY="1"/&amp;gt;&lt;br /&gt;&amp;lt;SkewTransform AngleX="0" AngleY="0"/&amp;gt;&lt;br /&gt;&amp;lt;RotateTransform Angle="45"/&amp;gt;&lt;br /&gt;&amp;lt;TranslateTransform X="0" Y="0"/&amp;gt;&lt;br /&gt;&amp;lt;/TransformGroup&amp;gt;&lt;br /&gt;&amp;lt;/TextBlock.RenderTransform&amp;gt;&lt;br /&gt;&amp;lt;Run FontFamily="Segoe UI" FontSize="50" Text="Webucator"/&amp;gt;&lt;br /&gt;&amp;lt;/TextBlock&amp;gt;&lt;br /&gt;&lt;br /&gt;The result of the code above is shown in the figure below-&lt;br /&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5304936104252432818" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 355px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_ww9l4AwRrmg/SZ7rR7IcYbI/AAAAAAAAAGE/X0IYrrOyuBs/s400/Silverlight-Tranformations.JPG" border="0" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-6530967899805607786?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/6530967899805607786/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=6530967899805607786' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/6530967899805607786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/6530967899805607786'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2009/02/transformations.html' title='Transformations'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_ww9l4AwRrmg/SZ7rR7IcYbI/AAAAAAAAAGE/X0IYrrOyuBs/s72-c/Silverlight-Tranformations.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-8856508790595877284</id><published>2009-02-17T00:29:00.000-08:00</published><updated>2009-02-17T00:35:05.942-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight graphics'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight Video'/><category scheme='http://www.blogger.com/atom/ns#' term='animation in silverlight'/><title type='text'>Silverlight Video</title><content type='html'>A little more effort is needed to paint by using video. The reason for this extra effort is that a VideoBrush does not directly play videos rather it utilizes the videos from other sources such as a MediaElement object. I have discussed about the MediaElement object again in the section below. In the example shown below, a video is being played as the fore ground of the text. The VideoBrush is utilized in the foreground of the text using the property of TextBlock ie TextBlock.Foreground and the VideoBrush in turn utilizes the video from the MediaElement object.&lt;br /&gt;&lt;br /&gt;&amp;lt;MediaElement Source="MyFavouriteVideo.wmv" Opacity="0" x:Name="MyVideo" /&amp;gt;&lt;br /&gt;&amp;lt;TextBlock Width="350" Height="100" Canvas.Left="60" Canvas.Top="30" TextWrapping="Wrap"&amp;gt;&lt;br /&gt;&amp;lt;TextBlock.Foreground&amp;gt;&lt;br /&gt;&amp;lt;VideoBrush SourceName="MyVideo" /&amp;gt;&lt;br /&gt;&amp;lt;/TextBlock.Foreground&amp;gt;&lt;br /&gt;&amp;lt;Run FontFamily="Segoe UI" FontSize="65" Text="Webucator"/&amp;gt;&lt;br /&gt;&amp;lt;/TextBlock&amp;gt;&lt;br /&gt;The result of the code written above is shown in the figure below with video playing as text- &lt;div&gt;&lt;/div&gt;&lt;img id="BLOGGER_PHOTO_ID_5303681563776123090" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 267px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_ww9l4AwRrmg/SZp2SDqqANI/AAAAAAAAAEM/OcuSlRQQosU/s400/Graphics.JPG" border="0" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-8856508790595877284?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/8856508790595877284/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=8856508790595877284' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/8856508790595877284'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/8856508790595877284'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2009/02/silverlight-video.html' title='Silverlight Video'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_ww9l4AwRrmg/SZp2SDqqANI/AAAAAAAAAEM/OcuSlRQQosU/s72-c/Graphics.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-2368804738052210212</id><published>2009-02-08T03:41:00.000-08:00</published><updated>2009-02-08T04:04:52.611-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight drawing'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight brushes'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><title type='text'>Silverlight Brushes</title><content type='html'>Brushes are used to paint the spaces between the strokes, or the border or the stroke itself. For example, we can use a brush to paint the interior space of a rectangle or we can use the brush to paint the border of the rectangle. In fact, we have used a gradient brush to paint the interior of the rectangle that was used in the rectangles example above, as shown in the code below-&lt;br /&gt;&lt;/rectangle&gt;&amp;lt;Rectangle Width="82" Height="82" Stroke="#FFF28C12" Canvas.Left="210"&lt;br /&gt;Canvas.Top="90"&amp;gt;&lt;br /&gt;&amp;lt;Rectangle.Fill&amp;gt;&lt;br /&gt;&amp;lt;LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5"&amp;gt;&lt;br /&gt;&amp;lt;GradientStop Color="#FFF28C12" Offset="0"/&amp;gt;&lt;br /&gt;&amp;lt;GradientStop Color="#FFFFFFFF" Offset="1"/&amp;gt;&lt;br /&gt;&amp;lt;/LinearGradientBrush&amp;gt;&lt;br /&gt;&amp;lt;/Rectangle.Fill&amp;gt;&lt;br /&gt;&amp;lt;/Rectangle&amp;gt;&lt;br /&gt;&lt;br /&gt;One thing to remember is that a brush can be used to paint solid colors, gradients, images, and even video. The ability to paint with images is fairly common among various graphic design tools, however the ability to paint with video is available only in a very few elite graphic tools. One example of such an elite graphich tool is the Expression Blend. Expression Blend currently supports both image and video brushes but only for WPF applications and not for the Silverlight applications.&lt;br /&gt;However, it's very easy to create an image brush fill as shown in the code below-&lt;br /&gt;&amp;lt;Ellipse Width="200" Height="200" Stroke="#FFD89623" StrokeThickness="4" Canvas.Left="10" Canvas.Top="10"&amp;gt;&lt;br /&gt;            &amp;lt;Ellipse.Fill&amp;gt;&lt;br /&gt;                        &amp;lt;ImageBrush ImageSource="bread.jpg" /&amp;gt;&lt;br /&gt;            &amp;lt;/Ellipse.Fill&amp;gt;&lt;br /&gt;&amp;lt;/Ellipse&amp;gt;&lt;br /&gt;&lt;br /&gt;The result of the above code is shown in the figure below-&lt;br /&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5300395100776186946" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 336px; CURSOR: hand; HEIGHT: 392px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_ww9l4AwRrmg/SY7JQu78REI/AAAAAAAAAEE/glFSYH56xFw/s400/Brushes_Example.JPG" border="0" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-2368804738052210212?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/2368804738052210212/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=2368804738052210212' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/2368804738052210212'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/2368804738052210212'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2009/02/silverlight-brushes.html' title='Silverlight Brushes'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_ww9l4AwRrmg/SY7JQu78REI/AAAAAAAAAEE/glFSYH56xFw/s72-c/Brushes_Example.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-633254439735751520</id><published>2009-01-29T06:23:00.000-08:00</published><updated>2009-01-29T06:40:47.188-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight graphics'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight drawing'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight geometry'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight path'/><title type='text'>Paths and Geometries</title><content type='html'>The Path object is also derived from the Shape object, with a difference that the Path object has no defined shape. Instead, a Path accepts an indirect or an abstract definition of a shape to define how the Path is rendered. The Geometry class defines how a Shape is rendered. There exists only one Path class but many types of Geometry classes exists. The Geometry class itself is an abstract class and hence cannot be directly instantiated so one of its child classes must be instantiated.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The Path class can be used to define simple shapes like lines, rectangles and ellipses in the same manner as the Line,Rectangle and Ellipse classes respectively, however the PathGeometry class is used to create more complex shapes. Creating the paths can be rather tricky by hand coding the path coordinates directly in XAML. When using a design tool, such as the Blend, paths are created as a combination of simpler elements or freehand by using a pen or pencil tool. The code below shows several path elements that were used in Blend when a sketchy little stick man was quickly drawn with the pencil tool.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;Path&lt;br /&gt;Width="36.943"&lt;br /&gt;Height="40"&lt;br /&gt;Fill="#FFFFFFFF"&lt;br /&gt;Stretch="Fill"&lt;br /&gt;Stroke="#FF000000"&lt;br /&gt;Canvas.Left="100"&lt;br /&gt;Canvas.Top="20"&lt;br /&gt;Data="M98,41 C94.367387,42.623083 91.686629,43.473339 88,44 88,44.666667 88,45.333333 88,46 87,46 86,46 85,46 85,46.666667 85,47.333333 85,48 84,48 83,48 82,48 82,62.686511 69.161892,80 102,80 113.81515,80 126.94836,63.615905 98,41 z"/&amp;gt;&lt;br /&gt;&amp;lt;Path&lt;br /&gt;Width="30"&lt;br /&gt;Height="76"&lt;br /&gt;Fill="#FFFFFFFF"&lt;br /&gt;Stretch="Fill"&lt;br /&gt;Stroke="#FF000000"&lt;br /&gt;Canvas.Left="76.472"&lt;br /&gt;Canvas.Top="61"&lt;br /&gt;Data="M99,78 C99.621745,91.056649 101.88843,103.66122 103,117 103.49483,122.93794 105,127.98987 105,134 105,144.96507 85,133.97906 85,148 80.579426,148 79.654844,149.9753 76,153"/&amp;gt;&lt;br /&gt;&amp;lt;Path&lt;br /&gt;Width="19"&lt;br /&gt;Height="14"&lt;br /&gt;Fill="#FFFFFFFF"&lt;br /&gt;Stretch="Fill"&lt;br /&gt;Stroke="#FF000000"&lt;br /&gt;Canvas.Left="102.472"&lt;br /&gt;Canvas.Top="123"&lt;br /&gt;Data="M102,140 C109.69438,144.23843 113.25082,146.41746 120,153"/&amp;gt;&lt;br /&gt;&amp;lt;Path&lt;br /&gt;Width="43"&lt;br /&gt;Height="4"&lt;br /&gt;Fill="#FFFFFFFF"&lt;br /&gt;Stretch="Fill"&lt;br /&gt;Stroke="#FF000000"&lt;br /&gt;Canvas.Left="77.472"&lt;br /&gt;Canvas.Top="87"&lt;br /&gt;Data="M77,104 C91.163884,104.69658 105.26923,106.05954 119,107"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5296723535423446450" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 393px; CURSOR: hand; HEIGHT: 400px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_ww9l4AwRrmg/SYG9_gJdnbI/AAAAAAAAAD8/xoKqXEIRBRM/s400/Drawing.JPG" border="0" /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;There exists several types of geometries that can be utilized with a path which includes a LineGeometry, a RectangleGeometry, an EllipseGeometry, and a PathGeometry. The PathGeometry has the ability to compile complex shapes from multiple path segments. Path segments include arcs, bazier curves, lines and variations of each of these.&lt;br /&gt;Here above, the path geometry is used in shorthand form. The Path object includes an attribute named the Data attribute, which accepts multiple coordinates to define points along the path. On giving a closer look, we will notice that the Data attribute value also contains characters such as "M" or "C". This Data attribute value is actually a mini markup language and the characters are very meaningful and are also case-sensitive. For example, an uppercase "M" signifies a move command and the coordinates that follow indicate the path of the movement.&lt;/p&gt;&lt;p&gt;So, I hope you guys are enjoying the graphics work out here in silverlight. :-)&lt;/p&gt;&lt;p&gt;Just keep in touch with this article, you are going to learn a lots of interesting features about silverlight.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-633254439735751520?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/633254439735751520/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=633254439735751520' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/633254439735751520'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/633254439735751520'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2009/01/paths-and-geometries.html' title='Paths and Geometries'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_ww9l4AwRrmg/SYG9_gJdnbI/AAAAAAAAAD8/xoKqXEIRBRM/s72-c/Drawing.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-7421592437135488660</id><published>2009-01-17T22:08:00.000-08:00</published><updated>2009-01-17T22:17:40.336-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight rectangle'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight drawing'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='rectangle'/><category scheme='http://www.blogger.com/atom/ns#' term='drawing rectangle'/><title type='text'>Rectangles</title><content type='html'>The Rectangle class is used for drawing rectangles in Silverlight. The code below describes how to draw two rectangles, a larger, blue rectangle in the background and a smaller, orange rectangle on top of it&lt;br /&gt;&amp;lt;Rectangle Width="250" Height="130" Stroke="#FF000000" Canvas.Left="50" Canvas.Top="50"&amp;gt;&lt;br /&gt;&amp;lt;Rectangle.Fill&amp;gt;&lt;br /&gt;&amp;lt;LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5"&amp;gt;&lt;br /&gt;&amp;lt;GradientStop Color="#FF000000" Offset="0"/&amp;gt;&lt;br /&gt;&amp;lt;GradientStop Color="#FF6867D2" Offset="1"/&amp;gt;&lt;br /&gt;&amp;lt;/LinearGradientBrush&amp;gt;&lt;br /&gt;&amp;lt;/Rectangle.Fill&amp;gt;&lt;br /&gt;&amp;lt;/Rectangle&amp;gt;&lt;br /&gt;&amp;lt;Rectangle Width="82" Height="82" Stroke="#FFF28C12" Canvas.Left="210" Canvas.Top="90"&amp;gt;&lt;br /&gt;&amp;lt;Rectangle.Fill&amp;gt;&lt;br /&gt;&amp;lt;LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5"&amp;gt;&lt;br /&gt;&amp;lt;GradientStop Color="#FFF28C12" Offset="0"/&amp;gt;&lt;br /&gt;&amp;lt;GradientStop Color="#FFFFFFFF" Offset="1"/&amp;gt;&lt;br /&gt;&amp;lt;/LinearGradientBrush&amp;gt;&lt;br /&gt;&amp;lt;/Rectangle.Fill&amp;gt;&lt;br /&gt;&amp;lt;/Rectangle&amp;gt;&lt;br /&gt;&lt;br /&gt;Just as in the case of ellipse, when modifing the size of a rectangle using Blend, if we want to draw a square or maintain the current ratio of the rectangle's height and width, hold down the shift key.The result of the markup above is shown in the figure below.&lt;br /&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5292513386981730930" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 393px; CURSOR: hand; HEIGHT: 400px; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_ww9l4AwRrmg/SXLI4nALqnI/AAAAAAAAAD0/3PHwBFqH5pc/s400/Rectangle.JPG" border="0" /&gt;&lt;br /&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;Keep in touch. As you are going to see a lot many interesting features of Silverlight soon in the coming sessions.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-7421592437135488660?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/7421592437135488660/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=7421592437135488660' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/7421592437135488660'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/7421592437135488660'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2009/01/rectangles.html' title='Rectangles'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_ww9l4AwRrmg/SXLI4nALqnI/AAAAAAAAAD0/3PHwBFqH5pc/s72-c/Rectangle.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-2368500688043194386</id><published>2009-01-09T12:45:00.000-08:00</published><updated>2009-01-09T12:51:34.581-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight drawing'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight architecture'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight framework'/><category scheme='http://www.blogger.com/atom/ns#' term='drawing ellipse in silverlight'/><title type='text'>Silverlight Graphics - Drawing Ellipse</title><content type='html'>&lt;strong&gt;Ellipses&lt;br /&gt;&lt;/strong&gt;Ellipse object is used to draw round objects in Silverlight. The circular characteristics of an ellipse are defined by specifying its height and width. The markup snippet shown below draws an oval ellipse with a blue gradient fill and a stroke of 4&lt;br /&gt;&lt;ellipse width="226" height="124" stroke="#FF000000" strokethickness="4" left="8" top="8"&gt;&amp;lt;Ellipse Width="226" Height="124" Stroke="#FF000000" StrokeThickness="4" Canvas.Left="8" Canvas.Top="8&amp;gt;&lt;br /&gt;            &amp;lt;Ellipse.Fill&amp;gt;&lt;br /&gt;                        &amp;lt;LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5&amp;gt;&lt;br /&gt;&amp;lt;GradientStop Color="#FFD9EAF0" Offset="0"/&amp;gt;&lt;br /&gt;                                    &amp;lt;GradientStop Color="#FF126D8E" Offset="1"/&amp;gt;&lt;br /&gt;                        &amp;lt;LinearGradientBrush &amp;gt;&lt;br /&gt;            &amp;lt;Ellipse.Fill&amp;gt;&lt;br /&gt;&amp;lt;Ellipse&amp;gt;&lt;br /&gt;Sometimes, it may be tough to create an exact circle by using a graphical design tool, such as Blend. A key point to note when creating a circle is to ensure that the sllipse is provided with the same value for its height and width. To create a circle using Blend, while modifying the size of the ellipse, press the Shift key. The code below creates a circle with a diameter of 100 pixel., a stroke of 4 having a yellow color and with the fill color as green.&lt;br /&gt;&lt;ellipse width="100" height="100" stroke="#FFEAEC19" strokethickness="4" left="260" top="110"&gt;&amp;lt;Ellipse Width="100" Height="100" Stroke="#FFEAEC19" StrokeThickness="4" Canvas.Left="260" Canvas.Top="110&amp;gt;&lt;br /&gt;            &amp;lt;Ellipse.Fill&amp;gt;&lt;br /&gt;                        &amp;lt;LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5&amp;gt;&lt;br /&gt;                                    &amp;lt;GradientStop Color="#FFD9EAF0" Offset="0"/&amp;gt;&lt;br /&gt;                                    &amp;lt;GradientStop Color="#FF247016" Offset="1"/&amp;gt;&lt;br /&gt;                        &amp;lt;LinearGradientBrush &amp;gt;&lt;br /&gt;            &amp;lt;Ellipse.Fill&amp;gt;&lt;br /&gt;&amp;lt;Ellipse&amp;gt;&lt;br /&gt;The combined result of the two ellipse definitions above is shown in the figure below-&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;img id="BLOGGER_PHOTO_ID_5289398560061699138" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 374px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_ww9l4AwRrmg/SWe390fwtEI/AAAAAAAAADk/2IN4vh78IZU/s400/Ellipse.JPG" border="0" /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-2368500688043194386?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/2368500688043194386/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=2368500688043194386' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/2368500688043194386'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/2368500688043194386'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2009/01/silverlight-graphics-drawing-ellipse.html' title='Silverlight Graphics - Drawing Ellipse'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_ww9l4AwRrmg/SWe390fwtEI/AAAAAAAAADk/2IN4vh78IZU/s72-c/Ellipse.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-2018155577602024864</id><published>2009-01-08T10:29:00.000-08:00</published><updated>2009-01-08T10:38:38.086-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight graphics'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight drawing'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='drawing in silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='drawing line in silverlight'/><title type='text'>Silverlight Graphics- Drawing Lines</title><content type='html'>&lt;strong&gt;Graphic Elements&lt;br /&gt;&lt;/strong&gt;In Silverlight, drawing is accomplished through the use of graphic elements like an ellipse or a rectangle. All the graphic elements in Silverlight extend the Shape type.&lt;br /&gt;Hence, all Shape type objects in Silverlight include some common functionalities, which are listed below-&lt;br /&gt;· &lt;strong&gt;Stroke&lt;/strong&gt;- defines the outline of the shape.&lt;br /&gt;· &lt;strong&gt;StrokeThickness&lt;/strong&gt;- defines the thickness of the stroke ie the thickness of the outline of the shape.&lt;br /&gt;· &lt;strong&gt;Fill&lt;/strong&gt;- defines in what way the interior of the shape is filled or painted.&lt;br /&gt;In addition to this, the shape objects can be positioned on the canvas of the silverlight by using the properties of the canvas ie Canvas.Top and Canvas.Left.&lt;br /&gt;&lt;strong&gt;Lines&lt;/strong&gt;&lt;br /&gt;Line object is used to draw lines in silverlight. A line can be drawn easily on the canvas with the help of Blend and can be created directly in XAML using Visual Studio 2008. Geametrically, a line is defined through the definition of its two end points. Each point is defined as a combination of an X coordinate and a Y coordinate.&lt;br /&gt;The code provided below is used to draw a red coloured diagonal line from 20,20 to 120,120.&lt;br /&gt;&lt;line x1="20" y1="20" x2="120" y2="120" stroke="#FFC53737" strokethickness="2" rendertransformorigin="0.595,0.416" width="158" height="125" fill="#FFD63737"&gt;&lt;line x1="20" y1="20" x2="120" y2="120" stroke="#FFC53737" strokethickness="2" rendertransformorigin="0.595,0.416" width="158" height="125" fill="#FFD63737"&gt;&amp;lt;Line&lt;br /&gt;X1="20" Y1="20"&lt;br /&gt;X2="120" Y2="120"&lt;br /&gt;Stroke="#FFC53737"&lt;br /&gt;StrokeThickness="2"&lt;br /&gt;RenderTransformOrigin="0.595,0.416"&lt;br /&gt;Width="158"&lt;br /&gt;Height="125"&lt;br /&gt;Fill="#FFD63737" /&gt;&lt;br /&gt;The canvas resulting from the above code is shown below-&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5288992591341977170" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 374px; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_ww9l4AwRrmg/SWZGvVKcflI/AAAAAAAAADU/cO6J0jQm9ks/s400/silverlightgraphics.JPG" border="0" /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Lots of more interesting things in Silverlight graphics yet to come, so just stay in touch and enjoy learning silverlight.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-2018155577602024864?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/2018155577602024864/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=2018155577602024864' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/2018155577602024864'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/2018155577602024864'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2009/01/silverlight-graphics-drawing-lines.html' title='Silverlight Graphics- Drawing Lines'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_ww9l4AwRrmg/SWZGvVKcflI/AAAAAAAAADU/cO6J0jQm9ks/s72-c/silverlightgraphics.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-5166585826967486550</id><published>2009-01-06T10:44:00.000-08:00</published><updated>2009-01-06T10:47:53.811-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight graphics'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight drawing'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='drawing in silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><title type='text'>Drawing Graphics</title><content type='html'>Silverlight is referred to as a subset of WPF as applied by using principles of an extended ASP.NET AJAX and as such, Silverlight implements many of the features that are included in WPF. For example, with Silverlight, we can draw two-dimensional (2D) graphics in applications. Graphics of this caliber with such good quality are more than adequate for most user interfaces and applications, particularly business applications. However, there are many applications that require more elaborate graphic capabilities, such as three-dimensional graphics (3D). For example, an engineering application may benefit a lot from 3D graphics in the user interface as compare to a 2D graphics.Whilst WPF provides 3D graphics but currently Silverlight doesn't support it currently.&lt;br /&gt;To provide 3D graphics, an application needs to utilize the hardware of the local workstation and the facilities of the local operating system. Silverlight is designed as a cross-platform and cross-browser compliant ie Silverlight is designed in such a way that it is both platform independent and browser independent. With that in mind, it is not possible to tied Silverlight to any particular hardware configuration, operating system, or browser. This design coincides very well with the design goals of Silverlight but does not aim towards rendering 3D graphics.&lt;br /&gt;So, silverlight doesn't support 3D graphics currently, but may be a future version of Silverlight finds a way to support 3D graphics.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-5166585826967486550?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/5166585826967486550/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=5166585826967486550' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/5166585826967486550'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/5166585826967486550'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2009/01/drawing-graphics.html' title='Drawing Graphics'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-6630004766749635764</id><published>2009-01-03T22:31:00.000-08:00</published><updated>2009-01-03T22:34:57.504-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight animation'/><category scheme='http://www.blogger.com/atom/ns#' term='animation in silverlight'/><title type='text'>Animation in Silverlight</title><content type='html'>&lt;strong&gt;The Importance of an Impressive and User Friendly User Interface&lt;/strong&gt;&lt;br /&gt;Many big companies such as Microsoft and others have invested a huge amount of money in software research and development. The major factors that influence the end users are performance and the user interface. It is natural that the users will appreciate those websites that have a good user interface and hence user friendly. And hence the software developers and continuously trying harder and harder to improve the application's performance.&lt;br /&gt;We can also describe this whole phenomena in the language of marketing. The more a user is impressed with the performance of the website, the more the user will visit that site and also more will be the chances that the user will refer this site to others and hence will result in a greater number of visitors. This section revolves around the ways to create an impressive and user friendly user interface. In the coming sections, you will be introduced with animation in silverlight.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-6630004766749635764?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/6630004766749635764/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=6630004766749635764' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/6630004766749635764'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/6630004766749635764'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2009/01/animation-in-silverlight.html' title='Animation in Silverlight'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-5438786631218566594</id><published>2008-12-13T00:37:00.000-08:00</published><updated>2008-12-13T00:57:24.801-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='Data Access in SIlverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='LINQ'/><title type='text'>Language Integrated Query (LINQ)</title><content type='html'>LINQ has the capability to query any object programmatically that implements the IEnumerable interface. LINQ will the .NET developers with an entirely new programming paradigm but the new functionality and benefits thereof should be quickly accepted and adapted by most.&lt;br /&gt;For an example, we'll create the same example described above but here we will utilize LINQ in the Web service to access data stored in SQL Server 2005 as well as in the code behind in the Silverlight application to iterate through the results.&lt;br /&gt;The first step to create a version of the Web service that utilizes LINQ for accessing data that is stored in SQL Server 2005 is to create a new ASP.NET Futures Web site, add a new Web service to the project, and then add a new LINQ to SQL Class to the project as shown in the figure below-&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5279193986732214610" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 300px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_ww9l4AwRrmg/SUN29eeNSVI/AAAAAAAAAC0/962xiSt02Js/s400/1.JPG" border="0" /&gt;&lt;br /&gt;Note here that the LINQ to SQL Class object has a .dbml extension (database modeling language). After adding a LINQ to SQL class, create data classes by dragging the required tables from the Server Explorer to the class design area. The figure below shows the class in which the Pets table is added-&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5279194852056544130" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 242px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_ww9l4AwRrmg/SUN3v2Dms4I/AAAAAAAAADM/J-n7qGKgmDo/s400/2.JPG" border="0" /&gt;&lt;br /&gt;The simplified version of the Web method that utilizes the LINQ to retrieve the pet information from SQL Serve 2005 is shown in the code below-&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.Services;&lt;br /&gt;using System.Web.Services.Protocols;&lt;br /&gt;using System.Xml.Linq;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary description for PetService&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;&lt;br /&gt;[WebService(Namespace = "http://tempuri.org/")]&lt;br /&gt;[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]&lt;br /&gt;[System.Web.Script.Services.ScriptService]&lt;br /&gt;public class PetService : System.Web.Services.WebService&lt;br /&gt;{&lt;br /&gt;public PetService ( )&lt;br /&gt;{&lt;br /&gt;//Uncomment the following line if using designed components&lt;br /&gt;//InitializeComponent();&lt;br /&gt;}&lt;br /&gt;[WebMethod]&lt;br /&gt;public List&lt;string&gt; GetPetInfo()&lt;br /&gt;{&lt;br /&gt;List&lt;string&gt; petInfo = new List&lt;string&gt;();&lt;br /&gt;PetClassesDataContext petsDB = new PetClassesDataContext();&lt;br /&gt;var pets = from pet in petsDB.Pets&lt;br /&gt;select pet;&lt;br /&gt;foreach (var pet in pets)&lt;br /&gt;{&lt;br /&gt;petInfo.Add("My pet is named " + pet.Name + ". It is a " + (pet.Gender == true ? "male" : "female") + " " + pet.Breed + " that weighs " + pet.Weight + " pounds. " + pet.Notes + " ");&lt;br /&gt;}&lt;br /&gt;return petInfo;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;This code now utilizes the DataContext class that is created from the LINQ to SQL Class template and exposes the database to our code. The main benefit here is that now the developers no longer have to master SQL and other database languages and still can query and manage data stored in databases in the same manner as data stored in any type of programmatic collection. Additionally, the above code is also more compact. The second line of the code is a query that is similar to a "Select * From Pets" SQL query od SQL where each item retrieved correlates to a row in the source database.&lt;br /&gt;Utilizing LINQ benifits not only the Web service that resides on the server but also the Silverlight application. The event handler in the code behind of the Silverlight application that calls the Web method is shown in the code below after being converted to LINQ.&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Windows;&lt;br /&gt;using System.Windows.Controls;&lt;br /&gt;using System.Windows.Documents;&lt;br /&gt;using System.Windows.Ink;&lt;br /&gt;using System.Windows.Input;&lt;br /&gt;using System.Windows.Media;&lt;br /&gt;using System.Windows.Media.Animation;&lt;br /&gt;using System.Windows.Shapes;&lt;br /&gt;namespace EXAMPLELINQ&lt;br /&gt;{&lt;br /&gt;public partial class Page : Canvas&lt;br /&gt;{&lt;br /&gt;public void Page_Loaded(object o, EventArgs e)&lt;br /&gt;{&lt;br /&gt;// Required to initialize variables&lt;br /&gt;InitializeComponent();&lt;br /&gt;}&lt;br /&gt;public void GetPetInfo(object o, MouseEventArgs e)&lt;br /&gt;{&lt;br /&gt;EXAMPLELINQ .localhost.PetService svc = new EXAMPLELINQ.localhost.PetService();&lt;br /&gt;IEnumerable&lt;string&gt; pets = from petInfo in svc.GetPetInfo()&lt;br /&gt;select petInfo;&lt;br /&gt;// Display the results.&lt;br /&gt;foreach (string pet in pets)&lt;br /&gt;{&lt;br /&gt;tbOutput.Text += pet;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;Its clearly visible that the LINQ code is much more compact and intuitive. The resulting Silverlight page for this code is exactly the same using the LINQ versions as the non-LINQ versions.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Stay tune with this website because a lot of more interesting things coming up for u soon.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-5438786631218566594?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/5438786631218566594/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=5438786631218566594' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/5438786631218566594'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/5438786631218566594'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2008/12/language-integrated-query-linq.html' title='Language Integrated Query (LINQ)'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_ww9l4AwRrmg/SUN29eeNSVI/AAAAAAAAAC0/962xiSt02Js/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-2600084318639798627</id><published>2008-11-28T12:51:00.000-08:00</published><updated>2008-11-28T12:55:00.872-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='wpf'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='LINQ'/><category scheme='http://www.blogger.com/atom/ns#' term='Language Integrated Query'/><title type='text'>Language Integrated Query (LINQ)</title><content type='html'>Sorry for the delay again I have come up with an interesting topic that is an integral part of Silverlight-&lt;br /&gt;&lt;strong&gt;Language Integrated Query(LINQ)&lt;/strong&gt;&lt;br /&gt;Language Integrated Query (LINQ) is one of the most important additions in the .NET Framework in version 3.5. Most of the developers are familiar with Structured Query Language (SQL). SQL is used to query relational database data ie to perform operations on the data of the relational database. However, sometimes, the SQL queries that retrieve data from a relational database schema are abstracted away from business logic and middle-tier code. Furthermore, the representation of the data at the business logic and code level is generally through objects, arrays, and collections. So the developers have to regularly search for these constructs using the tailor-made loops.&lt;br /&gt;            From a long time, it has been a requirement for many programmers to have a language which can be used for querying data stored in programming constructs and object oriented mechanisms. One stable and well-entrenched industry standard is the SQL. It would be impossible to extend SQL so that it could be used to query programming constructs. However, Microsoft's ambition was to make things easier for programmers by creating a standard for querying data stored in coding constructs. Their efforts resulted in a new query language that targets data stored in objects and collections, which was named Language Integrated Query (LINQ). Moreover, LINQ was also extended to query relational database, XML data, and other data sources to fetch data stored in them. One thing to keep in mind here is that, data queried by using LINQ must be stored as objects. If  LINQ is used to query data from a relational data source, then the data must first be represented using an object model.&lt;br /&gt;Keep in touch for more details, lots of interesting things to come up.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-2600084318639798627?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/2600084318639798627/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=2600084318639798627' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/2600084318639798627'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/2600084318639798627'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2008/11/language-integrated-query-linq.html' title='Language Integrated Query (LINQ)'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-8936290304641874165</id><published>2008-09-30T06:22:00.000-07:00</published><updated>2008-09-30T06:33:59.284-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='Data Access in SIlverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='Data access'/><title type='text'>Data Access By Using SOA</title><content type='html'>One more thing to remember is that the Silverlight application can be added to the same project as the Web service that will be called. This ensures 2 things, firstly this ensures that both the Silverlight application and the Web service reside in the same domain and secondly this ensures that the Silverlight application can easily be tested using the Visual Studio 2008.The figure shown below illustrates a Silverlight XAML file designed to consume pet information from the Web method shown above and display it in a TextBlock-&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5251805344387750178" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_ww9l4AwRrmg/SOIpIq262SI/AAAAAAAAACc/ne0daZgab3U/s400/1.JPG" border="0" /&gt;&lt;br /&gt;We can add a Web reference to the Silverlight application to reference the Web service. After this, the Get Pet Information region can be clicked to fire an event handler that calls the Web service and displays the results in the TextBlock. The XAML code shown below is used to generate the page shown above-&lt;canvas class="PetInformationClient.Page;assembly=" height="300" width="600" loaded="Page_Loaded" name="ParentCanvas" x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/client/2007"&gt;&lt;canvas.background&gt; &lt;lineargradientbrush startpoint="0.502,1.375" endpoint="0.498,-0.375"&gt;&lt;gradientstop offset="0" color="#FFFFFFFF"&gt;&lt;gradientstop offset="1" color="#FFA3A535"&gt;&lt;/lineargradientbrush&gt;&lt;/CANVAS.BACKGROUND&gt;&lt;path height="1" width="515" data="M24,40 L536,40" top="40" left="24" strokethickness="0.5" stroke="#FF000000" stretch="Fill" fill="#FFFFFFFF"&gt;&lt;textblock height="230" width="514" top="55" left="25" textwrapping="Wrap"&gt;&lt;run name="tbOutput" fontweight="Normal" fontsize="12" fontfamily="Segoe UI"&gt;&lt;/textblock&gt;&lt;canvas height="25" width="180" name="canvasGetPetInfo" top="12" left="24" mouseleftbuttonup="GetPetInfo" cursor="Hand"&gt;&lt;rectangle height="25" width="170" strokethickness="1" stroke="#FFD4A524" radiusy="5" radiusx="5"&gt;&lt;rectangle.fill&gt;&lt;lineargradientbrush startpoint="0.495,-3.01" endpoint="0.505,4.01"&gt;&lt;gradientstop offset="0.301" color="#FF000000"&gt;&lt;gradientstop offset="0.737" color="#00FFFFFF"&gt;&lt;/lineargradientbrush&gt;&lt;/RECTANGLE.FILL&gt;&lt;/rectangle&gt;&lt;textblock height="25" width="170" top="1" left="10" textwrapping="Wrap"&gt;&lt;run fontsize="16" fontfamily="Segoe UI" text="Get Pet Information"&gt;&lt;/textblock&gt;&lt;/canvas&gt;&lt;/canvas&gt;Finally, the code below shows the event handler for the canvas that calls the Web service-using System; using System.Collections.Generic; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Ink; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; namespace PetInformationClient {public partial class Page : Canvas {public void Page_Loaded(object o, EventArgs e) {// Required to initialize variables InitializeComponent(); }public void GetPetInfo(object o, MouseEventArgs e) { PetInformationClient.localhost.PetService svc = new PetInformationClient.localhost.PetService(); string[] petInfo = svc.GetPetInfo(); // Display the results. for (int i = 0; i &lt; petInfo.Length; i++) {tbOutput.Text += petInfo[i].ToString(); } }}}To test the Web service call from the Silverlight application, the next step that we have to do is to add the Silverlight link to the ASP.NET Futures project and then add the asp:Xaml element to the Default.aspx test page. Now, run this application to test it, by pressing F5. The resulting Silverlight application will display the following figure-&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5251806257821480050" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_ww9l4AwRrmg/SOIp91qfdHI/AAAAAAAAACk/sOWn8hNewoU/s400/2.JPG" border="0" /&gt;&lt;br /&gt;This illustrates calling a Web service to retrieve data from a database through a Silverlight application. The Silverlight application could collect data and insert, update, or delete data in the database with the same ease. The Web service being called could also perform any valid Web service operation which also includes calling other Web services in other domains.&lt;br /&gt;     More interesting topics with lots of knowledgable content to come. So keep in touch with the site.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-8936290304641874165?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/8936290304641874165/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=8936290304641874165' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/8936290304641874165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/8936290304641874165'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2008/09/data-access-by-using-soa_30.html' title='Data Access By Using SOA'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_ww9l4AwRrmg/SOIpIq262SI/AAAAAAAAACc/ne0daZgab3U/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-5262233940660567366</id><published>2008-09-18T12:00:00.000-07:00</published><updated>2008-09-18T12:04:42.773-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='wpf'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='Data Access in SIlverlight'/><title type='text'>Accessing Data Using Silverlight</title><content type='html'>When the Silverlight application calls the service, this service may take the form of a standard ASP.NET Web service or a WCF service. Like we already discussed earlier, the ASP.NET Futures Web site project is designed exactly to test the Web service calls from a Silverlight application. Once we have created a new ASP.NET Futures Web site, a Web service can be added to this project and this service can be directed to transport data by using JSON. The Web method shown below is used to connect to the SQL Server database and return the results in an ArrayList. An ArrayList can be sized dynamically and is also serializable. To return database results, the return value for a Web method that is most commonly used is an Ado.Net Dataset. But since datasets are currently not supported, ArrayList will do the work here.&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Data;&lt;br /&gt;using System.Data.SqlClient;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Configuration;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.Configuration;&lt;br /&gt;using System.Web.Services;&lt;br /&gt;using System.Web.Services.Protocols;&lt;br /&gt;using System.Xml.Linq;&lt;br /&gt;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary description for PetService&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;[WebService(Namespace = "http://tempuri.org/")]&lt;br /&gt;[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]&lt;br /&gt;[System.Web.Script.Services.ScriptService]&lt;br /&gt;public class PetService : System.Web.Services.WebService&lt;br /&gt;{&lt;br /&gt;            public PetService ()&lt;br /&gt;            {&lt;br /&gt;                        //Uncomment the following line if using designed components&lt;br /&gt;                        //InitializeComponent();&lt;br /&gt;            }&lt;br /&gt;            [WebMethod]&lt;br /&gt;            public List&lt;string&gt; GetPetInfo()&lt;br /&gt;            {         &lt;br /&gt;                        // Connect to the database.&lt;br /&gt;                        using (SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["SQLExpress"].ConnectionString))&lt;br /&gt;                        {&lt;br /&gt;                                    // Query the pet information.&lt;br /&gt;                                    using (SqlCommand cmd = new SqlCommand("Select Name, Breed, Gender, Weight, Notes From Pets", cn))&lt;br /&gt;                                    {&lt;br /&gt;                                                cn.Open();&lt;br /&gt;                                                List&lt;string&gt; petInfo = new List&lt;string&gt;();&lt;br /&gt;                                                SqlDataReader dr = cmd.ExecuteReader();&lt;br /&gt;                                                while (dr.Read())&lt;br /&gt;                                                {&lt;br /&gt;                                                            petInfo.Add("My pet is named " + dr["Name"].ToString() + ". It is a " + (dr["Gender"].ToString() == "True" ? "male" :                                                    "female") + " " + dr["Breed"].ToString() + " that weighs " + dr["Weight"].ToString() + " pounds. " + dr["Notes"] + " ");&lt;br /&gt;                                                }&lt;br /&gt;                                                dr = null;&lt;br /&gt;                                                return petInfo;&lt;br /&gt;                                    }&lt;br /&gt;                        }         &lt;br /&gt;            }         &lt;br /&gt;}&lt;br /&gt; Stay tune for more information. Theres a lot more to come for u, so stay connected.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-5262233940660567366?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/5262233940660567366/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=5262233940660567366' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/5262233940660567366'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/5262233940660567366'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2008/09/accessing-data-using-silverlight.html' title='Accessing Data Using Silverlight'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-1451645300707086401</id><published>2008-09-09T07:57:00.000-07:00</published><updated>2008-09-09T08:02:34.233-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='Data Access in SIlverlight'/><title type='text'>Data Access By Using SOA</title><content type='html'>Sorry for the delay in posting the articles, be sure to keep in touch with the articles now.&lt;br /&gt;As discussed earlier, Silverlight application can make calls to a server by calling a Web service. Currently the calls that are made to a Web service from a Silverlight application can transport data by using plain old XML (POX) or JSON. In addition to this, a Web service that is being called by a Silverlight application must currently reside in the same domain as the Silverlight application. This restriction which is imposed as a security precaution, limits the ability of the Silverlight application to make calls to Web services, however, it does not limit what a Web service being called by the Silverlight application can do. A Web service being called by a Silverlight application acts as a proxy for the Silverlight application and can make calls to any resource on behalf of this Silverlight application and return the results. For example, a Silverlight application may call a Web service that resides in the same domain in which the application resides and that service may, in turn, call another Web service residing outside of the domain or it may also query a database. This method to retrieve server resources is the standard method that is available for a Silverlight application.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-1451645300707086401?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/1451645300707086401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=1451645300707086401' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/1451645300707086401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/1451645300707086401'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2008/09/data-access-by-using-soa.html' title='Data Access By Using SOA'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-668762823139135534</id><published>2008-08-30T09:37:00.000-07:00</published><updated>2008-08-30T09:41:02.561-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='wpf'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='Data Access in SIlverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='Data access'/><title type='text'>Accessing Data Using Silverlight</title><content type='html'>&lt;span style="font-size:85%;"&gt;&lt;strong&gt;Accessing Data&lt;/strong&gt;&lt;br /&gt;Remember that data stored in a database typically resides on a remote server where as a Silverlight application resides on a client workstation. In order to retrieve data from a database that resides on a remote server, requests must be sent to the server to retrieve that data just as with any other Web application. There are several methods that can be used to work with data in Silverlight as discussed below-&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Isolated Storage&lt;/strong&gt;&lt;br /&gt;Because of the security constraints that are placed upon a Silverlight application (the "sandbox" that it operates in), a Silverlight application cannot read files from the client machine unless they are stored in the same isolated storage. Thats why, a Silverlight application is fairly limited in its capability to store data locally, however simple files can be created to store simple data and settings.&lt;br /&gt;Silverlight application can have XML files deployed with them but they must have their build action set to Embedded Resource so that when the application is built, the XML files are compiled into the assembly. This makes the ability to modify the file somewhat limited and also limits the ability for the file to contain dynamic data that is shared with other users of the application.&lt;br /&gt;Silverlight includes classes to work with XML, however these classes are designed to read an incoming XML string (such as that coming from a call to a Web service) and not reading XML from a file.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-668762823139135534?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/668762823139135534/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=668762823139135534' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/668762823139135534'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/668762823139135534'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2008/08/accessing-data-remember-that-data.html' title='Accessing Data Using Silverlight'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-5941169704733959643</id><published>2008-08-13T08:00:00.000-07:00</published><updated>2008-08-13T08:08:52.529-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='Serialization'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='Data access'/><title type='text'>Accessing Data Using Silverlight</title><content type='html'>This section will introduce the reader with the ability of Silverlight application to play various types of multimedia sources.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Serialization&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;     As we all know, the web is stateless. In a typical Web communication, a client makes a request for a resource by passing a message to the Web server. The Web server, in turn, responds with a response message to the client and the messages continue to be sent back and forth between the client and server to conduct the communications necessary to deliver an application. The messages that are sent between the client and the server are simple text messages. The question that rise here is that how the more complex items like images, graphs, animations and multimedia get transported from a web server to a client? The answer is simple, all the items that are to be transported over the Web are first converted to text, then transported over the Web, then recreated from the text representation of the item. The process of converting a complex item to a text representation is known as serialization.&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;     The reverse of this process, i.e converting an item from a text representation back to the original object is known as deserialization. The most common formats to convert an item for transportation over the Web are XML, SOAP, and JSON. The .NET Framework on the server side and that included in Silverlight, both include facilities for serializing and deserializing the data.&lt;br /&gt;  You will be getting some more essential information in the next few sessions and I really hope you are enjoying your step by step tutorial for Silverlight.&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-5941169704733959643?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/5941169704733959643/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=5941169704733959643' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/5941169704733959643'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/5941169704733959643'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2008/08/accessing-data-using-silverlight.html' title='Accessing Data Using Silverlight'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-7850701617983109947</id><published>2008-08-08T07:28:00.000-07:00</published><updated>2008-08-08T07:47:04.363-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='xaml'/><title type='text'>The asp:Xaml Control</title><content type='html'>&lt;span style="font-size:85%;"&gt;Silverlight framework provides a generic class or type, for working with XAML, the Sys.Preview.UI.Xaml.Control. asp:Xaml control is used to insert XAML into an ASP.NET AJAX page in a very generic manner. asp:Xaml control is typically extended through JavaScript or managed code or dynamic code to provide a specialized implementation of the control. The attribute of the asp:Xaml control that is most commonly used is the XamlUrl attribute. It identifies the XAML file to be included in the page. asp:Xaml control exposes only three minimal events out of which one is fired upon an error and one is fired upon the XAML loading.&lt;br /&gt;Below is the code as an example of including XAML in an ASP.NET AJAX page by using the asp:Xaml control -&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;Make sure to remove the hyphen symbol "-" from all the starting and ending html tags before using the code. I was not able to display the code below, so i placed the hyphen "-" in all the opening and closing html tags. So just remove the hyphen while using the code, and see the code running successfully.&lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;-%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %-&gt;&lt;br /&gt;&lt;-%@ Register assembly="Microsoft.Web.Preview" namespace="Microsoft.Web.Preview.UI.Controls" tagprefix="asp" %-&gt;&lt;br /&gt;&lt;-!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"-&gt;&lt;br /&gt;&lt;-html xmlns="http://www.w3.org/1999/xhtml"-&gt;&lt;br /&gt;&lt;-head runat="server"-&gt;&lt;br /&gt;&lt;-title-&gt;Simple XAML Example&lt;-/title-&gt;&lt;br /&gt;&lt;-/head-&gt;&lt;br /&gt;&lt;-body-&gt;&lt;br /&gt;&lt;-form id="form1" runat="server"-&gt;&lt;br /&gt;&lt;-asp:ScriptManager ID="ScriptManager1" runat="server"-&gt;&lt;br /&gt;&lt;-/asp:ScriptManager-&gt;&lt;br /&gt;&lt;-div-&gt;&lt;br /&gt;&lt;-/div-&gt;&lt;br /&gt;&lt;-asp:Xaml ID="Xaml1" runat="server" Height="500px" Width="500px" XamlUrl="~/Scene.xaml" /-&gt;&lt;br /&gt;&lt;-/form-&gt;&lt;br /&gt;&lt;-/body-&gt;&lt;br /&gt;&lt;-/html-&gt; &lt;/span&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-7850701617983109947?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/7850701617983109947/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=7850701617983109947' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/7850701617983109947'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/7850701617983109947'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2008/08/aspxaml-control.html' title='The asp:Xaml Control'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-1657131119347898795</id><published>2008-08-05T11:33:00.000-07:00</published><updated>2008-08-05T11:45:48.831-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='ajax.net'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><title type='text'>Silverlight ASP.NET AJAX Controls</title><content type='html'>&lt;span style="font-size:85%;"&gt;When Asp.Net was released in the market, it was heavily adopted in the industry. Asp.Net expanded the market. Besides proliferating the market, Asp.Net still had a plenty of time to establish itself as a stable product in the market. Currently there are plenty of asp.net applications in the market that are still in production and that would really benefit from upgrading to Silverlight. However, keep it in mind that ASP.NET is processed on the server. ASP.NET AJAX is also processed on the server through the ASP.NET page event life cycle, although through the use of AJAX more of the processing occurs on the client's machine so as to avoid unnecessary postbacks.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;A Silverlight application is hosted on a Web server so that a user can make a request for it from anywhere over the Web and once a request is made for a Silverlight application, the entire contents of the application are sent to the client's machine and processed there. Once a Silverlight application is executing on a client's machine, calls can be made to the server or to a Web service and by default, no postbacks occur to the server. The application is executing in an isolated and independent environment.&lt;br /&gt;&lt;br /&gt;Although there are times when an application will benefit from merging the server-side and client-side worlds so that postbacks do occur to the server. For example, a Silverlight application that must continually be updated from server-side content may benefit from postbacks. Moreover, completely redesigning a Web application around a new technology is a time-consuming and considerable task. Many ASP.NET and ASP.NET AJAX applications that are already developed and deployed and are stable may benefit from integrating Silverlight without being fully redesigned.Soon Microsoft realized the need to merge the two worlds of Web computing and released some controls to do so in the ASP.NET Futures extensions.&lt;br /&gt;&lt;br /&gt;The Microsoft ASP.NET Future extensions include new features and functionalites that are being considered for integration into ASP.NET, ASP.NET AJAX, and Silverlight and are made available for developers to begin experimenting with and adopting. Components that are released in ASP.NET Futures are normally somewhat stable and are therefore generally included in the next release of ASP.NET, ASP.NET AJAX, and Silverlight.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;Make sure to keep in touch with this site, because in the next few lessons you will be learning some important and interesting features of silverlight, as well as you will develop a professional calculator, similar to the one you use in your common life.&lt;/strong&gt;&lt;/span&gt; &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;Moreover we will also start with Asp.Net which is the widely used web technology in today's world. &lt;/strong&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-1657131119347898795?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/1657131119347898795/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=1657131119347898795' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/1657131119347898795'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/1657131119347898795'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2008/08/silverlight-aspnet-ajax-controls.html' title='Silverlight ASP.NET AJAX Controls'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-2204438059455689730</id><published>2008-08-03T20:19:00.000-07:00</published><updated>2008-08-03T20:38:19.931-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='wpf'/><category scheme='http://www.blogger.com/atom/ns#' term='simple calculator in silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><title type='text'>Simple Calculator In Silverlight</title><content type='html'>&lt;span style="font-size:85%;"&gt;In this example, I will show you how to develop a simple calculator.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Steps:&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;1.&lt;/strong&gt; First of all I will add a canvas on which I will develop my simple calculator. In the canvas I will add three textblocks and three textboxes, with two of them for entering the operands and the third one to display the result of the operation.&lt;br /&gt;&amp;lt;UserControl x:Class="SimpleCalculator.Page"&lt;br /&gt;xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;br /&gt;xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&amp;gt;&lt;br /&gt;&amp;lt;Canvas Background="SteelBlue"&amp;gt;&lt;br /&gt;&amp;lt;TextBlock Text="First Number" Foreground="White" Canvas.Left="20" Canvas.Top="20"&amp;gt;&amp;lt;/TextBlock&amp;gt;&lt;br /&gt;&amp;lt;TextBox x:Name="txtnum1" Width="100" Height="20" Canvas.Left="140" Canvas.Top="20"&amp;gt;&amp;lt;/TextBox&amp;gt;&lt;br /&gt;&amp;lt;TextBlock Text="Second Number" Foreground="White" Canvas.Left="20" Canvas.Top="40"&amp;gt;&amp;lt;/TextBlock&amp;gt;&lt;br /&gt;&amp;lt;TextBox x:Name="txtnum2" Width="100" Height="20" Canvas.Left="140" Canvas.Top="40"&amp;gt;&amp;lt;/TextBox&amp;gt;&lt;br /&gt;&amp;lt;TextBlock Text="Result" Foreground="White" Canvas.Left="20" Canvas.Top="60"&amp;gt;&amp;lt;/TextBlock&amp;gt;&lt;br /&gt;&amp;lt;TextBox x:Name="txtres" Width="100" Height="20" Canvas.Left="140" Canvas.Top="60"&amp;gt;&amp;lt;/TextBox&amp;gt;&lt;br /&gt;&amp;lt;/Canvas&amp;gt;&lt;br /&gt;&amp;lt;/UserControl&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2.&lt;/strong&gt; Then I will add five buttons to perform 5 different operations namely, Add, Subtract, Multiply, Divide and Clear.&lt;br /&gt;&amp;lt;UserControl x:Class="SimpleCalculator.Page"&lt;br /&gt;xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;br /&gt;xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&amp;gt;&lt;br /&gt;&amp;lt;Canvas Background="SteelBlue"&amp;gt;&lt;br /&gt;&amp;lt;TextBlock Text="First Number" Foreground="White" Canvas.Left="20" Canvas.Top="20"&amp;gt;&amp;lt;/TextBlock&amp;gt;&lt;br /&gt;&amp;lt;TextBox x:Name="txtnum1" Width="100" Height="20" Canvas.Left="140" Canvas.Top="20"&amp;gt;&amp;lt;/TextBox&amp;gt;&lt;br /&gt;&amp;lt;TextBlock Text="Second Number" Foreground="White" Canvas.Left="20" Canvas.Top="40"&amp;gt;&amp;lt;/TextBlock&amp;gt;&lt;br /&gt;&amp;lt;TextBox x:Name="txtnum2" Width="100" Height="20" Canvas.Left="140" Canvas.Top="40"&amp;gt;&amp;lt;/TextBox&amp;gt;&lt;br /&gt;&amp;lt;TextBlock Text="Result" Foreground="White" Canvas.Left="20" Canvas.Top="60"&amp;gt;&amp;lt;/TextBlock&amp;gt;&lt;br /&gt;&amp;lt;TextBox x:Name="txtres" Width="100" Height="20" Canvas.Left="140" Canvas.Top="60"&amp;gt;&amp;lt;/TextBox&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btnadd" Content="Add" Width="60" Canvas.Left="40" Canvas.Top="90" Click="btnadd_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btnsubtract" Content="Subtract" Width="60" Canvas.Left="100" Canvas.Top="90" Click="btnsubtract_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btnmultily" Content="Multiply" Width="60" Canvas.Left="160" Canvas.Top="90" Click="btnmultily_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btndivide" Content="Divide" Width="60" Canvas.Left="220" Canvas.Top="90" Click="btndivide_Click"&amp;gt;&amp;lt;/Button&amp;gt;&lt;br /&gt;&amp;lt;Button x:Name="btnclear" Content="Clear" Width="120" Canvas.Left="100" Canvas.Top="116" Click="btnclear_Click"&amp;gt;&amp;lt;/Button&amp;gt;&amp;lt;/Canvas&amp;gt;&lt;br /&gt;&amp;lt;/UserControl&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3.&lt;/strong&gt; Each of the buttons will have a click event handler that will point to a particular code block in the code behind, like add button will have "btnadd_Click" as its event handler for click event. The code blocks for all the button events are shown in the code behind file that is shown below-&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Net;&lt;br /&gt;using System.Windows;&lt;br /&gt;using System.Windows.Controls;&lt;br /&gt;using System.Windows.Documents;&lt;br /&gt;using System.Windows.Input;&lt;br /&gt;using System.Windows.Media;&lt;br /&gt;using System.Windows.Media.Animation;&lt;br /&gt;using System.Windows.Shapes;&lt;br /&gt;namespace SimpleCalculator&lt;br /&gt;{&lt;br /&gt;public partial class Page : UserControl&lt;br /&gt;{&lt;br /&gt;public Page()&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;}&lt;br /&gt;private void btnadd_Click(object sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;if (txtnum1.Text != "" &amp;amp;&amp;amp; txtnum2.Text != "")&lt;br /&gt;{&lt;br /&gt;txtres.Text = Convert.ToString(Convert.ToDouble(txtnum1.Text) + Convert.ToDouble(txtnum2.Text));&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private void btnsubtract_Click(object sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;if (txtnum1.Text != "" &amp;amp;&amp;amp; txtnum2.Text != "")&lt;br /&gt;{&lt;br /&gt;txtres.Text = Convert.ToString(Convert.ToDouble(txtnum1.Text) - Convert.ToDouble(txtnum2.Text));&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private void btnmultily_Click(object sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;if (txtnum1.Text != "" &amp;amp;&amp;amp; txtnum2.Text != "")&lt;br /&gt;{&lt;br /&gt;txtres.Text = Convert.ToString(Convert.ToDouble(txtnum1.Text) * Convert.ToDouble(txtnum2.Text));&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private void btndivide_Click(object sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;if (txtnum1.Text != "" &amp;amp;&amp;amp; txtnum2.Text != "")&lt;br /&gt;{&lt;br /&gt;txtres.Text = Convert.ToString(Convert.ToDouble(txtnum1.Text) / Convert.ToDouble(txtnum2.Text));&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private void btnclear_Click(object sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;txtnum1.Text="";&lt;br /&gt;txtnum2.Text="";&lt;br /&gt;txtres.Text="";&lt;br /&gt;txtnum1.Focus();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;In the code blocks we will write the code to perfore the mathematical operation related to that event, as shown above. Thats it, just run this code to see your simple calculator working for you.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-2204438059455689730?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/2204438059455689730/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=2204438059455689730' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/2204438059455689730'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/2204438059455689730'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2008/08/simple-calculator-in-silverlight.html' title='Simple Calculator In Silverlight'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-3448592255125943315</id><published>2008-08-03T07:19:00.000-07:00</published><updated>2008-08-03T07:28:49.177-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight versions'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><title type='text'>Silverlight Versions</title><content type='html'>&lt;span style="font-size:85%;"&gt;There are two versions of Silverlight that are available in the market. Version 1.0 and Version 2.0&lt;br /&gt;Version 1.0 includes support for creating rich interactive applications (RIA) and uses JavaScript as its programming language. Version 1.0 supports the industry-leading Windows Media Services which enables the delivery of audio and video that includes 2D and vector graphics.&lt;br /&gt;Version 2.0 includes all the features of version 1.0, support for the .NET Framework, support for .NET-compliant programming languages such as C#, Visual Basic, Python, and Ruby, and support for database operations and language-integrated query (LINQ). Version 2.0 was originally named version 1.1, however, due to the large number of changes and additions done in this new version, it was later renamed to version 2.0.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5230297059570234866" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_ww9l4AwRrmg/SJW_duF0NfI/AAAAAAAAACM/_kPnRTxAIUs/s400/SilverlightVersions.jpg" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;Mozilla Firefox&lt;br /&gt;&lt;/strong&gt;&lt;span style="font-size:85%;"&gt;Silverlight is supported by the browser Mozilla Firefox version 2 and version 1.5 on Windows Vista, Windows XP, Windows 2000 (using Silverlight version 2.0), Windows Server 2003, Mac OS 10.4.8+ for the PowerPC (using Silverlight version 1.0), and Mac OS 10.4.8+ for Intel-based PCs.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Opera&lt;/strong&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Silverlight is not supported by Opera yet. Opera is available for Windows and is on the roadmap for Silverlight support but until now, Opera does not support Silverlight.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Target Design Platforms&lt;br /&gt;&lt;/strong&gt;&lt;span style="font-size:85%;"&gt;Silverlight plug-in renders graphics and multimedia using a vector-based graphics engine. Vector graphics has the advantage that it can easily be scaled from very small displays to very large displays of varying resolutions with virtually no loss of image quality. The current release of Silverlight targets standard Web client workstations however Microsoft is working on a prototype of the Silverlight plug-in which can be used on Windows Mobile devices. Silverlight on a Windows Mobile device will enable the developers to deliver live, streaming, high quality video to smart phones and similar devices. The goal is to enable the developers to deliver rich interactive applications (RIA) to any type of device.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;You are about to see many interesting features of Silverlight in the coming sessions, so keep in touch.&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-3448592255125943315?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/3448592255125943315/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=3448592255125943315' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/3448592255125943315'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/3448592255125943315'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2008/08/silverlight-versions.html' title='Silverlight Versions'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_ww9l4AwRrmg/SJW_duF0NfI/AAAAAAAAACM/_kPnRTxAIUs/s72-c/SilverlightVersions.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-4909177841209573533</id><published>2008-08-02T06:56:00.000-07:00</published><updated>2008-08-02T07:04:28.918-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight architecture'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight languages'/><title type='text'>Silverlight Architecture</title><content type='html'>&lt;div&gt;&lt;span style="font-size:85%;"&gt;       Although ASP .NET and Silverlight both utilize the .NET Framework and are both used for Web development, Microsoft Silverlight functions in a different way from ASP .NET. In ASP .NET the bulk of the processing occurs on the server side while in silverlight it occurs on the client side thus decreasing the server resource utilization and improving the performance and thus the web experience on the client side. The figure below explains the difference between the processing for ASP.NET processing and Silverlight processing.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt; &lt;/div&gt;&lt;div&gt;&lt;span style="font-size:85%;"&gt;&lt;img id="BLOGGER_PHOTO_ID_5229919998907935058" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_ww9l4AwRrmg/SJRoh5qeaVI/AAAAAAAAACE/8ZK6BzRLajw/s400/SilverlightArchitecture.jpg" border="0" /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt; &lt;/div&gt;&lt;div&gt;&lt;span style="font-size:85%;"&gt;       It must be kept in mind that Silverlight plug-in is needed to run a silverlight application on a client machine. If the silverlight plug-in is not installed on the client machine, it will be downloaded and installed. Silverlight plug-in can be thought of as a scaled down version of the full dotnet framework. Silverlight plug-in does not contain all the classes and functionalities contained in the full .NET Framework but only those classes and functionalities that are applicable to a Silverlight Web client. Furthermore, the classes and functionalities included in the Silverlight plug-in are streamlined and optimized for use on the Web client machine.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;       Silverlight was designed using the same design paradigm as that of ASP .NET. Each page of Silverlight application includes an associated code behind file that includes the code that handles events fired by the page similar to that in an ASP .NET application. Silverlight resembles WPF in that it uses the Extensible Application Markup Language (XAML) to construct the user interface (presentation layer). Silverlight applications are composed of text-based files that include XAML and code. Silverlight applications can be created using any text editor, however more advanced tools and development environments, such as Visual Studio or Expression Suite, simplifies the task significantly.&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-4909177841209573533?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/4909177841209573533/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=4909177841209573533' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/4909177841209573533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/4909177841209573533'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2008/08/silverlight-architecture.html' title='Silverlight Architecture'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_ww9l4AwRrmg/SJRoh5qeaVI/AAAAAAAAACE/8ZK6BzRLajw/s72-c/SilverlightArchitecture.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-8787551678804279201</id><published>2008-08-01T23:12:00.000-07:00</published><updated>2008-08-01T23:20:49.628-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ajax.net'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight languages'/><title type='text'>Silverlight And Dotnet</title><content type='html'>&lt;strong&gt;An Overview of Silverlight&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Silverlight is delivered as a cross-platform and cross-browser plug-in to the .NET Framework. With cross-platform I mean to say that silverlight aplications can be run on multiple platforms and with cross-brower I mean that websites built in silverlight can be viewed from any browser like Internet Explorer, Firefox, Netscape Navigator etc. There are two versions of silverlight available in the market-&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;1. Silverlight 1.0&lt;br /&gt;2. Silverlight 2.0&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;Silverlight 1.0&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Silverlight 1.0 was released in the market in September 2007. Following are some of the features of Silverlight 1.0-&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;ul&gt;&lt;li&gt;Developing and managing 2-D graphics and animation.&lt;/li&gt;&lt;li&gt;Handling mouse,keyboard and ink input.&lt;/li&gt;&lt;li&gt;Working with JPEG and PNG imaging.&lt;/li&gt;&lt;li&gt;Delivering WMV,WMA and MP3 media.&lt;/li&gt;&lt;li&gt;Formating and manipulating text.&lt;/li&gt;&lt;li&gt;Communicating with services and downloading server resources by using the HTTP downloader.&lt;/li&gt;&lt;li&gt;Parsing Extensible Application Markup Language (XAML) content and markup.&lt;/li&gt;&lt;li&gt;Navigating web content by utilizing the Javascript Document Object Model(DOM)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/span&gt;&lt;/p&gt;&lt;strong&gt;Silverlight 2.0&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Version 2.0 is released in the market in the summer of 2008. Silverlight version 2.0 includes-&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;ul&gt;&lt;li&gt;All of the functionality that was included in Silverlight version 1.0&lt;/li&gt;&lt;li&gt;Support for the managed code C#, VB, Python, Ruby.&lt;/li&gt;&lt;li&gt;XAML extensibility.&lt;/li&gt;&lt;li&gt;Sample controls and control class.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Early Adopters&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;Due to the enormous new features provided by silverlight and its overwhelming graphics quality, we can see a number of developer's communities welcoming the arrival of silverlight. And in response to the overwhelming developer's community for Silverlight, many developers and companies have become early adopters of the technology. Companies like the World Series of Poker, the Discovery Channel, the Emmys, Home Shopping Network (HSN), World Wrestling Entertainment (WWE), Major League Baseball (MLB), Fox, XBOX 360, Netflix and many more have all developed stunning applications by using Silverlight.&lt;br /&gt;To view a silverlight application on your pc, you need to have silverlight plugins installed on your pc. If a client attempts to run a silverlight application on a pc where silverlight plugins are not installed, the client will be given the option to download and install the silverlight plug-in. Silverlight plug-in can be thought of as a scaled-down version of the full .NET Framework The Silverlight plug-in does not contain all the classes and functionalities contained in the full .NET Framework but only those classes and functionalities that are applicable to a Silverlight Web client. Furthermore, the classes and functionalities included in the Silverlight plug-in are streamlined and optimized for use on the Web client machine.&lt;br /&gt;The design paradiagram used to design silverlight is the same as that of ASP .NET. Each page of a Silverlight application includes an associated code behind file that includes the code that handles events fired by the page just as in the case of ASP .NET. Silverlight is similar to WPF in that it uses Extensible Application Markup Language (XAML) to construct the user interface (presentation layer). Silverlight applications are composed of text-based files that include XAML and code. Silverlight applications can be created using any text editor, however more advanced tools and development environments, such as Visual Studio or Expression Suite, simplify the task significantly.&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-8787551678804279201?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/8787551678804279201/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=8787551678804279201' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/8787551678804279201'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/8787551678804279201'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2008/08/silverlight-and-dotnet.html' title='Silverlight And Dotnet'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-4280006955440632337</id><published>2008-07-30T09:27:00.000-07:00</published><updated>2008-07-30T09:53:25.864-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='ajax.net'/><category scheme='http://www.blogger.com/atom/ns#' term='wpf'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><title type='text'>Creating a Silverlight Animation</title><content type='html'>As we all know, animation in silverlight is one of the most interesting topics in silverlight. Here I will demonstrate how we can achievea simple animation in Silverlight.&lt;br /&gt;&lt;br /&gt;To use this tutorial, make sure that you have the Expression Blend software installed on your computer. The Expression Blend is not a free software. So if you really need animations in your website, which is the beauty of silverlight, just get the Expression Blend software on your pc.&lt;br /&gt;&lt;br /&gt;Creating animations in Silverlight can be a simple process, depending on the animation in mind. The tool that is used for creating animation in silverlight is Expression Blend 2. Let's create a simple spinning circle animation (similar to the one displayed in Windows Vista when waiting on a lengthy process to complete) and display it in a Silverlight application. We will start by creating a new Silverlight application in Visual Studio 2008. Once it has been created, open the solution for the application just created inside the Expression Blend. We can easily open a Visual Studio 2008 solution in Expression Blend by right-clicking the .xaml file in the Visual Studio 2008 Solution Explorer and selecting the option to open it in the Expression Blend. When we open a new solution in the Expression Blend, we will be provided with a blank slate to work with.&lt;br /&gt;To create the spinning animation as described above, drag an ellipse from the toolbar onto the XAML design area. Select the ellipse and then use the Properties Window to configure the ellipse similar to the one shown in the figure below-&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;img id="BLOGGER_PHOTO_ID_5228847261773133410" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_ww9l4AwRrmg/SJCY4YbC9mI/AAAAAAAAABs/mc3gRTlTJds/s400/Image1.jpg" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;In the Objects and Timeline pane, select the Open, Create, or Manage Storyboards button. Now click the add (+) button to create a new timeline. We will be presented with the Create Storyboard dialog as shown in the following figure below-&lt;br /&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5228847505795711010" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_ww9l4AwRrmg/SJCZGlekACI/AAAAAAAAAB0/AqVCD9hMaA4/s400/Image2.jpg" border="0" /&gt; Assign a name to the new timeline and click OK. Next, select a point on this timeline and modify the ellipse in some manner. Lets say we grab the corner anchor of the ellipse using the mouse and spin the ellipse around several times. Now we can test the animation by clicking the Play button on the timeline pane.&lt;br /&gt;If we want the animation to continue in a loop forever,then we will select the timeline and in the Properties sheet, set the RepeatBehavior to "Forever". Now we will save the page and go back to Visual Studio 2008.&lt;br /&gt;Now, if we run the Silverlight application in Visual Studio as it exists right out of Expression Blend, the animation may appear but won't play. In order to get the animation to play, we must call the Begin method of the StoryBoard and in order to be able to call the Begin method of the StoryBoard, the StoryBoard must have a name assigned to it. Once the StoryBoard is assigned a name, we can call the Begin method from the Silverlight code behind file as shown in the code snippet below-&lt;br /&gt;&lt;br /&gt;public void Page_Loaded(object o, EventArgs e)&lt;br /&gt;{&lt;br /&gt;// Required to initialize variables&lt;br /&gt;InitializeComponent();&lt;br /&gt;Spin.Begin();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;The resulting animation is shown in the figure below-&lt;br /&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5228847719208716962" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_ww9l4AwRrmg/SJCZTAgMCqI/AAAAAAAAAB8/g4L9U1YFJPI/s400/Image3.jpg" border="0" /&gt; &lt;/p&gt;&lt;p&gt;I hope you are enjoying this tutorial session, just keep in touch with this site as there is a lot more coming for you in future.&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-4280006955440632337?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/4280006955440632337/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=4280006955440632337' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/4280006955440632337'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/4280006955440632337'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2008/07/creating-silverlight-animation.html' title='Creating a Silverlight Animation'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_ww9l4AwRrmg/SJCY4YbC9mI/AAAAAAAAABs/mc3gRTlTJds/s72-c/Image1.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-6027772037343823552</id><published>2008-07-29T08:46:00.000-07:00</published><updated>2008-07-29T09:58:18.437-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='wpf'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight languages'/><title type='text'>Creating a Silverlight Application</title><content type='html'>&lt;span style="font-family:arial;"&gt;Now we have a basic understanding of some of the aspects of a Silverlight application, so we will get started by building the fantasy picks page by using Silverlight.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The Silverlight Project&lt;/strong&gt;&lt;br /&gt;The first step to do when creating a Silverlight application by using Visual Studio is to create a new project. We will choose C# as the programming language for the project. Lets name the application that we are about to create as MyFantacyPicks. The New Project dialog box is shown in the figure below-&lt;/span&gt; &lt;/span&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;span style="font-size:0;"&gt;&lt;/p&gt;&lt;img id="BLOGGER_PHOTO_ID_5228468661216022642" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_ww9l4AwRrmg/SI9Ai7cLEHI/AAAAAAAAABE/E_bFUO36mVo/s400/1.jpg" border="0" /&gt; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size:100%;"&gt;As soon as the project is created, we will be provided with some files that we can see in the solution explorer. The names of these files and a brief description about them is shown below-&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;strong&gt;TestPage.html&lt;/strong&gt; - This is a basic HTML page to start with. In this example, we won't be modifying this page at all.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;strong&gt;TestPage.html.js&lt;/strong&gt; - This is code behind file for the test HTML and it is, obviously, written in JavaScript as its extension .js signifies. In this example, we won't be modifying this file either.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;strong&gt;Silverlight.js&lt;/strong&gt; - This is a standard Silverlight framework file which is written in JavaScript. We won't be modifying this file ever.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;strong&gt;Page.xaml&lt;/strong&gt; - This is a basic XAML file to starting with. This is where we will be working for the maximum in this example.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;strong&gt;Page.xaml.cs&lt;/strong&gt; - This is the code behind file for the XAML document and is written in C#. We'll add a couple of lines of code to this file. &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;span style="font-size:100%;"&gt;&lt;strong&gt;Our Goal&lt;/strong&gt;&lt;br /&gt;Our goal is to create a fantasy picks page as shown in the figure below-&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5228469116026335794" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_ww9l4AwRrmg/SI9A9ZvZsjI/AAAAAAAAABU/ooPaGvBUpC0/s400/2.jpg" border="0" /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;The Silverlight XAML&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;First of all, open the TestPage.html page and assign it a new title say "My Fantasy Picks". You can also rename the TestPage.html and TestPage.html.js files if you like. Then, we need to set the background of the page. We must always remember that Silverlight XAML uses a &lt;canvas&gt;element to represent the document. We can configure the background either through the XAML editor in Visual Studio 2008 or through Visual Editor in Expression Blend 2.&lt;br /&gt;Suppose we have chosen Expression Blend 2 to configure the background. What we will do is that we will open Expression Blend and then open the project. From the project, we will open the Page.xaml file and set the background using the sidebar panel. The page edited using Expression Blend is shown in the figure below-&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;img id="BLOGGER_PHOTO_ID_5228469296658530914" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_ww9l4AwRrmg/SI9BH6peQmI/AAAAAAAAABc/UDB-tY4h3qE/s400/3.jpg" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;After this is completed, we will walk through the process of adding controls to our page. To gain a better understanding of XAML, we will add controls to our page declaratively by using XAML in Visual Studio 2008.&lt;br /&gt;Keep in mind that we are now working on the client-side code in our code behind file. Since the code behind file is written in a server-side language, it's easy to forget that the code contained therein will execute on the client side. As such, if a Silverlight application has to display data from a server-side data source, it must connect to that data source over the Web. The easiest method to retrieve data over the Web is to utilize a Web service. The topic, Silverlight Using Web service will be discussed later. For now, to keep things simple, we will display a literal string value on the button click. The resulting silverlight application is shown below- &lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;img id="BLOGGER_PHOTO_ID_5228469614017175762" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_ww9l4AwRrmg/SI9BaY5q4NI/AAAAAAAAABk/Q4uSq4A9eTA/s400/4.jpg" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;The XAML that is used to create the Silverlight form in the figure above is shown in the code below- &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;&amp;lt;Canvas&lt;br /&gt;xmlns="http://schemas.microsoft.com/client/2007"&lt;br /&gt;xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&lt;br /&gt;xmlns:c1="clr-namespace:C1.Silverlight;assembly=ClientBin/C1.Silverlight.dll"&lt;br /&gt;x:Name="parentCanvas"&lt;br /&gt;Loaded="Page_Loaded"&lt;br /&gt;x:Class="MyFantasyPicks.Page;assembly=ClientBin/MyFantasyPicks.dll"&lt;br /&gt;Width="640"&lt;br /&gt;Height="480" &amp;gt;&lt;br /&gt;&amp;lt;Canvas.Background&amp;gt;&lt;br /&gt;&amp;lt;LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5"&amp;gt;&lt;br /&gt;&amp;lt;GradientStop Color="#FF000000" Offset="0"/&amp;gt;&lt;br /&gt;&amp;lt;GradientStop Color="#FF96B178" Offset="1"/&amp;gt;&lt;br /&gt;&amp;lt;/LinearGradientBrush&amp;gt;&lt;br /&gt;&amp;lt;/Canvas.Background&amp;gt;&lt;br /&gt;&amp;lt;TextBlock Width="598" Height="25" Canvas.Left="25" Canvas.Top="50" Text="Welcome To The Fantasy Manager" Foreground="#FFE4F6CC" FontFamily="Segoe UI" FontSize="18"/&amp;gt;&lt;br /&gt;&amp;lt;Rectangle Width="598" Height="1" Fill="#FFE4F6CC" Stroke="#FFE4F6CC" Canvas.Left="25" Canvas.Top="75" StrokeThickness="0.5"/&amp;gt;&lt;br /&gt;&amp;lt;c1:Button AutoHeight="False" AutoWidth="False" Height="25" Width="200" Canvas.Left="25" Canvas.Top="80" Text="Display My Fantasy Picks" Click="GetPicks" /&amp;gt;&lt;br /&gt;&amp;lt;Rectangle Width="598" Height="1" Fill="#FFE4F6CC" Stroke="#FFE4F6CC" Canvas.Left="25" Canvas.Top="110" StrokeThickness="0.5"/&amp;gt;&lt;br /&gt;&amp;lt;TextBlock x:Name="tbPicks" Height="150" Width="598" Canvas.Left="25" Canvas.Top="115" FontFamily="Segoe UI" FontSize="13" Foreground="#FF4FAFEA" Text="" FontWeight="Normal" /&amp;gt;&lt;br /&gt;&amp;lt;Rectangle Width="598" Height="1" Fill="#FFE4F6CC" Stroke="#FFE4F6CC" Canvas.Left="25" Canvas.Top="270" StrokeThickness="0.5"/&amp;gt;&lt;br /&gt;&amp;lt;TextBlock Width="598" Height="25" Canvas.Left="25" Canvas.Top="275" Text="copyright 2007 - fantasy league manager" Foreground="#FFE4F6CC" FontFamily="Segoe UI" FontSize="10" /&amp;gt;&lt;br /&gt;&amp;lt;/Canvas &amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;c1:button width="200" height="25" left="25" top="80" text="Display My Fantasy Picks" autoheight="False" autowidth="False" click="GetPicks"&gt;&lt;c1:button width="200" height="25" left="25" top="80" text="Display My Fantasy Picks" autoheight="False" autowidth="False" click="GetPicks"&gt;&lt;c1:button width="200" height="25" left="25" top="80" text="Display My Fantasy Picks" autoheight="False" autowidth="False" click="GetPicks"&gt;&lt;p&gt;&lt;c1:button width="200" height="25" left="25" top="80" text="Display My Fantasy Picks" autoheight="False" autowidth="False" click="GetPicks"&gt;&lt;?xml:namespace prefix = c1 /&gt;&lt;c1:button width="200" height="25" left="25" top="80" text="Display My Fantasy Picks" autoheight="False" autowidth="False" click="GetPicks"&gt;&lt;canvas class="MyFantasyPicks.Page;assembly=" width="640" height="480" name="parentCanvas" xmlns="http://schemas.microsoft.com/client/2007" x="http://schemas.microsoft.com/winfx/2006/xaml" c1="clr-namespace:C1.Silverlight;assembly=ClientBin/C1.Silverlight.dll" loaded="Page_Loaded"&gt;&lt;c1:button width="200" height="25" left="25" top="80" text="Display My Fantasy Picks" autoheight="False" autowidth="False" click="GetPicks"&gt;&lt;/canvas&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/c1:button&gt;&lt;/c1:button&gt;&lt;/p&gt;&lt;p&gt;&lt;c1:button width="200" height="25" left="25" top="80" text="Display My Fantasy Picks" autoheight="False" autowidth="False" click="GetPicks"&gt;&lt;c1:button width="200" height="25" left="25" top="80" text="Display My Fantasy Picks" autoheight="False" autowidth="False" click="GetPicks"&gt;&lt;c1:button width="200" height="25" left="25" top="80" text="Display My Fantasy Picks" autoheight="False" autowidth="False" click="GetPicks"&gt;&lt;c1:button width="200" height="25" left="25" top="80" text="Display My Fantasy Picks" autoheight="False" autowidth="False" click="GetPicks"&gt;&lt;c1:button width="200" height="25" left="25" top="80" text="Display My Fantasy Picks" autoheight="False" autowidth="False" click="GetPicks"&gt;&lt;span style="font-size:85%;"&gt;The click event handler that handles the button click is shown in the code below-&lt;br /&gt;using System;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Xml;&lt;br /&gt;using System.Windows;&lt;br /&gt;using System.Windows.Controls;&lt;br /&gt;using System.Windows.Documents;&lt;br /&gt;using System.Windows.Ink;&lt;br /&gt;using System.Windows.Input;&lt;br /&gt;using System.Windows.Media;&lt;br /&gt;using System.Windows.Media.Animation;&lt;br /&gt;using System.Windows.Shapes;&lt;br /&gt;using System.IO;&lt;br /&gt;using System.Net;&lt;br /&gt;using System.Text;&lt;br /&gt;using System.Windows.Browser;&lt;br /&gt;using System.Windows.Browser.Net;&lt;br /&gt;namespace MyFantasyPicks&lt;br /&gt;{&lt;br /&gt;public partial class Page : Canvas&lt;br /&gt;{&lt;br /&gt;public void Page_Loaded(object o, EventArgs e)&lt;br /&gt;{&lt;br /&gt;// Required to initialize variables&lt;br /&gt;InitializeComponent();&lt;br /&gt;}&lt;br /&gt;protected void GetPicks(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;tbPicks.Text = "My fantasy picks for week 1 are blah, blah, blah...";&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/c1:button&gt;&lt;/c1:button&gt;&lt;/c1:button&gt;&lt;/c1:button&gt;&lt;/c1:button&gt;&lt;/c1:button&gt;&lt;/c1:button&gt;&lt;/c1:button&gt;&lt;/c1:button&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-6027772037343823552?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/6027772037343823552/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=6027772037343823552' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/6027772037343823552'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/6027772037343823552'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2008/07/creating-silverlight-application.html' title='Creating a Silverlight Application'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_ww9l4AwRrmg/SI9Ai7cLEHI/AAAAAAAAABE/E_bFUO36mVo/s72-c/1.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-4056891227111177036</id><published>2008-07-28T07:30:00.000-07:00</published><updated>2008-07-29T10:06:57.274-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='wpf'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight framework'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight languages'/><title type='text'>Silverlight Languages</title><content type='html'>Silverlight plugin offers a CLR execution environment and a .NET Framework base class library (BCL) that is hosted in the user's browser and is used to execute code. Silverlight is a progression of the ASP.NET AJAX. ASP.NET AJAX extends the capabilities of JavaScript by providing a JavaScript library so that JavaScript is much more object oriented and provides more functionality. The Silverlight execution engine also further extends JavaScript and the browser-hosted execution environment.&lt;br /&gt;&lt;br /&gt;&amp;lt;strong&amp;gt;Dynamic Language Runtime (DLR)&amp;lt;/strong&amp;gt;&lt;br /&gt;As said earlier, there are currently two versions of Silverlight, version 1.0 and version 2.0. In version 1.0, the only language that is available is the JavaScript. Version 2.0 extends the execution environment and provides more advanced programming languages to program Silverlight applications. Furthermore, version 2.0 not only opens up the Silverlight CLR for use by more than one language but also allows the languages to seamlessly intercommunicate through the use of a Dynamic Language Runtime (DLR).&lt;br /&gt;A dynamic programming language is the one in which the language and the language runtime, are designed to dynamically extend application capabilities at runtime. For instance, a language might be able to load, compile, and assimilate a code that is read at runtime but did not exists at compile time. The Silverlight DLR enables the Silverlight to take advantage of the dynamic language functionality.&lt;br /&gt;&lt;br /&gt;&amp;lt;strong&amp;gt;DLR Console&amp;lt;/strong&amp;gt;&lt;br /&gt;As a method of testing the DLR and prototyping Silverlight code and applications, Microsoft developed the DLR Console. Microsoft deployed the DLR Console to Microsoft CodePlex and made it freely available for developers to extend and experiment with. The DLR Console is available for download at http://silverlight.net/community/gallerydetail.aspx?cat=2&amp;amp;sort=2. The DLR Console version that is available on CodePlex supports prototyping XAML by using JScript and Python.&lt;br /&gt;&lt;br /&gt;&amp;lt;strong&amp;gt;JavaScript&amp;lt;/strong&amp;gt;&lt;br /&gt;As mentioned earlier, in Silverlight 1.0, JavaScript was the only language that could be utilized. Creating Silverlight applications by using JavaScript is very easy but it is not directly available as an option in Visual Studio. Rather, a very tiny amount of hand coding will be necessary, in the simplest form, less than 10 lines of markup. In the simplest form, start with an HTML page and insert antag, it can be inside of a &amp;lt;div&amp;gt;tag as shown in the markup listing below. JavaScript supports most of the features that are available for a dynamic language, by design.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;Simple Silverlight Using JavaScript&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;div id="SilverlightHost"&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;object id="sl" type="application/ag-plugin" height="400" width="800"&amp;gt;&amp;lt;param name="source" value="Page.xaml"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/object&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Notice that the &amp;lt;param&amp;gt; tag in the HTML identifies the Page.xaml file to be loaded. The XAML file is also extremely simple in this example as shown below.&lt;br /&gt;&lt;br /&gt;&amp;lt;canvas width="640" height="480" name="MyCanvas" xmlns="http://schemas.microsoft.com/client/2007" x="http://schemas.microsoft.com/winfx/2006/xaml" background="White"&amp;gt;&lt;br /&gt;&lt;textblock implementation="" text="This is my text." fontfamily="Segoe UI" fontsize="14" name="MyText" type="text/javascript" src="Silverlight.js"&gt;&lt;br /&gt;&amp;lt;script type="text/javascript" src="TestPage.html.js"&gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&gt;&lt;br /&gt;function onLoad (sender, args, root)&lt;br /&gt;{&lt;br /&gt;var MyText = root.findName("MyText");&lt;br /&gt;MyText.FontSize = 50;&lt;br /&gt;}&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;style type="text/css"&amp;gt;&lt;br /&gt;.silverlightStyleClass { width: 640px; height: 480px; }&lt;br /&gt;&amp;lt;/style&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;div class="silverlightStyleClass " id="SilverlightControlHost"&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;CreateSilverlight();&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When coding Silverlight by using JavaScript, we will insert the JavaScript directly in the HTML page. The first thing we need to do is to add an id to the XAML.&lt;br /&gt;Once the TextBlock has been assigned a name, it can be accessed as well as manipulated by using JavaScript. Next,what we need is to interact with the XAML through some type of event. The most commonly used event, just as with ASP.NET (the Load event), is the onLoad event in case of Javascript. The JavaScript is shown below-&lt;br /&gt;function CreateSilverlight()&lt;br /&gt;{&lt;br /&gt;Silverlight.createObjectEx({&lt;br /&gt;source: "Page.xaml",&lt;br /&gt;parentElement: document.getElementById("SilverlightControlHost"),&lt;br /&gt;id: "SilverlightControl",&lt;br /&gt;properties: {&lt;br /&gt;width: "100%",&lt;br /&gt;height: "100%",&lt;br /&gt;version: "1.1",&lt;br /&gt;enableHtmlAccess: "true"&lt;br /&gt;},&lt;br /&gt;events: {onLoad:onLoad}&lt;br /&gt;});&lt;br /&gt;document.body.onload = function() {&lt;br /&gt;var silverlightControl = document.getElementById('SilverlightControlHost');&lt;br /&gt;if (silverlightControl)&lt;br /&gt;silverlightControl.focus();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;Finally, we need to create the onLoad handler in our HTML page. A JavaScript event handler for Silverlight will receive 3 parameters. The first parameter is a reference to the sending container object, or the element, the second includes some optional arguments that have not been passed in this example, and the third is a reference to the root element of the XAML document. We can use the root argument by finding it with the findName method(which is used to locate any element with a name attribute assigned to it in the XAML file).&lt;br /&gt;&lt;br /&gt;&amp;lt;strong&amp;gt;C#&amp;lt;/strong&amp;gt;&lt;br /&gt;In Silverlight version 2.0, the only difference between coding a Silverlight application by using JavaScript and that by using a .NET programming language such as C# is that the XAML file identifies a code behind file through the x:Class attribute as shown below.&lt;br /&gt;&lt;br /&gt;&amp;lt;canvas class="SL_Example_CS.Page;assembly=" width="640" height="480" name="parentCanvas" xmlns="http://schemas.microsoft.com/client/2007" x="http://schemas.microsoft.com/winfx/2006/xaml" loaded="Page_Loaded" background="White"&amp;gt;&lt;br /&gt;&amp;lt;textblock text="This is a my text" fontfamily="Segoe UI" fontsize="12" name="MyText"&amp;gt;&lt;br /&gt;&amp;lt;/canvas&amp;gt;&lt;br /&gt;&lt;br /&gt;Furthermore, the event handlers will now be wired into the Silverlight picture through the XAML file as shown above. As shown in the example above, the Loaded event is wired up to the Page_Loaded handler in the code behind file. The associated code behind file is shown below-&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Windows;&lt;br /&gt;using System.Windows.Controls;&lt;br /&gt;using System.Windows.Documents;&lt;br /&gt;using System.Windows.Ink;&lt;br /&gt;using System.Windows.Input;&lt;br /&gt;using System.Windows.Media;&lt;br /&gt;using System.Windows.Media.Animation;&lt;br /&gt;using System.Windows.Shapes;&lt;br /&gt;namespace SL_Example_CS&lt;br /&gt;{&lt;br /&gt;public partial class Page : Canvas&lt;br /&gt;{&lt;br /&gt;public void Page_Loaded(object o, EventArgs e)&lt;br /&gt;{&lt;br /&gt;// Required to initialize variables&lt;br /&gt;InitializeComponent();&lt;br /&gt;myText.FontSize = 50;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;To illustrate the difference between the language syntax, the same example is written below using VB language-&lt;br /&gt;Partial Public Class Page&lt;br /&gt;Inherits Canvas&lt;br /&gt;Public Sub Page_Loaded(ByVal o As Object, ByVal e As EventArgs)&lt;br /&gt;' Required to initialize variables&lt;br /&gt;InitializeComponent()&lt;br /&gt;myText.FontSize = 50&lt;br /&gt;End Sub&lt;br /&gt;End Class &amp;lt;/div&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-4056891227111177036?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/4056891227111177036/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=4056891227111177036' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/4056891227111177036'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/4056891227111177036'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2008/07/silverlight-languages.html' title='Silverlight Languages'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-1198996019240014600</id><published>2008-07-27T00:49:00.000-07:00</published><updated>2008-07-27T01:09:36.547-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='ajax.net'/><category scheme='http://www.blogger.com/atom/ns#' term='wpf'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight tools'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><title type='text'>Silverlight Tools</title><content type='html'>Because of silverlight's popularity, there are already many editors and design tools being planned by vendors. The two most common tools for Silverlight design and development are:&lt;br /&gt;&lt;br /&gt;1. Visual Studio 2008&lt;br /&gt;2. Expression Blend 2&lt;br /&gt;&lt;br /&gt;1. &lt;strong&gt;Visual Studio 2008&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Visual Studio is Microsoft's premiere integrated software development environment. Visual Studio now contains management utilities as well as development tools. The figure below shows Microsoft Visual Studio 2008.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;img id="BLOGGER_PHOTO_ID_5227599063002531074" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_ww9l4AwRrmg/SIwppppuRQI/AAAAAAAAAAk/scmKEdy4WXg/s400/VS2008.jpg" border="0" /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;2.&lt;strong&gt; Expression Blend 2&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Microsoft has introduced a whole new bunch of cutting edge tools for use by designers, called Microsoft Expression Suite. Microsoft Expression Suite includes a tool called Microsoft Expression Blend, that is a Silverlight development tool targeting the designers.Microsoft designed the Expression suite of tools to integrate nicely with the Visual Studio similar to ASP.NET, which was redesigned with code behind files containing compilable code so that developers could work on programming language code and components while designers could work on the markup and user interface, thus separating the programming logic from the designing logic.&lt;br /&gt;Microsoft's visual Silverlight design tool - Microsoft Expression Blend 2&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;img id="BLOGGER_PHOTO_ID_5227599830749593154" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_ww9l4AwRrmg/SIwqWVu4vkI/AAAAAAAAAA0/O3yUH0UQ3FE/s400/ExpressionBlend2.jpg" border="0" /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-1198996019240014600?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/1198996019240014600/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=1198996019240014600' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/1198996019240014600'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/1198996019240014600'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2008/07/silverlight-tools.html' title='Silverlight Tools'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_ww9l4AwRrmg/SIwppppuRQI/AAAAAAAAAAk/scmKEdy4WXg/s72-c/VS2008.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-8660204383673728063</id><published>2008-07-27T00:46:00.000-07:00</published><updated>2008-07-27T00:49:01.802-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ajax.net'/><category scheme='http://www.blogger.com/atom/ns#' term='wpf'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><title type='text'>Silverlight Vs WPF and Silverlight Tools</title><content type='html'>&lt;strong&gt;Silverlight vs. WPF&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;div align="justify"&gt;&lt;br /&gt;     Silverlight is a subset of Windows Presentation Foundation(WPF) that also extends and utilizes many of the features and aspects of ASP.NET AJAX. With the bulk of software development today targeting the Web, many developers question as to why they need to create WPF applications at all now that Silverlight has arrived. The answer is that both these technologies have their own strengths and weaknesses. The strength of silverlight lies in its portability over the web. However Silverlight is cross platform and cross browser compliant. As such, it cannot take advantage of or be reliant upon any particular environment or platform. For more advanced graphic features, hardware support is required and it must also take advantage of the platform features. WPF provides advanced 3D graphic features that perform very well where as Silverlight is not able to provide these features at this time.The powers and limitations of Silverlight and WPF are basically a result of the environment that each is designed to perform in.&lt;br /&gt;     Silverlight is a subset of WPF only because the all the functionalities provided by WPF cannot be utilized in the Silverlight's world.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-8660204383673728063?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/8660204383673728063/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=8660204383673728063' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/8660204383673728063'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/8660204383673728063'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2008/07/silverlight-vs-wpf-and-silverlight.html' title='Silverlight Vs WPF and Silverlight Tools'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2921258475179998176.post-5664901302840080982</id><published>2008-07-26T05:31:00.000-07:00</published><updated>2008-07-26T22:13:31.553-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='silverlight tutorial'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='microsoft silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight framework'/><title type='text'>Silverlight Framework</title><content type='html'>&lt;a href="http://1.bp.blogspot.com/_ww9l4AwRrmg/SIsdZ5xof_I/AAAAAAAAAAc/hyI18IOoyr8/s1600-h/Framework.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5227304123336523762" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://1.bp.blogspot.com/_ww9l4AwRrmg/SIsdZ5xof_I/AAAAAAAAAAc/hyI18IOoyr8/s400/Framework.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="http://2.bp.blogspot.com/_ww9l4AwRrmg/SIsdC7F9SfI/AAAAAAAAAAU/IJ_QW2EKlnM/s1600-h/Framework.jpg"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;SILVERLIGHT FRAMEWORK Microsoft Silverlight is the latest technology offered by Microsoft. Microsoft technologies progressed from separate and isolated development technologies to Active Server Pages (ASP), which was their first dynamic Web development technology. In order to stay competitive, Microsoft decided to redesign and consolidate all of their development technologies into a single platform, which was named as the .NET Framework. So far the dotnet framework has been widely successful and thus popular.One most popular technology in dotnet is the Asp.Net. Asp.Net is an extremely powerful web development technology. But by default, in asp.net the bulk of the processing occurs on the server side. Web applcations will perform better if more of the processing occurs on the client side. The more the processing occurs on the client side and thus the lesser the processing occurs on the server side, the better will be the performance. So Microsoft introduced Ajax.Net, to extend the client scripting capabilities and improve performance. However the main drawback of ajax is that the javascript is executed by the user's browser and the user has the full authority to enable-disable javascript on the browser. Clearly, for websites that were implemented using ajax technologies, it was required that the client side javascript is enabled.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;In order to solve this problem, Microsoft began its investigations on how it can gain control of the Asp.Net client side environment and at the same time improve the performance and user experience for the websites further. Microsoft also wanted to find a way so as to offer the same ability to create incredible user interfaces on the client-side that Windows Presentation Foundation (WPF) offered on the server. As a result, Microsoft created a new downloadable plugin technology that extends the ASP.NET AJAX environment significantly and, at the same time, incorporates much of the functionalities and rendering capabilities of WPF. The resulting technology was originally named "WPF/E" (Windows Presentation Foundation / Everywhere) and was later renamed to Silverlight. Currently Silverlight is known by both these names.&lt;br /&gt;There are currently two versions available for silverlight: version 1.0 and version 2.0. Version 1.0 of silverlight was fairly limited in functionality and JavaScript was the only language supported. But Version 2.0 includes a gamut of new features and many .NET-compliant programming languages are now supported. The figure illustrates the main differences between version 1.0 and version 2.0 (shown as version 1.1 in this diagram due to the original naming). I am updating this site regularly. For more information, keep visiting this site.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2921258475179998176-5664901302840080982?l=silverlight-dotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://silverlight-dotnet.blogspot.com/feeds/5664901302840080982/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2921258475179998176&amp;postID=5664901302840080982' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/5664901302840080982'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2921258475179998176/posts/default/5664901302840080982'/><link rel='alternate' type='text/html' href='http://silverlight-dotnet.blogspot.com/2008/07/silverlight-framework-microsoft.html' title='Silverlight Framework'/><author><name>Mr Admin</name><uri>http://www.blogger.com/profile/13782927728862785538</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_ww9l4AwRrmg/SIsdZ5xof_I/AAAAAAAAAAc/hyI18IOoyr8/s72-c/Framework.jpg' height='72' width='72'/><thr:total>0</thr:total></entry></feed>
