Styles in Silverlight: an Introduction

I’m writing a (planned) 4 parts series on everything I think it’s worth knowing about styles in Silverlight. The first part is ready and it covers the following topics:

You can read the (much more detailed) full article on my Scott Logic blog. This part has meant to be an introduction, the next parts will dig into more advanced Style usage scenarios.

World Cup 2010 Real-Time Push Web App Competition Winner!

A month ago Kwwika, a real-time data streaming service provider annonced a competition to build a mash up that uses their World Cup 2010 Twitter streams. I’ve decided to enter the competition and visualize the stream of tweets in a fun and engaging way. As the competition closed on 11th July, my entry was selected as one of the winners!


My entry, Tweet For Your Team shows the tweets of the two teams simultaneously. It measures the live intensity of the tweets (how many are written per minute for each team) and also analyzes their mood by matching keywords and using simple rules to decide whether a tweet carries positive or negative emotions for the team.

The entry also allows visitors to get involved and cheer for or against their team with a single click sending a shout visible to other users off the application. See this post on further details on the application functionality.

Winners of the competition were announced just before the World Cup 2010 final and I was happy to see my entry being selected one of the two winners. As the judging panel wrote in their summary:
“Gergely created a really engaging application that you could easily sit and watch and interact with during any live World Cup match.” And “The performance of the application is really impressive considering tweet rates for Spain alone have been seen to hit 3500 tweets per minute.”

You can read more about the application in the following previous posts:

And of course you can see it in action at!

Cheer For Your Team With a Click on!

I’ve created TweetForYourTeam just a week ago and have just added a major update with a couple of fun features.

Cheer By a Single Click

In the original version of TweetForYourTeam one was able to engage in cheering for or against a team by sending a tweet to Twitter. In the current update an easier method has been implemented. Under each teams two buttons have been placed that allow one to cheer for or against the team by hitting the button.


Whenever one sends a cheer (or anti-cheer), a cool animation happens on the screen. At the same time this cheer is sent back to the server and immediately appears on all other users’ screen real-time, using Kwwika’s real time notification streaming. So whenever you cheer, everyone else gets to see the same effect go off on their screen.

Read More…

Streaming World Cup Tweets in Silverlight With a Few Lines of Code

The World Cup is on and there have been quite a few good Twitter mashups made for this event, probably the most popular being TweetBeat (and I’ve also developed one, Tweet For Your Team). In this post I’ll show how to build a simple service similar to TweetBeat using a publicly available real-time streaming service, Kwwika.

The application built in this short tutorial will be the following:

Why use a streaming service?

Getting tweets on a certain topic – in our case, the World Cup – can be done in three main ways:

Read More…

World Cup 2010 Real Time Twitter Mashup

This World Cup has been exciting for me not just because of the great games but also because during the group stages I’ve been building a cool real time spectator monitoring application for it: Tweet For Your Team (powered by Kwwika real time data services).

What does it do?

The application streams tweets live from the two teams playing live or playing the next game (using the Kwwika service). It also shows the live score on the top (provided by Opta), so even if you’re not in front of a telly, you can be aware of it. Now, for the fun part…


The app monitors the tweet intensity, that is the number of tweets per minute for each side. Hours before the game this value is typically around 5-10/minute, right before the game it’s usually at least 300/minute and from there it pretty well reflects how nerve wracking the game is. The highest number I’ve experienced up to the semi finals. was around 3500/minute for Spain, when they shot – and missed – the second penalty against Paraguay in the quarter finals.


Tweet intensity is an interesting indicator, but an even more useful one is the mood meter. The application tries to evaluate the mood of each tweet coming in and decide whether it is more of a positive message (“yaaay!!”) or a negative one (“boooo!”). The tweets are colored according to this: red ones mean negative, green ones positive and yellow is neutral (or at least the application couldn’t decide).

Tweet intensity tends to pretty well reflect on the game: usually when a team is scored a goal it tends to go down… though it’s hard to predict by how much – sometimes the fans just keep sending positive messages to the team even after their team has gotten behind!
Read More…

