<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Silverlight</title>
        <link>http://geekswithblogs.net/maxonweb/category/10897.aspx</link>
        <description>Silverlight</description>
        <language>en-AU</language>
        <copyright>Max</copyright>
        <managingEditor>rm.manickam@gmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>GTasks Plus v1.0 &amp;ndash; Open Source Windows Phone 7 Application</title>
            <link>http://geekswithblogs.net/maxonweb/archive/2012/01/30/gtasks-plus-v1.0-ndash-open-source-windows-phone-7-application.aspx</link>
            <description>&lt;p&gt;I am happy to announce that I have open sourced and released my first Windows Phone 7 Application to Marketplace a few days back. You can get the source code from &lt;a href="http://gtasksplus.codeplex.com/"&gt;http://gtasksplus.codeplex.com/&lt;/a&gt;. I will also do a series of few blog posts to take you all through developing the application from scratch. Check back regularly.&lt;/p&gt;  &lt;p&gt;Sorry for not posting anything for a long time, I have been concentrating on learning some new things and did not really get a chance to continue blogging. Will try and be consistent here after.&lt;/p&gt;  &lt;p&gt;Thanks&lt;/p&gt;  &lt;p&gt;Max&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:dc6dde41-2552-4660-9915-84f4723995cd" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Wp7" rel="tag"&gt;Wp7&lt;/a&gt;,&lt;a href="http://technorati.com/tags/windows+phone+7" rel="tag"&gt;windows phone 7&lt;/a&gt;,&lt;a href="http://technorati.com/tags/open+source" rel="tag"&gt;open source&lt;/a&gt;,&lt;a href="http://technorati.com/tags/GTasks+Plus" rel="tag"&gt;GTasks Plus&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Google+tasks" rel="tag"&gt;Google tasks&lt;/a&gt;&lt;/div&gt; &lt;img src="http://geekswithblogs.net/maxonweb/aggbug/148525.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Max</dc:creator>
            <guid>http://geekswithblogs.net/maxonweb/archive/2012/01/30/gtasks-plus-v1.0-ndash-open-source-windows-phone-7-application.aspx</guid>
            <pubDate>Mon, 30 Jan 2012 09:53:49 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/maxonweb/comments/148525.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/maxonweb/archive/2012/01/30/gtasks-plus-v1.0-ndash-open-source-windows-phone-7-application.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/maxonweb/comments/commentRss/148525.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/maxonweb/services/trackbacks/148525.aspx</trackback:ping>
        </item>
        <item>
            <title>Silverlight 4 Twitter Client &amp;ndash; Part 7</title>
            <link>http://geekswithblogs.net/maxonweb/archive/2010/04/29/silverlight-4-twitter-client-ndash-part-7.aspx</link>
            <description>&lt;p&gt;&lt;a href="http://pdfcrowd.com/url_to_pdf/?height=-1"&gt;Download this article as a PDF&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Welcome back :) This week we are going to look at something more exciting and a much required feature for any twitter client – auto refresh so as to show new status updates. We are going to achieve this using Silverlight 4 Timers and a bit and refresh our datagrid every 2 minutes to show new updates. We will do this so that we do only minimal request to the twitter api, so that twitter does not block us – there is a limit of 150 request an hour. Let us get started now. Also we will get the profile user id hyperlinked, so that when ever the user click on it, we will take them to their twitter page.&lt;/p&gt;
&lt;p&gt;Also it was a pain to always run this application by pressing F5, then it would open in a browser you would have to right click uninstall and install it again to see any changes. All this and yet we were not able to debug it :( Now there is a solution for this to run a silverlight application directly out of browser and yet have the debug feature. Super cool, here is how.&lt;/p&gt;
&lt;p&gt;Right on the Silverlight project and go to debug and then select the Out-Of-Browser application option and choose the *.Web project.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/maxonweb/WindowsLiveWriter/Silverlight4TwitterClientPart7_11D7E/image_2.png"&gt;&lt;img title="image" border="0" alt="image" width="636" height="290" style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" src="http://geekswithblogs.net/images/geekswithblogs_net/maxonweb/WindowsLiveWriter/Silverlight4TwitterClientPart7_11D7E/image_thumb.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Then just right click on the SL project and set as Startup Project. There you go, now every time you press F5, it will automatically run out of browser and still have the debug options. I go to know about this after some binging.&lt;/p&gt;
&lt;p&gt;Now let us jump to the core straight away.&lt;/p&gt;
&lt;p&gt;1) To get the user id hyperlinked, we need to have a DataGridTemplateColumn and within that have a HyperLinkButton. The code for this will  be&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;
&amp;lt;data:DataGridTemplateColumn&amp;gt;&lt;/pre&gt;
&lt;pre&gt;
    &amp;lt;data:DataGridTemplateColumn.CellTemplate&amp;gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;
        &amp;lt;DataTemplate&amp;gt;&lt;/pre&gt;
&lt;pre&gt;
            &amp;lt;HyperlinkButton Click=&lt;span class="str"&gt;"HyperlinkButton_Click"&lt;/span&gt; Content=&lt;span class="str"&gt;"{Binding UserName}"&lt;/span&gt; TargetName=&lt;span class="str"&gt;"_blank"&lt;/span&gt; &amp;gt;&amp;lt;/HyperlinkButton&amp;gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;
        &amp;lt;/DataTemplate&amp;gt;&lt;/pre&gt;
&lt;pre&gt;
    &amp;lt;/data:DataGridTemplateColumn.CellTemplate&amp;gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;
