Infosys Microsoft Alliance and Solutions blog

Main

October 13, 2008

Silverlight 2 RTM

Some days back Microsoft had released the RC0 version of Silverlight. Considering that PDC 2008 is just about 2 weeks away, there was much speculation that that's when Silverlight 2 will RTM. But according to Mary-Jo, the release is very much expected later today. Keep an eye on Scott's blog for the announcement.

[Update: 14 Oct 4.20 am] The download should be available in the next few hours. Check the press release.

[Update: 14 Oct 9.00 am] Silverlight 2 is now available. To install the runtime, visit here. For related developer tools, visit here.

October 01, 2008

Part 2: Manage Page level states with VisualStateManager in Silverlight

In part 1 we saw how using basic storyboarding/animation capabilities in Silverlight, we created a simple application where buttons move to new location when clicked and move back when another button is clicked. In this part we will see how using VSM, we can build the same capabilities with lesser animations and lesser code. The complete code (including code for part 1) can be downloaded from here - Download file. Note that I have built this using SL 2.0 RC0, but the concepts explained here will work with Beta 2 bits as well.

Continue reading "Part 2: Manage Page level states with VisualStateManager in Silverlight" »

September 30, 2008

Part 1: Manage Page level states with VisualStateManager in Silverlight

Silverlight 2.0 Beta 2 introduced the concept of Visual State Manager (VSM). If you haven't checked it out still, here are some articles that will get you started.

VSM not only helps keep the looks and behavior of a control separate, it allows you to manage the various states the control can be in, along with the transitions, in a very clean and effective manner. Though most of the examples online today show this in context of a specific control and working with its control template, there is no reason why this can't be applied to the UserControl itself, i.e. at the Page level. You can very easily create custom states for your page and manage transitions between the states. In fact this can actually help reduce the total animations that you may have to write and also simplify the backend code.

Continue reading "Part 1: Manage Page level states with VisualStateManager in Silverlight" »

September 29, 2008

Silverlight 2.0 RC0 Installation

You would already be aware of the release of RC0 of Silverlight 2.0. If not check Scott's blog here. The details on the links for downloading these latest bits can be found in the same blog.

Note that unlike the previous Beta 2, this version doesn't comes with a go live license and if you visit the Silverlight installer page online, you will see that it still points to the earlier Beta 2 version (2.0.30523.8).  

Continue reading "Silverlight 2.0 RC0 Installation" »

August 22, 2008

Reflector needs registration

There will be probably very few out there who haven't heard about Reflector and don't use it. Earlier today I noticed this blog that mentioned Red gate acquiring Reflector. I proceed to the mentioned site. I noticed that the latest version if 5.1.3 and I had 5.1.1. so I clicked the "Download your free copy now!" button.

Interestingly the tool may still be free, but laying your hands on it isn't that easy anymore. You are now required to register to download. This is a bit of a damper. I will eventually register and download the latest, but having to register to get the freely available tool earlier !! I don't like it.

August 19, 2008

DeepZoom - unable to export

I had downloaded the latest Deep Zoom composer and was working with it to create a project with many images. Once done with the scenario, when I went to the export tab, I found that the export button was disabled. I could not figure out a way to enable it. Even providing the output path didn't help and I could not get any specific answers online.

Later I realized that this was happening since I had exceeded 4 billion pixels and hence the export wasn't working. This message was put in the bottom right corner of the application in the composer tab (see image below) and hence i had missed seeing it earlier. The "Learn More" link however doesn't help as well and only points to the Expression Blog. Reducing the # images, I was later able to export successfully.

deepzoom.jpg

August 06, 2008

Silverlight Offline Database Storage

In previous article I talked about Offline Web applications and how local database storage is central to make this happen.  In  this article I will show you how to build a simple local database in Silverlight using Isolated Storage and LINQ.

 

Continue reading "Silverlight Offline Database Storage" »

Offline Web Applications

Consider a  travelling salesman who uses online applications to access his emails, keep a tab of his appointments and to store his contact information. Since he will be  travelling most of the time, he may not access to internet connection all the time. When he is offline, he can no longer access his favorite online applications.

