Yes, this title is influenced by death by chocolate, where in you get an overdose of chocolate. At this time I feel exactly the same for Silverlight (SL). With just over 2 years since the first version made its mark felt, Silverlight has come a long long way. Ironically, as part of TechDays event hosted specifically at our campus, we talked a lot about SL3 and right then, across the ocean, at PDC 2009, Microsoft just unveiled SL4 beta bits.
When we started looking at SL 1.0 back in late 2007, it had limited feature set with XAML support, and most work had to be done in java script. It looked more of media (video) playback at that time. MS called it their RIA platform, but it didn't offer much at that time. With SL2 at PDC 2008 and SL3 just earlier this year in July 2009, a host of features have found their way in the platform. Along with multitude of controls, to .net language support, to IIS Smooth streaming, to perspective 3D, to out of browser experience, SL is a technology you just cannot ignore.
I have been busy with various other non-technical work for few months and hence didn't get a chance to experiment anything new Off late. I finally managed to find time and check out Sketchflow. Sketchflow is a new tool available along with Expression 3 Suite which allows quick and easy prototyping. It allows one to create prototypes that are very near real appliation like, but still retain their prototype look and feel (by using wiggly styled controls) and allow for easy feedback back and forth between you and your customers.
If you have't seen this as yet, you can get a very good idea on it by checking out the following
1. Keynote video from MIX 09, where Jon Harris showed a very interesting Sketchflow prototype. You can skip to about 1 hr 39 min into the video to directly jump to this part
2. From Concept to Production video, another session from MIX 09, by Christian Schormann, where he walks through a snowboard sketchflow prototype. This and the keynote video code comes as part of samples with Blend 3.
3. A very good step by step walkthrough of Sketchflow is available at the dynamic prototyping site.
I am enjoying working with Sketchflow.
My team members are working on a Silverlight based application to be deployed on Cloud. Things were going smoothly when one of us tried accessing this application via IE 8 and we were surprised to see the application not filling 100% height but taking about 25% space only. We tried various options for setting the height to 100% like setting it for body element, as well for the form element etc, but with not much luck.
Finally, found a workaround on the forum here. Setting the meta tag in the head to enable IE 7 compatibility (<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />) worked. This is surely not the preferred solution, but it got us going. Do share if there are any other options that may have worked for you.
Recently, I was faced with a situation where a really interesting project came with an important rider. The project needed to be done using Silverlight 2 though Silverlight 3 is now available and is getting good traction.
Continue reading "Switching from Silverlight 3 to Silverlight 2" »
Every new technology brings its own mechanism to mitigate security threats. This post discusses on how silverlight deals with cross site scripting.
Microsoft introduced Windows Presentation Foundation (WPF) with .NET framework 3.0. What started as extensions to Visual Studio (VS) 2005 is a now a in-house native to VS 2008 and the VS 2010 designer is itself getting implemented in WPF (more details in Jason's blog here).
Needless to say that WPF is very powerful new presentation platform that really makes "imagination is the limit" a reality. Designers and developers can now work real closely like never before and create some really super cool user experiences.
Continue reading "WPF, XBAP, Silverlight - What do I use?" »
The other day we were ready to deploy an internal facing Silverlight 2.0 built application. As a final round of testing, I thought to put to use the EnableRedrawRegions settings that I had just learnt from Seema's talk in PDC 2008 as part of her session - Building an Optimized, Graphics-Intensive Application in Microsoft Silverlight.
Interestingly, after the application loaded, I could see a small portion in the middle of the page continuously changing colors. It could only mean that this region was getting redrawn again and again. But why? Checking the code we realized that we had some animation at load time and once the data was loaded, the animating panel was just pushed to back in Z order and another panel came on top. But this still meant that the animation was happening, but we could not see it. This EnableRedrawRegions flag really helped immediately identify and remove unwanted animation (we set the panel's visibility to collapsed).
If you have been following updates on Silverlight (SL) 2, you would already be aware of SL 2 Toolkit on codeplex. Scott in his blog has shared some amazing numbers on usage of SL and also given some indicators to where SL is headed in its next version.
I had been away from SL for some time due to other focus areas. However I decided to try my hands on the support for themes, a feature added with SL Toolkit.
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.
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" »
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" »
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).
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.
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.
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.
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.
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" »
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.
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" »
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" »
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?" »
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.
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 !
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" »
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" »
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.
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" »