
The User Interface has been entirely developed using Expression Blend and very little code has been written using Visual Studio.net 2005.
Here are the three main features i worked on
1) Connection to XML source and dispalying the data
2) Transparent Window and cool UI elements
3) updating a control's property using DispatcherTimer
Connecting to the xml data source is straight forward in Microsoft Expression Blend. Select XML Source in the Data panel. Add XML data Source Dialog box will appear. Type the URL of the the RSS feed and press OK button. Now create a new grid and a the desired node on to grid.
select the control to be data bounded .
The main application window is made transparent by setting allowtransparancy
AllowTransparancy = true;
This will also hide the menubar and then the window could not be moved.
How to solve this problem
Select Window in Object and TimeLine Panel and then select events in the properties panel.
Now type OnMouseLeftButtonDown at MouseButtonDown and press Enter key.
This will load the project in Microsoft Visual Studio.net 2005 and the OnMouseLeftButtonDown event will be automatically added .
Here's the code to fix this so you can move the window.
override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
{
DragMove();
}
Updating UI controls property uisng DispatcherTimer
I thought that it would look nice if we could display the time when the score card information was last updated. Its wasy to guess that this task requries a Timer object.
Windows Presentation Foundation comes with DispatcherTimer Class. This is a timer that is integrated into the Dispatcher queue which is processed at a specified interval of time and at a specified priority.
Reasons for using a DispatcherTimer opposed to a System.Timers.Timer are that the DispatcherTimer runs on the same thread as the Dispatcher and a DispatcherPriority can be set on the DispatcherTimer.
dispatcherTimer = new DispatcherTimer();
// Score should be updated every 30 seconds -:)
dispatcherTimer.Interval = new TimeSpan(0, 0, 30);
dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
dispatcherTimer.Start();
After developing this app, i must say WPF and Expression Blend rocks!