The HTML5 specification tries to address this by providing  two solutions: local data storage and an offline application HTTP cache which makes sure application is available when user is not connected. Currently Firefox 3 is planning to support these capabilities. It will be interesting to see how the other browsers support this specification.

Continue reading "Offline Web Applications" »

July 30, 2008

Silverlight 2.0 - Interaction with HTML DOM

Back to the place I like the most. There are a lot many things that have happened in the last few months on Silverlight 2.0. The developer community of Silverlight is upbeat and I am sure that the excitement is here to stay. I have been working a few applications on Silverlight are there is a lot of curiosity about how Silverlight will change the future of the applications in the web space. All this apart, I've had my hands on the technology for sometime now and was able to see a lot many things possible now (though there many more to come). The best part of the story is the interaction between the HTML DOM and the Silverlight Sandbox.

Continue reading "Silverlight 2.0 - Interaction with HTML DOM" »

July 23, 2008

Silverlight Desktop Applications

One of the features many Silverlight developers are asking about is the ability to run an existing Silverlight application on the desktop. They want to make it a standalone application that can run outside of the browser. Mono team  has  come up with Moonlight desklets  which allows to run Moonlight(Silverlight on Linux) to run as standalone applications on the desktop. They also requested MS to build support for this to Silverlight to make cross-platform Silverlight desktop a reality.

After pondering about how to make Silverlight run as a standalone application on Windows for sometime , I came up with an easy way to accomplish this using HTML Applications(HTA). This article outlines the steps of creating a simple Silverlight desktop application.

Continue reading "Silverlight Desktop Applications" »

July 10, 2008

Silverlight - Preventing direct editing in DatePicker control

In my earlier blog I mentioned about the custom DatePicker control. Towards the end where I mentioned about making the textbox read only, I also mentioned about not being able to edit this template in Expression Blend 2.5 June CTP. On the forums, someone clarified that since this control doesn't resides in System.Windows.dll, its template cannot be edited in current version of Blend.

One can however include the template as mentioned in MSDN and include that in the project and modify suitably. When I included that in a test project, I ended up with System.Stack.OverflowException. That can however be fixed easily as I mentioned here.

Continue reading "Silverlight - Preventing direct editing in DatePicker control" »

July 09, 2008

Silverlight - Handling Start and End dates with Custom DatePicker Control

When working with DatePicker controls in application, very typically they get used to manage start and end dates. Like recently I was writing a tracking application in Silverlight and had the need to manage allocation and deallocation and hence start and end dates. There are typical requirements also associated with such implementations like start date cannot be in past, end date cannot be before start date.

Implementing this with Silverlight DatePicker controls was fairly trivial. If you haven't used these controls, you can find an introduction to them here. These controls also offer other interesting properties that I played with namely DisplayStartDate. I then thought that some of things I did in the logic, would be useful in multiple scenarios, so why not create a new custom DatePicker control that will have these functionalities in-built.

Continue reading "Silverlight - Handling Start and End dates with Custom DatePicker Control" »

July 08, 2008

ASP.NET, ASP.NET AJAX and Silverlight - Which way would you go?

Want to develop a web application using Microsoft Technologies? The choice today will revolve around the mature ASP.NET, the upcoming ASP.NET AJAX or Silverlight (Beta 2 currently available). Needless to say that all have their benefits and specific features that make them attractive options to use.

Choice will also depend very much on if the application is internet or intranet facing, so let's talk about internet facing application. Both ASP.NET and ASP.NET AJAX are pretty much server side applications in that most of their logic resides on server side. 

Continue reading "ASP.NET, ASP.NET AJAX and Silverlight - Which way would you go?" »

July 04, 2008

Silverlight - Animating Wrap Panel

Panels, as we know, are pretty much the basis of building any Silverlight application. They help arrange the other Silverlight controls in specific manner like Stack allowing you to stack controls either horizontally or vertically, Grid allowing you to position controls in rows an columns and Canvas giving you a free flow behavior. This blog however isn't however a primer on panels and you can easily find information about them on the net. Check this for information on how to layout controls using these various panels.