Printing in Silverlight: Printing Charts and Auto Scaling

Warning: count(): Parameter must be an array or an object that implements Countable in /nfs/c03/h02/mnt/50561/domains/ on line 76

Printing support has been introduced in Silverlight 4. This means that any part of the visual tree can be printed with some simple API calls (see the Printing Basics section on my Advanced Printing in Silverlight post). This post provides an example to print charts and looks at how elements can be auto scaled to fit the page size.

Printing a chart

There are lots of examples on blogs demonstrating printing on simple elements. However I wanted to test how the printing functionality performs when working with charts.

I chose to use the most widespread (and free) charting component, the Silverlight Toolkit. In my example I’ve created four charts and added printing support to all of them like this:

Chart chartToPrint; // The element to be printed
PrintDocument doc = new PrintDocument(); // Create the PrintDocument  object that will do the printing
doc.PrintPage += (s, args) =>
  // Set the chart that needs to be printed.
  // As soon as this is set, printing starts
  args.PageVisual = chartToPrint;

In the example the whole page can be printed as well by clicking on the Print whole page button. In this case the LayoutRoot element is passed as the PageVisual. Test the example yourself:
Read More…

Silverlight 4 still displays large elements incorrectly

I’ve ran into the issue of Silverlight displaying large elements incorrectly in version 3. After reporting the issue on the official Silverlight forums it’s turned out that it’s a known issue that Silverlight renders elements larger than 32K incorrectly.

After Silverlight 4 released I was hoping that this issue is fixed. However, I was disappointed to see that it still exists. My problem with this bug is that I’m working on a charting application that supports zooming. The easiest way to do this applying RenderTransforms and ScaleTransforms to the elements plotted. However due to this bug zooming is limited until the zoomed element size is 32K – this sets a practical limit of about 70-150x zoom (based on the original element size) which in my case is a serious limitation.
Read More…

Detecting Silverlight Version Installed

Detecting the Silverlight version installed on a client machine isn’t entirely straightforward. To do so, one has to use Javascript. Unfortunately even though Microsoft ships a Silverlight.js in the Silverlight SDK, this script only has the ability to tell whether a specific version is supported on the client’s machine; it does not support returning the installed version.

For this reason I have created a simple Javascript function returning the Silverlight version number installed on the client machine or returning -1 if Silverlight is not installed. The source code can be downloaded from here:
The script can be used the following way:

var slVersion = GetSilverlightVersion();
if(slVersion != -1)
   document.writeln("Your Silverlight version is: <strong>" +slVersion + "</strong>" );
   document.writeln("<strong>Your do not have Silverlight installed on this computer</strong>");

And this is the script in action:

If you’re interested in how the script actually works and what the Silverlight version numbers mean, read the post on my ScottLogic blog: Determining Silverlight Version Installed – source code & explanation

Invited to the Kairos Society Global Summit!

It has been a great honour that I a month and a half ago I have been invited to become a member of the Kairos Society and also attend their annual summit mid April this year.


Kairos Society is an invite-only foundation aimed to unite the world’s brightest young minds. Each year they hold a global summit where some of the most influential leaders are brought together with a select group of the world’s most innovative and entrepreneurial students. As part of the summit the 100 most innovative student projects are exhibited – I’ll also be one of the exhibitors as participant in the Green Watering Project.
Read More…

Ten Cool Visual Studio 2010 Features

I’ve attended an event late March in Glasgow where Scott Guthrie, Microsoft vice president showed off some of the new fewatures of Visual Studio 2010. Based on this talk and my experience using Visual Studio 2010 Beta 2 and the Release Candidate I’ve collected the ten most useful new features of this edition. These are:

  • Pinning variables when debugging
  • Box selection
  • On-the-fly search
  • Zooming
  • View call hierarchy
  • Sequence diagrams
  • Dependency graphs
  • IntelliTrace and dump debugging
  • Multi-monitor support
  • Intellisense improvements

For a detailed description of each of these features read my blog post Ten Cool Things You Didn’t Know About Visual Studio at my Scott Logic blog.

1 2 3 4 5 6 8  Scroll to top