wpf

Monitoring routed events in WPF

A few days ago I wanted to monitor all routed events fired in my application. Because I am running an XBAP application inside a browser windows, Snoop wasn’t very helpful (it usually is). Because all routed events are basically the same, you can handle them all with one singe event handler. Using the EventManger it is possible to get all routed events and register a class handler for every one of them. The code below is a stripped down version of the code I’ve got implemented. When loaded, it gets all events. Than it loops to them and assigns a…

SilverBullet, Silverlight

SilverBullet #7 – System.Windows.Messaging

I’d like to provide you with a SilverBullet™, a small snippet of Silverlight, a class or namespace hidden in the silverlight .NET framework, to help you out in times of need. It’s not to learn, but something to keep in your pocket. Just remember it’s there and you’re safe. Most often Silverlight applications take up the whole screen and the page that is hosting the application contains only one control. It is possible to split you application into smaller controls. This can be valuable when you are using silverlight 3 in SharePoint parts, or just to leverage your webpage with…

Expression Blend

9 little new things in Expression Blend 3

When working on some projects and articles in Expression Blend 3 I noticed a few differences with Blend 2 right away. Here are 9 improvements and new features I really like or enjoy having now. 1. Expression Blend now shows the size of your controls even when the width and height are set to Auto: 2. The assets are placed in a panel now. Although the “old” way of working with asses is still available, this new panel can be left open. Beside that, the assets are grouped in different ways in a tree, which makes them very easy to…

SilverBullet, Silverlight

SilverBullet #6 – System.Windows.EventTrigger

I’d like to provide you with a SilverBullet™, a small snippet of Silverlight, a class or namespace hidden in the silverlight .NET framework, to help you out in times of need. It’s not to learn, but something to keep in your pocket. Just remember it’s there and you’re safe. There are situations when you would like to start an animation as soon as your application is loaded. The EventTrigger class is what you need in that case. You may know this class from WPF, but the Silverlight version is very limited. The nice thing about this class is that it…

SilverBullet, Silverlight

SilverBullet #5 – System.Windows.ApplicationServiceContext

I’d like to provide you with a SilverBullet™, a small snippet of Silverlight, a class or namespace hidden in the silverlight .NET framework, to help you out in times of need. It’s not to learn, but something to keep in your pocket. Just remember it’s there and you’re safe.   When running Silverlight outside the browser, there’s the possibility that the computer that is running the applications is disconnected. This is where the System.Windows.ApplicationServiceContext class comes in. This class represents the initial state when the application is started. It has no methods of any significance, only two read only properties.…

Expression Blend, Silverlight

Styling a TreeView in Silverlight 3 and Blend 3

Introduction Today I would like to show you how to style a TreeView control in Silverlight 3 using Expression Blend 3. The TreeView is a control to visualize hierarchical data structures. If you haven’t got Silverlight 3 and Blend 3, you can find all downloads for Silverlight 3 and Blend 3 here. The TreeView control is available in WPF natively and styling is only a small bit different than in Silverlight. I try to explain one way of doing this and there are others. If you have any questions what so ever or suggestions for other tutorials, please let me…

SilverBullet, Silverlight

SilverBullet #4 – System.Windows.ApplicationIdentity

I’d like to provide you with a SilverBullet™, a small snippet of Silverlight, a class or namespace hidden in the silverlight .NET framework, to help you out in times of need. It’s not to learn, but something to keep in your pocket. Just remember it’s there and you’re safe.   One of the great new features of Silverlight 3 is the so called “Out of Browser” support. This means you can run your application without the browser, but still using the browser secure sandbox. The ApplicationIdentity class can be used to provide some extra information about your application when running…

SilverBullet, Silverlight

SilverBullet #3 – System.Windows.Input.FocusManager

I’d like to provide you with a SilverBullet™, a small snippet of Silverlight, a class or namespace hidden in the silverlight .NET framework, to help you out in times of need. It’s not to learn, but something to keep in your pocket. Just remember it’s there and you’re safe. There are situations where you want to know which UI element has focus. One way of doing this is handling the GotFocus and LostFocus events. These events are only raised when an element gets or looses focus, and are handled asynchronously.  When you want to know what element has focus in…

Expression Blend

Microsoft Expression Blend Essentials

I ran into this series of videos when exploring Microsoft Showcase this morning. If you’re just starting with Expression Blend or if are more experienced, these sessions can provide you with much useful information. There are 7 part, all listed below. If you want to learn more about the Expression Products or any other Microsoft product, just browse and Bing around Microsoft Showcase.   Microsoft Expression Blend Essentials (1/7): Projects and Hierarchies Microsoft Expression Blend Essentials (2/7): Layout Controls Microsoft Expression Blend Essentials (3/7): Custom and User Controls Microsoft Expression Blend Essentials (4/7): Interaction Microsoft Expression Blend Essentials (5/7): Animation…

SilverBullet, Silverlight

SilverBullet #2 – System.Json

 I’d like to provide you with a SilverBullet™, a small snippet of Silverlight, a class or namespace hidden in the silverlight .NET framework, to help you out in times of need. It’s not to learn, but something to keep in your pocket. Just remember it’s there and you’re safe.     The System.Json namespace provides support for JavaScript Object Notation or JSON. By using the classes in this namespace you are able to use Json objects in your C# or VB code. These object are often used in JavaScript and to send to and be returned by services.   The…