&amp;lt;/data:DataGridTemplateColumn&amp;gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;&lt;style type="text/css"&gt;&lt;![CDATA[

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;2) Now let us look at how we are getting this done by looking into HyperlinkButton_Click event handler. There we will dynamically set the NavigateUri to the twitter page. I tried to do this using some binding, eval like stuff as in ASP.NET, but no luck!&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; HyperlinkButton_Click(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, RoutedEventArgs e)&lt;/pre&gt;
&lt;pre&gt;
{&lt;/pre&gt;
&lt;pre class="alt"&gt;
    HyperlinkButton hb = (HyperlinkButton)e.OriginalSource;&lt;/pre&gt;
&lt;pre&gt;
    hb.NavigateUri = &lt;span class="kwrd"&gt;new&lt;/span&gt; Uri(&lt;span class="str"&gt;"http://twitter.com/"&lt;/span&gt; + hb.Content.ToString(), UriKind.Absolute);&lt;/pre&gt;
&lt;pre class="alt"&gt;
}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;&lt;style type="text/css"&gt;&lt;![CDATA[

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;
&lt;p&gt;3) Now we need to switch on our Timer right in the OnNavigated to event on our SL page. So we need to modify our OnNavigated event to some thing like below:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; OnNavigatedTo(NavigationEventArgs e)&lt;/pre&gt;
&lt;pre&gt;
{&lt;/pre&gt;
&lt;pre class="alt"&gt;
    image1.Source = &lt;span class="kwrd"&gt;new&lt;/span&gt; BitmapImage(&lt;span class="kwrd"&gt;new&lt;/span&gt; Uri(GlobalVariable.profileImage, UriKind.Absolute));&lt;/pre&gt;
&lt;pre&gt;
    &lt;span class="kwrd"&gt;this&lt;/span&gt;.Title = GlobalVariable.getUserName() + &lt;span class="str"&gt;" - Home"&lt;/span&gt;;&lt;/pre&gt;
&lt;pre class="alt"&gt;
    &lt;span class="kwrd"&gt;if&lt;/span&gt; (!GlobalVariable.isLoggedin())&lt;/pre&gt;
&lt;pre&gt;
        &lt;span class="kwrd"&gt;this&lt;/span&gt;.NavigationService.Navigate(&lt;span class="kwrd"&gt;new&lt;/span&gt; Uri(&lt;span class="str"&gt;"/Login"&lt;/span&gt;, UriKind.Relative));&lt;/pre&gt;
&lt;pre class="alt"&gt;
    &lt;span class="kwrd"&gt;else&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;
    {&lt;/pre&gt;
&lt;pre class="alt"&gt;
        currentGrid = &lt;span class="str"&gt;"Timeline-Grid"&lt;/span&gt;;&lt;/pre&gt;
&lt;pre&gt;
        TwitterCredentialsSubmit();&lt;/pre&gt;
&lt;pre class="alt"&gt;
        myDispatcherTimer.Interval = &lt;span class="kwrd"&gt;new&lt;/span&gt; TimeSpan(0, 0, 0, 60, 0);&lt;/pre&gt;
&lt;pre&gt;
        myDispatcherTimer.Tick += &lt;span class="kwrd"&gt;new&lt;/span&gt; EventHandler(Each_Tick);&lt;/pre&gt;
&lt;pre class="alt"&gt;
        myDispatcherTimer.Start();&lt;/pre&gt;
&lt;pre&gt;
    }&lt;/pre&gt;
&lt;pre class="alt"&gt;
}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;I use a global string – here it is currentGrid variable to indicate what is bound in the datagrid so that after every timer tick, I can rebind the latest data to it again. Like I will only rebind the friends timeline again if the data grid currently holds it and I’ll only rebind the respective list status again in the data grid, if already a list status is bound to the data grid.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;style type="text/css"&gt;&lt;![CDATA[

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;
&lt;p&gt;In the above timer code, its set to trigger the Each_Tick event handler every 1 minute (60 seconds). TimeSpan takes in (days, hours, minutes, seconds, milliseconds).&lt;/p&gt;
&lt;p&gt;4) Now we need to set the list name in the currentGrid variable when a list button is clicked. So add the code line below to the list button event handler&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;
currentGrid = currentList = b.Content.ToString();&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;&lt;style type="text/css"&gt;&lt;![CDATA[

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;
&lt;p&gt;5) Now let us see how Each_Tick event handler is implemented.&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Each_Tick(&lt;span class="kwrd"&gt;object&lt;/span&gt; o, EventArgs sender)&lt;/pre&gt;
&lt;pre&gt;
{&lt;/pre&gt;
&lt;pre class="alt"&gt;
    &lt;span class="kwrd"&gt;if&lt;/span&gt; (!currentGrid.Equals(&lt;span class="str"&gt;"Timeline-Grid"&lt;/span&gt;))&lt;/pre&gt;
&lt;pre&gt;
        getListStatuses(currentGrid);&lt;/pre&gt;
&lt;pre class="alt"&gt;
    &lt;span class="kwrd"&gt;else&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;
    {&lt;/pre&gt;
&lt;pre class="alt"&gt;
        WebRequest.RegisterPrefix(&lt;span class="str"&gt;"https://"&lt;/span&gt;, System.Net.Browser.WebRequestCreator.ClientHttp);&lt;/pre&gt;
&lt;pre&gt;
        WebClient myService = &lt;span class="kwrd"&gt;new&lt;/span&gt; WebClient();&lt;/pre&gt;
&lt;pre class="alt"&gt;
        myService.AllowReadStreamBuffering = &lt;span class="kwrd"&gt;true&lt;/span&gt;;&lt;/pre&gt;
&lt;pre&gt;
        myService.UseDefaultCredentials = &lt;span class="kwrd"&gt;false&lt;/span&gt;;&lt;/pre&gt;
&lt;pre class="alt"&gt;
        myService.Credentials = &lt;span class="kwrd"&gt;new&lt;/span&gt; NetworkCredential(GlobalVariable.getUserName(), GlobalVariable.getPassword());&lt;/pre&gt;
&lt;pre&gt;
        myService.DownloadStringCompleted += &lt;span class="kwrd"&gt;new&lt;/span&gt; DownloadStringCompletedEventHandler(TimelineRequestCompleted);&lt;/pre&gt;
&lt;pre class="alt"&gt;
        myService.DownloadStringAsync(&lt;span class="kwrd"&gt;new&lt;/span&gt; Uri(&lt;span class="str"&gt;"https://twitter.com/statuses/friends_timeline.xml"&lt;/span&gt;));&lt;/pre&gt;
&lt;pre&gt;
    }&lt;/pre&gt;
&lt;pre class="alt"&gt;
}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;If the data grid hold friends timeline, I just use the same bit of code we had already to bind the friends timeline to the data grid. Copy Paste.&lt;/p&gt;
&lt;p&gt;But if it is some list timeline that is bound in the datagrid, I then call the getListStatus method with the currentGrid string which will actually be holding the list name.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;style type="text/css"&gt;&lt;![CDATA[

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;
&lt;p&gt;6) I wanted to make the hyperlinks inside the status message as hyperlinks and when the user clicks on it, we can then open that link. I tried using a convertor and using a regex to recognize a url and wrap it up with a href, but that is not gonna work in silverlight textblock :( Anyways that convertor code is in the zip file.&lt;/p&gt;
&lt;p&gt;7) You can get the complete project files from &lt;a target="_blank" href="http://cid-397644e8d28e79c8.skydrive.live.com/embedicon.aspx/.Public/MaxTwitter%20-%20Part%207.zip"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;8) Please comment below for your doubts, suggestions, improvements. I will try to reply as early as possible. Thanks for all your support.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:95db14ff-81cc-4528-9a33-59b85be1e72a" class="wlWriterEditableSmartContent" style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px"&gt;Technorati Tags: &lt;a rel="tag" href="http://technorati.com/tags/Silverlight+4"&gt;Silverlight 4&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/Datagrid"&gt;Datagrid&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/Twitter+API"&gt;Twitter API&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/Silverlight+Timer"&gt;Silverlight Timer&lt;/a&gt;&lt;/div&gt; &lt;img src="http://geekswithblogs.net/maxonweb/aggbug/139583.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Max</dc:creator>
            <guid>http://geekswithblogs.net/maxonweb/archive/2010/04/29/silverlight-4-twitter-client-ndash-part-7.aspx</guid>
            <pubDate>Thu, 29 Apr 2010 10:19:46 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/maxonweb/comments/139583.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/maxonweb/archive/2010/04/29/silverlight-4-twitter-client-ndash-part-7.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/maxonweb/comments/commentRss/139583.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/maxonweb/services/trackbacks/139583.aspx</trackback:ping>
        </item>
        <item>
            <title>Silverlight 4 Twitter Client &amp;ndash; Part 5</title>
            <link>http://geekswithblogs.net/maxonweb/archive/2010/03/27/silverlight-4-twitter-client-ndash-part-5.aspx</link>
            <description>&lt;p&gt;In this post, we will look at implementing the following in our twitter client - displaying the profile picture in the home page after logging in. So to accomplish this, we will need to do the following steps.&lt;/p&gt;
&lt;p&gt;1) First of all, let us create another field in our Global variable static class to hold the profile image url. So just create a static string field in that.&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; profileImage { get; set; }&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;&lt;style type="text/css"&gt;&lt;![CDATA[
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;2) In the Login.xaml.cs file, before the line where we redirect to the Home page if the login was successful. Create another WebClient request to fetch details from this url - &lt;a href="http://api.twitter.com/1/users/show/&amp;lt;TwitterUsername&amp;gt;.xml"&gt;.xml"&amp;gt;http://api.twitter.com/1/users/show/&amp;lt;TwitterUsername&amp;gt;.xml&lt;/a&gt; I am interested only in the “profile_image_url” node in this xml string returned. You can choose what ever field you need – the reference to the Twitter API Documentation is &lt;a target="_blank" href="http://apiwiki.twitter.com/Twitter-REST-API-Method:-users%C2%A0show"&gt;&lt;strong&gt;&lt;em&gt;here&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;3) This particular url does not require any authentication so no need of network credentials for this and also the useDefaultCredentials will be true. So this code would look like.&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;
WebRequest.RegisterPrefix(&lt;span class="str"&gt;"http://"&lt;/span&gt;, System.Net.Browser.WebRequestCreator.ClientHttp);&lt;/pre&gt;
&lt;pre&gt;
WebClient myService = &lt;span class="kwrd"&gt;new&lt;/span&gt; WebClient();&lt;/pre&gt;
&lt;pre class="alt"&gt;
myService.AllowReadStreamBuffering = myService.UseDefaultCredentials = &lt;span class="kwrd"&gt;true&lt;/span&gt;;&lt;/pre&gt;
&lt;pre&gt;
myService.DownloadStringCompleted += &lt;span class="kwrd"&gt;new&lt;/span&gt; DownloadStringCompletedEventHandler(TimelineRequestCompleted_User);)&lt;/pre&gt;
&lt;pre class="alt"&gt;
myService.DownloadStringAsync(&lt;span class="kwrd"&gt;new&lt;/span&gt; Uri(&lt;span class="str"&gt;"http://api.twitter.com/1/users/show/"&lt;/span&gt; + TwitterUsername.Text + &lt;span class="str"&gt;".xml"&lt;/span&gt;));&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;&lt;style type="text/css"&gt;&lt;![CDATA[
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;
&lt;p&gt;4) To parse the xml file returned by this and get the value of the “profile_image_url” node, the LINQ code will look something like&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;
XDocument xdoc;&lt;/pre&gt;
&lt;pre&gt;
xdoc = XDocument.Parse(e.Result);&lt;/pre&gt;
&lt;pre class="alt"&gt;
var answer = (from status &lt;span class="kwrd"&gt;in&lt;/span&gt; xdoc.Descendants(&lt;span class="str"&gt;"user"&lt;/span&gt;)&lt;/pre&gt;
&lt;pre&gt;
              select status.Element(&lt;span class="str"&gt;"profile_image_url"&lt;/span&gt;).Value);&lt;/pre&gt;
&lt;pre class="alt"&gt;
GlobalVariable.profileImage = answer.First().ToString();&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;5) After this, we can then redirect to Home page completing our login formalities.&lt;/p&gt;
&lt;p&gt;6) In the home page, add a image tag and give it a name, something like&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;
&amp;lt;Image Name=&lt;span class="str"&gt;"image1"&lt;/span&gt; Stretch=&lt;span class="str"&gt;"Fill"&lt;/span&gt; Margin=&lt;span class="str"&gt;"29,29,0,0"&lt;/span&gt; Height=&lt;span class="str"&gt;"73"&lt;/span&gt; VerticalAlignment=&lt;span class="str"&gt;"Top"&lt;/span&gt; HorizontalAlignment=&lt;span class="str"&gt;"Left"&lt;/span&gt; Width=&lt;span class="str"&gt;"73"&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;&lt;style type="text/css"&gt;&lt;![CDATA[
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;7) In the OnNavigated to event in home page, we can set the image source url as below&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;
image1.Source = &lt;span class="kwrd"&gt;new&lt;/span&gt; BitmapImage(&lt;span class="kwrd"&gt;new&lt;/span&gt; Uri(GlobalVariable.profileImage, UriKind.Absolute));&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;&lt;style type="text/css"&gt;&lt;![CDATA[
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/maxonweb/WindowsLiveWriter/Silverlight4TwitterClientPart5_13605/image_2.png"&gt;&lt;img title="image" border="0" alt="image" width="304" height="267" style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" src="http://geekswithblogs.net/images/geekswithblogs_net/maxonweb/WindowsLiveWriter/Silverlight4TwitterClientPart5_13605/image_thumb.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Hope this helps. If you have any queries / suggestions, please feel free to comment below or contact me.&lt;/p&gt;
&lt;div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:901089d2-f496-4833-b0ff-1c51d662d49d" class="wlWriterEditableSmartContent" style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px"&gt;Technorati Tags: &lt;a rel="tag" href="http://technorati.com/tags/Silverlight"&gt;Silverlight&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/LINQ"&gt;LINQ&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/Twitter+API"&gt;Twitter API&lt;/a&gt;,&lt;a rel="tag" href="http://technorati.com/tags/Twitter"&gt;Twitter&lt;/a&gt;&lt;/div&gt; &lt;img src="http://geekswithblogs.net/maxonweb/aggbug/138955.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Max</dc:creator>
            <guid>http://geekswithblogs.net/maxonweb/archive/2010/03/27/silverlight-4-twitter-client-ndash-part-5.aspx</guid>
            <pubDate>Sat, 27 Mar 2010 11:03:02 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/maxonweb/comments/138955.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/maxonweb/archive/2010/03/27/silverlight-4-twitter-client-ndash-part-5.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/maxonweb/comments/commentRss/138955.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/maxonweb/services/trackbacks/138955.aspx</trackback:ping>
        </item>
        <item>
            <title>Silverlight 4 Twitter Client &amp;ndash; Source Files</title>
            <link>http://geekswithblogs.net/maxonweb/archive/2010/03/24/silverlight-4-twitter-client-ndash-source-files.aspx</link>
            <description>&lt;p&gt;&lt;a href="http://cid-fc17c3621fbf0344.skydrive.live.com/embedicon.aspx/Public/MaxTwitter.zip" target="_blank"&gt;&lt;strong&gt;&lt;em&gt;Here&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt; you can download the source files this includes all the parts we have discussed and one more list feature which I am currently working on, its not fully finished. This is a VS2010 RC / SL 4 RC compliant version files, so make sure you use it with them. Will see you soon in my next post with the next part ready.&lt;/p&gt;  &lt;p&gt;I received a few emails, saying that my tutorial is good – Thanks for all your support. A few asked for source files, here it is. All your support gives me more reasons to keep blogging!&lt;/p&gt;  &lt;p&gt;Cheers! &lt;img class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://geekswithblogs.net/images/geekswithblogs_net/maxonweb/WindowsLiveWriter/Silverlight4TwitterClientSourceFiles_11FD6/wlEmoticon-smile_2.png" /&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/maxonweb/aggbug/138883.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Max</dc:creator>
            <guid>http://geekswithblogs.net/maxonweb/archive/2010/03/24/silverlight-4-twitter-client-ndash-source-files.aspx</guid>
            <pubDate>Wed, 24 Mar 2010 09:35:12 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/maxonweb/comments/138883.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/maxonweb/archive/2010/03/24/silverlight-4-twitter-client-ndash-source-files.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/maxonweb/comments/commentRss/138883.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/maxonweb/services/trackbacks/138883.aspx</trackback:ping>
        </item>
        <item>
            <title>Silverlight 4 Twitter Client &amp;ndash; Part 3</title>
            <link>http://geekswithblogs.net/maxonweb/archive/2010/03/16/silverlight-4-twitter-client-ndash-part-3.aspx</link>
            <description>&lt;p&gt;Finally Silverlight 4 RC is released and also that Windows 7 Phone Series will rely heavily on Silverlight platform for apps platform. its a really good news for Silverlight developers and designers. More information on this &lt;a href="http://visualstudiomagazine.com/articles/2010/03/15/mix10-windows-phone-developer-tools-are-free-silverlight-4-rc.aspx" target="_blank"&gt;&lt;u&gt;here&lt;/u&gt;&lt;/a&gt;. You can use SL 4 RC with VS 2010. SL 4 RC does not come with VS 2010, you need to download it separately and install it. So for the next part, be ready with VS 2010 and SL4 RC, we will start using them and not betas.&lt;/p&gt;  &lt;p&gt;With this momentum, let us go to the next part of our twitter client tutorial. This tutorial will cover setting your status in Twitter and also retrieving your &lt;/p&gt;  &lt;p&gt;1) As everything in Silverlight is asynchronous, we need to have some visual representation showing that something is going on in the background. So what I did was to create a progress bar with indeterminate animation. The XAML is here below.&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&amp;lt;ProgressBar Maximum=&lt;span class="str"&gt;"100"&lt;/span&gt; Width=&lt;span class="str"&gt;"300"&lt;/span&gt; Height=&lt;span class="str"&gt;"50"&lt;/span&gt; Margin=&lt;span class="str"&gt;"20"&lt;/span&gt; Visibility=&lt;span class="str"&gt;"Collapsed"&lt;/span&gt; IsIndeterminate=&lt;span class="str"&gt;"True"&lt;/span&gt; Name=&lt;span class="str"&gt;"progressBar1"&lt;/span&gt; VerticalAlignment=&lt;span class="str"&gt;"Center"&lt;/span&gt; HorizontalAlignment=&lt;span class="str"&gt;"Center"&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;&lt;![CDATA[
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;

&lt;p&gt;2) I will be toggling this progress bar to show the background work. So I thought of writing this small method, which I use to toggle the visibility of this progress bar. Just pass a bool to this method and this will toggle it based on its current visibility status.&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; toggleProgressBar(&lt;span class="kwrd"&gt;bool&lt;/span&gt; Option)&lt;/pre&gt;

  &lt;pre&gt;{&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (Option)&lt;/pre&gt;

  &lt;pre&gt;    {&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;if&lt;/span&gt; (progressBar1.Visibility == System.Windows.Visibility.Collapsed)&lt;/pre&gt;

  &lt;pre&gt;            progressBar1.Visibility = System.Windows.Visibility.Visible;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    }&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;else&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    {&lt;/pre&gt;

  &lt;pre&gt;        &lt;span class="kwrd"&gt;if&lt;/span&gt; (progressBar1.Visibility == System.Windows.Visibility.Visible)&lt;/pre&gt;

  &lt;pre class="alt"&gt;            progressBar1.Visibility = System.Windows.Visibility.Collapsed;&lt;/pre&gt;

  &lt;pre&gt;    }&lt;/pre&gt;

  &lt;pre class="alt"&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;3) Now let us create a grid to hold a textbox and a update button. The XAML will look like something below&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&amp;lt;Grid HorizontalAlignment=&lt;span class="str"&gt;"Center"&lt;/span&gt;&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;    &amp;lt;Grid.RowDefinitions&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &amp;lt;RowDefinition Height=&lt;span class="str"&gt;"50"&lt;/span&gt;&amp;gt;&amp;lt;/RowDefinition&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;    &amp;lt;/Grid.RowDefinitions&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &amp;lt;Grid.ColumnDefinitions&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;        &amp;lt;ColumnDefinition Width=&lt;span class="str"&gt;"400"&lt;/span&gt;&amp;gt;&amp;lt;/ColumnDefinition&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &amp;lt;ColumnDefinition Width=&lt;span class="str"&gt;"200"&lt;/span&gt;&amp;gt;&amp;lt;/ColumnDefinition&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;    &amp;lt;/Grid.ColumnDefinitions&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &amp;lt;TextBox Name=&lt;span class="str"&gt;"TwitterStatus"&lt;/span&gt; Width=&lt;span class="str"&gt;"380"&lt;/span&gt; Height=&lt;span class="str"&gt;"50"&lt;/span&gt;&amp;gt;&amp;lt;/TextBox&amp;gt;&lt;/pre&gt;

  &lt;pre&gt;    &amp;lt;Button Name=&lt;span class="str"&gt;"UpdateStatus"&lt;/span&gt; Content=&lt;span class="str"&gt;"Update"&lt;/span&gt; Grid.Row=&lt;span class="str"&gt;"1"&lt;/span&gt; Grid.Column=&lt;span class="str"&gt;"2"&lt;/span&gt; Width=&lt;span class="str"&gt;"200"&lt;/span&gt; Height=&lt;span class="str"&gt;"50"&lt;/span&gt; Click=&lt;span class="str"&gt;"UpdateStatus_Click"&lt;/span&gt;&amp;gt;&amp;lt;/Button&amp;gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;lt;/Grid&amp;gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;&lt;![CDATA[


.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;

&lt;p&gt;4) The click handler for this update button will be again using the Web Client to post values. Posting values using Web Client. The code is:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; UpdateStatus_Click(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, RoutedEventArgs e)&lt;/pre&gt;

  &lt;pre&gt;{&lt;/pre&gt;

  &lt;pre class="alt"&gt;    toggleProgressBar(&lt;span class="kwrd"&gt;true&lt;/span&gt;);&lt;/pre&gt;

  &lt;pre&gt;    &lt;span class="kwrd"&gt;string&lt;/span&gt; statusupdate = &lt;span class="str"&gt;"status="&lt;/span&gt; + TwitterStatus.Text;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    WebRequest.RegisterPrefix(&lt;span class="str"&gt;"https://"&lt;/span&gt;, System.Net.Browser.WebRequestCreator.ClientHttp);&lt;/pre&gt;

  &lt;pre&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;    WebClient myService = &lt;span class="kwrd"&gt;new&lt;/span&gt; WebClient();&lt;/pre&gt;

  &lt;pre&gt;    myService.AllowReadStreamBuffering = &lt;span class="kwrd"&gt;true&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    myService.UseDefaultCredentials = &lt;span class="kwrd"&gt;false&lt;/span&gt;;&lt;/pre&gt;

  &lt;pre&gt;    myService.Credentials = &lt;span class="kwrd"&gt;new&lt;/span&gt; NetworkCredential(GlobalVariable.getUserName(), GlobalVariable.getPassword());&lt;/pre&gt;

  &lt;pre class="alt"&gt; &lt;/pre&gt;

  &lt;pre&gt;    myService.UploadStringCompleted += &lt;span class="kwrd"&gt;new&lt;/span&gt; UploadStringCompletedEventHandler(myService_UploadStringCompleted);&lt;/pre&gt;

  &lt;pre class="alt"&gt;    myService.UploadStringAsync(&lt;span class="kwrd"&gt;new&lt;/span&gt; Uri(&lt;span class="str"&gt;"https://twitter.com/statuses/update.xml"&lt;/span&gt;), statusupdate);&lt;/pre&gt;

  &lt;pre&gt; &lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;this&lt;/span&gt;.Dispatcher.BeginInvoke(() =&amp;gt; ClearTextBoxValue());&lt;/pre&gt;

  &lt;pre&gt;}&lt;/pre&gt;

  &lt;p&gt;5) In the above code, we have a event handler which will be fired on this request is completed – !! Remember SL is Asynch !! So in the myService_UploadStringCompleted, we will just toggle the progress bar and change some status text to say that its done. The code for this will be StatusMessage is just another textblock conveniently positioned in the page.&lt;/p&gt;

  &lt;pre&gt; &lt;/pre&gt;

  &lt;div class="csharpcode"&gt;
    &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;void&lt;/span&gt; myService_UploadStringCompleted(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, UploadStringCompletedEventArgs e)&lt;/pre&gt;

    &lt;pre&gt;{&lt;/pre&gt;

    &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt; (e.Error != &lt;span class="kwrd"&gt;null&lt;/span&gt;)&lt;/pre&gt;

    &lt;pre&gt;    {&lt;/pre&gt;

    &lt;pre class="alt"&gt;        StatusMessage.Text = &lt;span class="str"&gt;"Status Update Failed: "&lt;/span&gt; + e.Error.Message.ToString();&lt;/pre&gt;

    &lt;pre&gt;    }&lt;/pre&gt;

    &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;else&lt;/span&gt;&lt;/pre&gt;

    &lt;pre&gt;    {&lt;/pre&gt;

    &lt;pre class="alt"&gt;        toggleProgressBar(&lt;span class="kwrd"&gt;false&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre&gt;        TwitterCredentialsSubmit();&lt;/pre&gt;

    &lt;pre class="alt"&gt;    }&lt;/pre&gt;

    &lt;pre&gt;}&lt;/pre&gt;
  &lt;/div&gt;
  &lt;style type="text/css"&gt;&lt;![CDATA[

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;&lt;/div&gt;
&lt;style type="text/css"&gt;&lt;![CDATA[


.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;6) Now let us look at fetching the friends updates of the logged in user and displaying it in a datagrid. So just define a data grid and set its autogenerate columns as true.&lt;/p&gt;

&lt;p&gt;7) Let us first create a data structure for use with fetching the friends timeline. The code is something like below:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; MaxTwitter.Classes&lt;/pre&gt;

  &lt;pre&gt;{&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; Status&lt;/pre&gt;

  &lt;pre&gt;    {&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; Status() {}&lt;/pre&gt;

  &lt;pre&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; ID { get; set; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Text { get; set; }&lt;/pre&gt;

  &lt;pre&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; Source { get; set; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; UserID { get; set; }&lt;/pre&gt;

  &lt;pre&gt;        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; UserName { get; set; }&lt;/pre&gt;

  &lt;pre class="alt"&gt;    }&lt;/pre&gt;

  &lt;pre&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;&lt;![CDATA[

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;You can add as many fields as you want, for the list of fields, have a look at &lt;a href="https://twitter.com/statuses/friends_timeline.xml" target="_blank"&gt;&lt;u&gt;here&lt;/u&gt;&lt;/a&gt;. It will ask for your Twitter username and password, just provide them and this will display the xml file. Go through them pick and choose your desired fields and include in your Data Structure.&lt;/p&gt;

&lt;p&gt;8) Now the web client request for this is similar to the one we saw in step 4. Just change the uri in the last but one step to&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;https://twitter.com/statuses/friends_timeline.xml&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;&lt;![CDATA[

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;

&lt;p&gt;Be sure to change the event handler to something else and within that we will use XLINQ to fetch the required details for us. Now let us how this event handler fetches details.&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;div class="csharpcode"&gt;
    &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; parseXML(&lt;span class="kwrd"&gt;string&lt;/span&gt; text)&lt;/pre&gt;

    &lt;pre&gt;{&lt;/pre&gt;

    &lt;pre class="alt"&gt;    XDocument xdoc;&lt;/pre&gt;

    &lt;pre&gt;    &lt;span class="kwrd"&gt;if&lt;/span&gt;(text.Length&amp;gt; 0)&lt;/pre&gt;

    &lt;pre class="alt"&gt;        xdoc = XDocument.Parse(text);&lt;/pre&gt;

    &lt;pre&gt;    &lt;span class="kwrd"&gt;else&lt;/span&gt;&lt;/pre&gt;

    &lt;pre class="alt"&gt;        xdoc = XDocument.Parse(&lt;span class="str"&gt;@"I  USED MY OWN LOCAL COPY OF XML FILE HERE FOR OFFLINE TESTING"&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre&gt;    statusList = &lt;span class="kwrd"&gt;new&lt;/span&gt; List&amp;lt;Status&amp;gt;();&lt;/pre&gt;

    &lt;pre class="alt"&gt;    statusList = (from status &lt;span class="kwrd"&gt;in&lt;/span&gt; xdoc.Descendants(&lt;span class="str"&gt;"status"&lt;/span&gt;)&lt;/pre&gt;

    &lt;pre&gt;                  select &lt;span class="kwrd"&gt;new&lt;/span&gt; Status&lt;/pre&gt;

    &lt;pre class="alt"&gt;                  {&lt;/pre&gt;

    &lt;pre&gt;                      ID = status.Element(&lt;span class="str"&gt;"id"&lt;/span&gt;).Value,&lt;/pre&gt;

    &lt;pre class="alt"&gt;                      Text = status.Element(&lt;span class="str"&gt;"text"&lt;/span&gt;).Value,&lt;/pre&gt;

    &lt;pre&gt;                      Source = status.Element(&lt;span class="str"&gt;"source"&lt;/span&gt;).Value,&lt;/pre&gt;

    &lt;pre class="alt"&gt;                      UserID = status.Element(&lt;span class="str"&gt;"user"&lt;/span&gt;).Element(&lt;span class="str"&gt;"id"&lt;/span&gt;).Value,&lt;/pre&gt;

    &lt;pre&gt;                      UserName = status.Element(&lt;span class="str"&gt;"user"&lt;/span&gt;).Element(&lt;span class="str"&gt;"screen_name"&lt;/span&gt;).Value,&lt;/pre&gt;

    &lt;pre class="alt"&gt;                  }).ToList();&lt;/pre&gt;

    &lt;pre&gt;    &lt;span class="rem"&gt;//MessageBox.Show(text);&lt;/span&gt;&lt;/pre&gt;

    &lt;pre class="alt"&gt;    &lt;span class="rem"&gt;//this.Dispatcher.BeginInvoke(() =&amp;gt; CallDatabindMethod(StatusCollection));&lt;/span&gt;&lt;/pre&gt;

    &lt;pre&gt;    &lt;span class="rem"&gt;//MessageBox.Show(statusList.Count.ToString());&lt;/span&gt;&lt;/pre&gt;

    &lt;pre class="alt"&gt;    DataGridStatus.ItemsSource = statusList;&lt;/pre&gt;

    &lt;pre&gt;    StatusMessage.Text = &lt;span class="str"&gt;"Datagrid refreshed."&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre class="alt"&gt;    toggleProgressBar(&lt;span class="kwrd"&gt;false&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre&gt;}&lt;/pre&gt;
  &lt;/div&gt;
  &lt;style type="text/css"&gt;&lt;![CDATA[

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;&lt;/div&gt;
&lt;style type="text/css"&gt;&lt;![CDATA[

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;

&lt;p&gt;in the event handler, we call this method with e.Result.ToString() Parsing XML files using LINQ is super cool, I love it.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/maxonweb/WindowsLiveWriter/Silverlight4TwitterClientPart3_13C59/image_2.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://geekswithblogs.net/images/geekswithblogs_net/maxonweb/WindowsLiveWriter/Silverlight4TwitterClientPart3_13C59/image_thumb.png" width="790" height="469" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;I am stopping it here for  this post. Will post the completed files in next post, as I’ve worked on a few more features in this page and don’t want to confuse you. See you soon in my next post where will play with Twitter lists. Have a nice day!&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:510507e8-cd3a-4064-9ee4-a6e14697cf5e" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Silverlight" rel="tag"&gt;Silverlight&lt;/a&gt;,&lt;a href="http://technorati.com/tags/LINQ" rel="tag"&gt;LINQ&lt;/a&gt;,&lt;a href="http://technorati.com/tags/XLINQ" rel="tag"&gt;XLINQ&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Twitter+API" rel="tag"&gt;Twitter API&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Twitter" rel="tag"&gt;Twitter&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Network+Credentials" rel="tag"&gt;Network Credentials&lt;/a&gt;&lt;/div&gt; &lt;img src="http://geekswithblogs.net/maxonweb/aggbug/138571.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Max</dc:creator>
            <guid>http://geekswithblogs.net/maxonweb/archive/2010/03/16/silverlight-4-twitter-client-ndash-part-3.aspx</guid>
            <pubDate>Tue, 16 Mar 2010 01:36:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/maxonweb/comments/138571.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/maxonweb/archive/2010/03/16/silverlight-4-twitter-client-ndash-part-3.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/maxonweb/comments/commentRss/138571.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/maxonweb/services/trackbacks/138571.aspx</trackback:ping>
        </item>
        <item>
            <title>Silverlight Twitter Client - Part 1</title>
            <link>http://geekswithblogs.net/maxonweb/archive/2010/02/28/silverlight-twitter-client---part-1.aspx</link>
            <description>&lt;p&gt;&lt;span style="font-family:Times New Roman; font-size:12pt"&gt;Hi, 
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman; font-size:12pt"&gt;Just as I promised a few months back, here is my tutorial for developing a simple Silverlight Twitter client. I was battling to get this done, but in the mean time I decided to attend the &lt;a href="http://sydney.sddn.org.au/"&gt;Sydney Silverlight User Group&lt;/a&gt;. I met &lt;a href="http://twitter.com/shiftkey"&gt;Brendan&lt;/a&gt; there and he has helped me a lot to accomplish this. Thanks to him and SDDN. The basis of this tutorial is derived from the technique as prescribed in &lt;a href="http://toranbillups.com/blog.aspx/archive/2009/11/25/Playing-with-Silverlight-4-Beta"&gt;here&lt;/a&gt;. So let's get started without any further delay. In this post, we will look into creating the necessary UI elements for Login page. 
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman; font-size:12pt"&gt;&lt;strong&gt;Software Requirements: &lt;/strong&gt;
		&lt;/span&gt;&lt;/p&gt;&lt;ol style="margin-left: 54pt"&gt;&lt;li&gt;Visual Studio 2010 Beta 2 Ultimate – Note you need beta 2 and not RC, as for SL4 it's compatible only with Beta 2. Get it &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=dc333ac8-596d-41e3-ba6c-84264e761b81&amp;amp;displaylang=en"&gt;here&lt;/a&gt;. 
&lt;/li&gt;&lt;li&gt;Download Silverlight 4 beta tools from &lt;a href="http://silverlight.net/getstarted/silverlight-4-beta/"&gt;here&lt;/a&gt;. 
&lt;/li&gt;&lt;/ol&gt;&lt;p style="text-align: center"&gt;&lt;img src="http://geekswithblogs.net/images/geekswithblogs_net/maxonweb/022710_2241_Silverlight1.png" alt="" /&gt;&lt;span style="font-family:Times New Roman; font-size:12pt"&gt;
		&lt;/span&gt;&lt;/p&gt;&lt;ol style="margin-left: 54pt"&gt;&lt;li&gt;&lt;div style="text-align: justify"&gt;Name it something and say yes when it asks to create a Web project. 
&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div style="text-align: justify"&gt;Now this type of project would create a skeleton for you to play around, which is fantastic, you don't have to do all the hacks we used to do in SL version 2 and lower. 
&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div style="text-align: justify"&gt;Now add a new Silverlight page to Views folder, by right clicking and choosing add &amp;gt; new item and say Silverlight Page and name it "Login.xaml". 
&lt;/div&gt;&lt;p style="text-align: center"&gt;&lt;img src="http://geekswithblogs.net/images/geekswithblogs_net/maxonweb/022710_2241_Silverlight2.png" alt="" /&gt;&lt;span style="font-family:Times New Roman; font-size:12pt"&gt;
				&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;div style="text-align: justify"&gt;Now go to MainPage.xaml, which is the xaml for the main page. Goto the first element within the &lt;span style="color:blue"&gt;&lt;span style="font-family:Consolas; font-size:9pt"&gt;&amp;lt;&lt;span style="color:#a31515"&gt;uriMapper&lt;span style="color:blue"&gt;:&lt;span style="color:#a31515"&gt;UriMapper&lt;span style="color:blue"&gt;&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;change the first element to something like this&lt;/span&gt; below which says what is the default page that gets loaded when the application runs. Here we are saying that it is the Login page. 
&lt;/div&gt;&lt;p style="margin-left: 90pt"&gt;&lt;span style="color:blue"&gt;&lt;span style="font-family:Consolas; font-size:9pt"&gt;&amp;lt;&lt;span style="color:#a31515"&gt;uriMapper&lt;span style="color:blue"&gt;:&lt;span style="color:#a31515"&gt;UriMapping&lt;span style="color:red"&gt; Uri&lt;span style="color:blue"&gt;=""&lt;span style="color:red"&gt; MappedUri&lt;span style="color:blue"&gt;="/Views/Login.xaml"/&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times New Roman; font-size:12pt"&gt;
					&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;div style="text-align: justify"&gt;Now go to stackpanel which holds the hyperlinks in the MainPage.xaml and add this to the beginning of the existing "home" hyperlink. 
&lt;/div&gt;&lt;p style="margin-left: 108pt"&gt;&lt;span style="color:blue"&gt;&lt;span style="font-family:Consolas; font-size:9pt"&gt;&amp;lt;&lt;span style="color:#a31515"&gt;HyperlinkButton&lt;span style="color:red"&gt; x&lt;span style="color:blue"&gt;:&lt;span style="color:red"&gt;Name&lt;span style="color:blue"&gt;="Login"&lt;span style="color:red"&gt; Style&lt;span style="color:blue"&gt;="{&lt;span style="color:#a31515"&gt;StaticResource&lt;span style="color:red"&gt; LinkStyle&lt;span style="color:blue"&gt;}"&lt;span style="color:red"&gt;
																&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times New Roman; font-size:12pt"&gt;
					&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:red"&gt;&lt;span style="font-family:Consolas; font-size:9pt"&gt;NavigateUri&lt;span style="color:blue"&gt;="/Login"&lt;span style="color:red"&gt; TargetName&lt;span style="color:blue"&gt;="ContentFrame"&lt;span style="color:red"&gt; Content&lt;span style="color:blue"&gt;="Login"/&amp;gt;&lt;span style="color:red"&gt;
											&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times New Roman; font-size:12pt"&gt;
					&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:blue"&gt;&lt;span style="font-family:Consolas; font-size:9pt"&gt;&amp;lt;&lt;span style="color:#a31515"&gt;Rectangle&lt;span style="color:red"&gt; x&lt;span style="color:blue"&gt;:&lt;span style="color:red"&gt;Name&lt;span style="color:blue"&gt;="Divider1"&lt;span style="color:red"&gt; Style&lt;span style="color:blue"&gt;="{&lt;span style="color:#a31515"&gt;StaticResource&lt;span style="color:red"&gt; DividerStyle&lt;span style="color:blue"&gt;}"/&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times New Roman; font-size:12pt"&gt;
					&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;div style="text-align: justify"&gt;Now let us dive into the UI for Login page. I've used the legendary grid for positioning my elements in here. This what the Login page will look like. 
&lt;/div&gt;&lt;p style="text-align: center"&gt;&lt;img src="http://geekswithblogs.net/images/geekswithblogs_net/maxonweb/022710_2241_Silverlight3.png" alt="" /&gt;&lt;span style="font-family:Times New Roman; font-size:12pt"&gt;
				&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;div style="text-align: justify"&gt;There should be a grid there named LayoutRoot, within that, let us create a Grid with 4 rows and 2 columns. The basic ideology of grids in SL is that, you create the layout first and then say for each control in the page to be within which column and row of the grid. 
&lt;/div&gt;&lt;p style="margin-left: 36pt"&gt;&lt;span style="color:blue"&gt;&lt;span style="font-family:Consolas; font-size:9pt"&gt;&amp;lt;&lt;span style="color:#a31515"&gt;Grid&lt;span style="color:red"&gt; Height&lt;span style="color:blue"&gt;="120"&lt;span style="color:red"&gt; Width&lt;span style="color:blue"&gt;="212"&lt;span style="color:red"&gt; HorizontalAlignment&lt;span style="color:blue"&gt;="Center"&lt;span style="color:red"&gt; VerticalAlignment&lt;span style="color:blue"&gt;="Center"&amp;gt;&lt;span style="color:red"&gt;
															&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times New Roman; font-size:12pt"&gt;
					&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;span style="color:blue"&gt;&lt;span style="font-family:Consolas; font-size:9pt"&gt;&amp;lt;&lt;span style="color:#a31515"&gt;Grid.RowDefinitions&lt;span style="color:blue"&gt;&amp;gt;&lt;span style="color:#a31515"&gt;
						&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times New Roman; font-size:12pt"&gt;
			&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-left: 54pt"&gt;&lt;span style="color:blue"&gt;&lt;span style="font-family:Consolas; font-size:9pt"&gt;&amp;lt;&lt;span style="color:#a31515"&gt;RowDefinition&lt;span style="color:red"&gt; Height&lt;span style="color:blue"&gt;="40"&amp;gt;&amp;lt;/&lt;span style="color:#a31515"&gt;RowDefinition&lt;span style="color:blue"&gt;&amp;gt;&lt;span style="color:#a31515"&gt;
									&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times New Roman; font-size:12pt"&gt;
			&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-left: 36pt"&gt;&lt;span style="color:#a31515"&gt;&lt;span style="font-family:Consolas; font-size:9pt"&gt;     &lt;span style="color:blue"&gt;&amp;lt;&lt;span style="color:#a31515"&gt;RowDefinition&lt;span style="color:red"&gt; Height&lt;span style="color:blue"&gt;="25"&amp;gt;&amp;lt;/&lt;span style="color:#a31515"&gt;RowDefinition&lt;span style="color:blue"&gt;&amp;gt;&lt;span style="color:#a31515"&gt;
										&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times New Roman; font-size:12pt"&gt;
			&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-left: 54pt"&gt;&lt;span style="color:blue"&gt;&lt;span style="font-family:Consolas; font-size:9pt"&gt;&amp;lt;&lt;span style="color:#a31515"&gt;RowDefinition&lt;span style="color:red"&gt; Height&lt;span style="color:blue"&gt;="25"&amp;gt;&amp;lt;/&lt;span style="color:#a31515"&gt;RowDefinition&lt;span style="color:blue"&gt;&amp;gt;&lt;span style="color:#a31515"&gt;
									&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times New Roman; font-size:12pt"&gt;
			&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-left: 54pt"&gt;&lt;span style="color:blue"&gt;&lt;span style="font-family:Consolas; font-size:9pt"&gt;&amp;lt;&lt;span style="color:#a31515"&gt;RowDefinition&lt;span style="color:red"&gt; Height&lt;span style="color:blue"&gt;="25"&amp;gt;&amp;lt;/&lt;span style="color:#a31515"&gt;RowDefinition&lt;span style="color:blue"&gt;&amp;gt;&lt;span style="color:#a31515"&gt;
									&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times New Roman; font-size:12pt"&gt;
			&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-left: 54pt"&gt;&lt;span style="color:blue"&gt;&lt;span style="font-family:Consolas; font-size:9pt"&gt;&amp;lt;&lt;span style="color:#a31515"&gt;RowDefinition&lt;span style="color:red"&gt; Height&lt;span style="color:blue"&gt;="*" /&amp;gt;&lt;span style="color:red"&gt;
							&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times New Roman; font-size:12pt"&gt;
			&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-left: 54pt"&gt;&lt;span style="color:blue"&gt;&lt;span style="font-family:Consolas; font-size:9pt"&gt;&amp;lt;/&lt;span style="color:#a31515"&gt;Grid.RowDefinitions&lt;span style="color:blue"&gt;&amp;gt;&lt;span style="color:#a31515"&gt;
						&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times New Roman; font-size:12pt"&gt;
			&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-left: 54pt"&gt;&lt;span style="color:blue"&gt;&lt;span style="font-family:Consolas; font-size:9pt"&gt;&amp;lt;&lt;span style="color:#a31515"&gt;Grid.ColumnDefinitions&lt;span style="color:blue"&gt;&amp;gt;&lt;span style="color:#a31515"&gt;
						&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times New Roman; font-size:12pt"&gt;
			&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-left: 54pt"&gt;&lt;span style="color:blue"&gt;&lt;span style="font-family:Consolas; font-size:9pt"&gt;&amp;lt;&lt;span style="color:#a31515"&gt;ColumnDefinition&lt;span style="color:red"&gt; Width&lt;span style="color:blue"&gt;="60"&amp;gt;&amp;lt;/&lt;span style="color:#a31515"&gt;ColumnDefinition&lt;span style="color:blue"&gt;&amp;gt;&lt;span style="color:#a31515"&gt;
									&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times New Roman; font-size:12pt"&gt;
			&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-left: 54pt"&gt;&lt;span style="color:blue"&gt;&lt;span style="font-family:Consolas; font-size:9pt"&gt;&amp;lt;&lt;span style="color:#a31515"&gt;ColumnDefinition&lt;span style="color:red"&gt; Width&lt;span style="color:blue"&gt;="230"&amp;gt;&amp;lt;/&lt;span style="color:#a31515"&gt;ColumnDefinition&lt;span style="color:blue"&gt;&amp;gt;&lt;span style="color:#a31515"&gt;
									&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times New Roman; font-size:12pt"&gt;
			&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-left: 54pt"&gt;&lt;span style="color:blue"&gt;&lt;span style="font-family:Consolas; font-size:9pt"&gt;&amp;lt;/&lt;span style="color:#a31515"&gt;Grid.ColumnDefinitions&lt;span style="color:blue"&gt;&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times New Roman; font-size:12pt"&gt;
			&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-left: 54pt"&gt;&lt;span style="color:blue"&gt;&lt;span style="font-family:Consolas; font-size:9pt"&gt;        &amp;lt;/&lt;span style="color:#a31515"&gt;Grid&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times New Roman; font-size:12pt"&gt;
			&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;ol style="margin-left: 54pt"&gt;&lt;li&gt;&lt;div style="text-align: justify"&gt;All the elements that need to be within this grid must be within the Grid node. And each of those elements will have Grid.Column and Grid.Row to specify the column and row numbers. 
&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div style="text-align: justify"&gt;Here comes the individual Login block element, you can always use the powerful designer to drag and position your controls. Because of that, you will have funny margins in the controls. 
&lt;/div&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman; font-size:12pt"&gt; &lt;/span&gt;&lt;span style="color:blue"&gt;&lt;span style="font-family:Consolas; font-size:9pt"&gt;&amp;lt;&lt;span style="color:#a31515"&gt;TextBlock&lt;span style="color:red"&gt; Foreground&lt;span style="color:blue"&gt;="White"&lt;span style="color:red"&gt; HorizontalAlignment&lt;span style="color:blue"&gt;="Center"&lt;span style="color:red"&gt; FontSize&lt;span style="color:blue"&gt;="20"&lt;span style="color:red"&gt; Text&lt;span style="color:blue"&gt;="Login"&lt;span style="color:red"&gt; Grid.Column&lt;span style="color:blue"&gt;="1"&lt;span style="color:red"&gt; Margin&lt;span style="color:blue"&gt;="21,0,155,0"&amp;gt;&amp;lt;/&lt;span style="color:#a31515"&gt;TextBlock&lt;span style="color:blue"&gt;&amp;gt;&lt;span style="color:#a31515"&gt;
																					&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times New Roman; font-size:12pt"&gt;
					&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:blue"&gt;&lt;span style="font-family:Consolas; font-size:9pt"&gt;&amp;lt;&lt;span style="color:#a31515"&gt;TextBlock&lt;span style="color:red"&gt; HorizontalAlignment&lt;span style="color:blue"&gt;="Left"&lt;span style="color:red"&gt; Foreground&lt;span style="color:blue"&gt;="White"&lt;span style="color:red"&gt; Grid.Row&lt;span style="color:blue"&gt;="1"&lt;span style="color:red"&gt; Grid.Column&lt;span style="color:blue"&gt;="0"&lt;span style="color:red"&gt; VerticalAlignment&lt;span style="color:blue"&gt;="Center"&lt;span style="color:red"&gt; Width&lt;span style="color:blue"&gt;="Auto"&amp;gt;&lt;span style="color:#a31515"&gt;Username&lt;span style="color:blue"&gt;&amp;lt;/&lt;span style="color:#a31515"&gt;TextBlock&lt;span style="color:blue"&gt;&amp;gt;&lt;span style="color:#a31515"&gt;
																							&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times New Roman; font-size:12pt"&gt;
					&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:blue"&gt;&lt;span style="font-family:Consolas; font-size:9pt"&gt;&amp;lt;&lt;span style="color:#a31515"&gt;TextBox&lt;span style="color:red"&gt; Width&lt;span style="color:blue"&gt;="150"&lt;span style="color:red"&gt; Name&lt;span style="color:blue"&gt;="TwitterUsername"&lt;span style="color:red"&gt; Grid.Row&lt;span style="color:blue"&gt;="1"&lt;span style="color:red"&gt; Grid.Column&lt;span style="color:blue"&gt;="1"&lt;span style="color:red"&gt; HorizontalAlignment&lt;span style="color:blue"&gt;="Left"&amp;gt;&amp;lt;/&lt;span style="color:#a31515"&gt;TextBox&lt;span style="color:blue"&gt;&amp;gt;&lt;span style="color:#a31515"&gt;
																			&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times New Roman; font-size:12pt"&gt;
					&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:blue"&gt;&lt;span style="font-family:Consolas; font-size:9pt"&gt;&amp;lt;&lt;span style="color:#a31515"&gt;TextBlock&lt;span style="color:red"&gt; Grid.Row&lt;span style="color:blue"&gt;="2"&lt;span style="color:red"&gt; Grid.Column&lt;span style="color:blue"&gt;="0"&lt;span style="color:red"&gt; HorizontalAlignment&lt;span style="color:blue"&gt;="Left"&lt;span style="color:red"&gt; Foreground&lt;span style="color:blue"&gt;="White"&lt;span style="color:red"&gt; VerticalAlignment&lt;span style="color:blue"&gt;="Center"&lt;span style="color:red"&gt; Width&lt;span style="color:blue"&gt;="Auto"&amp;gt;&lt;span style="color:#a31515"&gt;Password&lt;span style="color:blue"&gt;&amp;lt;/&lt;span style="color:#a31515"&gt;TextBlock&lt;span style="color:blue"&gt;&amp;gt;&lt;span style="color:#a31515"&gt;
																							&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times New Roman; font-size:12pt"&gt;
					&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:blue"&gt;&lt;span style="font-family:Consolas; font-size:9pt"&gt;&amp;lt;&lt;span style="color:#a31515"&gt;PasswordBox&lt;span style="color:red"&gt; Grid.Row&lt;span style="color:blue"&gt;="2"&lt;span style="color:red"&gt; Grid.Column&lt;span style="color:blue"&gt;="1"&lt;span style="color:red"&gt; Width&lt;span style="color:blue"&gt;="150"&lt;span style="color:red"&gt; Name&lt;span style="color:blue"&gt;="TwitterPassword"&lt;span style="color:red"&gt; HorizontalAlignment&lt;span style="color:blue"&gt;="Left"&amp;gt;&amp;lt;/&lt;span style="color:#a31515"&gt;PasswordBox&lt;span style="color:blue"&gt;&amp;gt;&lt;span style="color:#a31515"&gt;
																			&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times New Roman; font-size:12pt"&gt;
					&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:blue"&gt;&lt;span style="font-family:Consolas; font-size:9pt"&gt;&amp;lt;&lt;span style="color:#a31515"&gt;Button&lt;span style="color:red"&gt; Name&lt;span style="color:blue"&gt;="btnTwitterCredentialsSubmit"&lt;span style="color:red"&gt; Grid.Row&lt;span style="color:blue"&gt;="3"&lt;span style="color:red"&gt; HorizontalAlignment&lt;span style="color:blue"&gt;="Center"&lt;span style="color:red"&gt; Width&lt;span style="color:blue"&gt;="105"&lt;span style="color:red"&gt; Click&lt;span style="color:blue"&gt;="btnTwitterCredentialsSubmit_Click"&lt;span style="color:red"&gt; Content&lt;span style="color:blue"&gt;="Submit"&lt;span style="color:red"&gt; Margin&lt;span style="color:blue"&gt;="0,0,125,0"&lt;span style="color:red"&gt; Grid.Column&lt;span style="color:blue"&gt;="1"&amp;gt;&amp;lt;/&lt;span style="color:#a31515"&gt;Button&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Times New Roman; font-size:12pt"&gt;
					&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;div style="text-align: justify"&gt;I think I am gonna stop it here for now, blog post is becoming too lengthy. I think this tutorial will go for at least 10 posts. So catch you soon in the next post with more information. In the next part, we will setup a global class to storing and accessing the username and password, retrieving your friends status updates, no access to few pages if the user is not logged in, set your status. We will add more features to make it a more feature rich. 
&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div style="text-align: justify"&gt;Here is the complete &lt;a href="http://maxonweb.pastebin.com/ek3nSvGq"&gt;Login.xaml&lt;/a&gt; and the completed &lt;a href="http://maxonweb.pastebin.com/vnGD3kVV"&gt;MainPage.xaml&lt;/a&gt;.
&lt;/div&gt;&lt;/li&gt;&lt;li&gt;&lt;div style="text-align: justify"&gt;If you've any comments / suggestions / questions, please leave a feedback for contact me.&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt; &lt;img src="http://geekswithblogs.net/maxonweb/aggbug/138226.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Max</dc:creator>
            <guid>http://geekswithblogs.net/maxonweb/archive/2010/02/28/silverlight-twitter-client---part-1.aspx</guid>
            <pubDate>Sat, 27 Feb 2010 22:41:34 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/maxonweb/comments/138226.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/maxonweb/archive/2010/02/28/silverlight-twitter-client---part-1.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/maxonweb/comments/commentRss/138226.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/maxonweb/services/trackbacks/138226.aspx</trackback:ping>
        </item>
        <item>
            <title>Silverlight Tutorial Part 1</title>
            <link>http://geekswithblogs.net/maxonweb/archive/2009/11/27/silverlight-tutorial-part-1.aspx</link>
            <description>&lt;p&gt;Welcome to the first part of the Silverlight 3 tutorial. I know SL4 Beta is out, but if you have your fundamentals right, versions are not a problem, just a little bit of study will keep you abreast of the latest version. Here are some prerequisites for this tutorials. Remember, our ultimate aim here is to create a Twitter client from Silverlight. &lt;/p&gt;  &lt;p&gt;Softwares required:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;1) Visual Studio 2008 with SP1&lt;/p&gt;    &lt;p&gt;2) Silverlight 3 Tools for VS2008 - &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=9442B0F2-7465-417A-88F3-5E7B5409E9DD&amp;amp;displaylang=en" target="_blank"&gt;here&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;3) Silverlight 3 SDK – &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=1EA49236-0DE7-41B1-81C8-A126FF39975B&amp;amp;displaylang=en" target="_blank"&gt;here&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;4) Expression Blend 3 – I am not a designer myself, but still its a wonderful and worth exploring, I will throw a bit of light on this.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Knowledge requirements (I assume these):&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;1) Familiarity with .Net Framework programming and C# – I’ll be using C# for this tutorials.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now lets us start jump right into the tutorial.&lt;/p&gt;  &lt;p&gt;1) Once you install the above said softwares, you can go to New &amp;gt; Project and choose C# &amp;gt; Silverlight App, like below&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/maxonweb/WindowsLiveWriter/SilverlightTutorialPart1_12769/NewSilverlight.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="NewSilverlight" border="0" alt="NewSilverlight" src="http://geekswithblogs.net/images/geekswithblogs_net/maxonweb/WindowsLiveWriter/SilverlightTutorialPart1_12769/NewSilverlight_thumb.png" width="657" height="467" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;2) Now after you do this, it will ask you this, you can choose Website and Application, it really does not matter here. As this is more to do with deployment.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/maxonweb/WindowsLiveWriter/SilverlightTutorialPart1_12769/NewSLAppConfirmation.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="NewSLAppConfirmation" border="0" alt="NewSLAppConfirmation" src="http://geekswithblogs.net/images/geekswithblogs_net/maxonweb/WindowsLiveWriter/SilverlightTutorialPart1_12769/NewSLAppConfirmation_thumb.png" width="331" height="201" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;3) Now by default, it will create the MainPage.xaml.cs. Just create a new button by typing &amp;lt;But and choose &amp;lt;Button from the intellisense, then add a content, which can be compared as “Text” to other WPF and ASP.NET textbox property.&lt;/p&gt;  &lt;p&gt;4) Now add the click event handler, when you do this, VS2008 will automatically create the event handler for you. So just go to code behind view and in there, create a alert box using MessageBox.Show method.&lt;/p&gt;  &lt;div align="center"&gt;   &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 63.78%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; height: 95px; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Button_Click(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;    MessageBox.Show(&lt;span style="color: #006080"&gt;"Hello World."&lt;/span&gt;);&lt;br /&gt;    Button1.Content = &lt;span style="color: #006080"&gt;"Hello World"&lt;/span&gt;;&lt;br /&gt;}&lt;/pre&gt;

    &lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;5) Voila, run it and you should be able to see the Silverlight in a browser. Click button and there you go!&lt;/p&gt;

&lt;p&gt;&lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/maxonweb/WindowsLiveWriter/SilverlightTutorialPart1_12769/SLHelloWorld_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="SLHelloWorld" border="0" alt="SLHelloWorld" src="http://geekswithblogs.net/images/geekswithblogs_net/maxonweb/WindowsLiveWriter/SilverlightTutorialPart1_12769/SLHelloWorld_thumb.png" width="356" height="203" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;See you in the next tutorial! Comment below for any doubts or clarifications / issues.&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:107fc0c4-8485-4abc-b5cf-c3ddd40740ad" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Silverlight" rel="tag"&gt;Silverlight&lt;/a&gt;&lt;/div&gt; &lt;img src="http://geekswithblogs.net/maxonweb/aggbug/136564.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Max</dc:creator>
            <guid>http://geekswithblogs.net/maxonweb/archive/2009/11/27/silverlight-tutorial-part-1.aspx</guid>
            <pubDate>Fri, 27 Nov 2009 10:34:59 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/maxonweb/comments/136564.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/maxonweb/archive/2009/11/27/silverlight-tutorial-part-1.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/maxonweb/comments/commentRss/136564.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/maxonweb/services/trackbacks/136564.aspx</trackback:ping>
        </item>
        <item>
            <title>Our plan for the next few months&amp;hellip;</title>
            <link>http://geekswithblogs.net/maxonweb/archive/2009/11/25/136524.aspx</link>
            <description>&lt;p&gt;We look to learn the Silverlight, WPF and ASP.NET MVC 2 over the next few months. We’ll start developing a data driven application to explore each one of these. I am now in the process of finding a sample database for use.&lt;/p&gt;  &lt;p&gt;We will start our tutorials from next week. Stay tuned until then.&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:92c3d733-6066-4b7b-b96c-421d070f279e" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/ASP.NET" rel="tag"&gt;ASP.NET&lt;/a&gt;,&lt;a href="http://technorati.com/tags/MVC" rel="tag"&gt;MVC&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Silverlight" rel="tag"&gt;Silverlight&lt;/a&gt;,&lt;a href="http://technorati.com/tags/WPF" rel="tag"&gt;WPF&lt;/a&gt;&lt;/div&gt; &lt;img src="http://geekswithblogs.net/maxonweb/aggbug/136524.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Max</dc:creator>
            <guid>http://geekswithblogs.net/maxonweb/archive/2009/11/25/136524.aspx</guid>
            <pubDate>Wed, 25 Nov 2009 10:35:43 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/maxonweb/comments/136524.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/maxonweb/archive/2009/11/25/136524.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/maxonweb/comments/commentRss/136524.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/maxonweb/services/trackbacks/136524.aspx</trackback:ping>
        </item>
    </channel>
</rss>