At Mix 2008, in one of the sessions the AnimatingStackPanel was demonstrated. I found the code for the same here. I decided to go ahead and try this. However my requirement was for a wrap panel and not a stack panel. I found one here. This would serve my purpose but there wasn't any animation in it. In my earlier work with WPF, I had looked at Kevin's bag of tricks and liked the AnimatingTilePanel.

Continue reading "Silverlight - Animating Wrap Panel" »

Silverlight - Are you missing WatermarkedTextBox?

One of controls that I had been using when working with SL 2 Beta 1 was WatermarkedTextBox and when this was taken off from SL 2 Beta 2, I had to rework our application code. It is great to see the control now posted on Kathy's blog here. The discussion seem to incidate that we won't get the updated TextBox with Watermark property in Silverlight 2 RTM.

I downloaded this, but wasn't able to use it as is since the code continues to use System.Windows.Controls.Extended assembly name. I was using other controls like Calendar and DatePicker from the released System.Windows.Controls.Extended assembly with SL2 and this caused conflict when trying to add the assembly for using WatermarkedTextBox. This was however easily fixed by changing the project properties to create the assembly with the name WatermarkedTextBox.dll. I also had to change the namespace in the WatermarkedTextBox.xaml to the following to get the control working.

   xmlns:local= "clr-namespace:System.Windows.Controls;assembly=WatermarkedTextBox" 

Till the new property is available, this will do !

July 02, 2008

Silverlight - CheckBox issue when in ListBox

Recently for an application I was building on Silverlight 2.0 Beta 2, I had a need to use CheckBox inside the ListBox. Getting the CheckBox into the ListBox item was fairly trivial via the DataTemplate. However the problem started after that.

I could click on the first CheckBox, but when I tried to click on any in the remaining rows, the click won't work. I could easily see the hover effect over the CheckBox so wasn't sure why the click had issues.

Continue reading "Silverlight - CheckBox issue when in ListBox" »

June 25, 2008

Silverlight - Getting Tooltip to work for individual ListBox Items

 The other day for a project work that we were doing in Silverlight 2.0 Beta 2, I was trying to get a tooltip to display for each item in the ListBox control. Things seemed to work fine if the content to be displayed in the tooltip was pretty much static or not dependant on individual items. I mean, I had a need that the tooltip should display different text per item, essentially data bind to some value for each item.

Does this makes sense? I guess it does to me, but you may be wondering about what exactly am I trying to achieve? Let me explain that with sample code. Below is the trivialized version of the code I was working on. There is a list of employees, who I am displaying in a ListBox.

Continue reading "Silverlight - Getting Tooltip to work for individual ListBox Items" »

June 24, 2008

Silverlight - missed compiler error

Recently during my attempts to program with Silverlight landed me with a runtime exception (System.Windows.Markup.XamlParseException) with error as AG_E_PARSER_BAD_PROPERTY_VALUE. Fortunately, the error also provided line and column number in XAML. However when I looked at the XAML, it looked well formed and there wasn't any compilation error as well.

It was then that i realized that the compiler had actually missed catching the fact that I had defined click event handler for a Button in XAML, but not written it in the code behind. Having worked with WPF, I know that such errors are caught at compile time. I am surprised why Silverlight compiler missed this.

 

June 12, 2008

Migrating Comparis Silverlight Challenge App to Silverlight 2.0 Beta 2

With the Silverlight 2.0 Beta 2 now available, I finally decided to take the plunge. So far, I had been focusing on WPF, but knowing that Silverlight is the next big wave for RIA development, I could not stay away longer.

A few fellow colleagues have been working with Silverlight 2.0 Beta 1 and I heard from them that Beta 2 has been a bit of a challenge considering the various breaking changes from Beta 1 to Beta 2. Fortunately these were mostly functional/API issues with Silverlight controls and not like the interesting issue faced by my colleague Kishore with his attempt to work with .net 3.5 SP1 beta. Since I was new, I started with the Comparis Silverlight Challenge Application and the HOL created by Swiss MSDN Team.

Continue reading "Migrating Comparis Silverlight Challenge App to Silverlight 2.0 Beta 2" »