Scott Logic Ltd

Archive For "attached behaviour" Tag

Automatically Showing ToolTips on a Trimmed TextBlock (Silverlight)

Colin Eberhardt, January 6th, 2011

Silverlight 4 added TextTrimming=”WordEllipsis”, which trims the text that a TextBlock displays based on the available width. This blog post describes a simple method for automatically showing the full text as a tooltip whenever the text is…

Read More


A Simplified Grid Markup for Silverlight and WPF

Colin Eberhardt, December 21st, 2010

The WPF / Silverlight syntax is long and cumbersome. This blog post describe a simple attached property that allows you to specify row and column widths / heights as a simple comma separated list, e.g. RowDefinitions=”Auto,,3*,,,,2*” The Gr…

Read More


Developing a Lookless Silverlight Gauge Control (part 2)

Colin Eberhardt, October 20th, 2010

In a previous blog post I described the process of creating a lookless gauge control. I introduced the concept of an attached view model which separates view specific concepts from the control. In this post I demonstrate how this allows for great flexi…

Read More


Developing a (very) Lookless Silverlight Radial Gauge Control

Colin Eberhardt, August 19th, 2010

This blog post describes the development of a lookless radial gauge control. In this post I will explore the use of an attached view model in order to move view specific properties and logic out of the control code in order to give a truly lookless con…

Read More


Exposing and Binding to a Silverlight ScrollViewer’s Scrollbars

Colin Eberhardt, July 21st, 2010

The Silverlight ScrollViewer exposes readonly properties which indicate the current vertical and horizontal scroll offset, and methods for setting the current offset. In this blog post I demonstrate a simple attached behaviour that exposes these offset…

Read More


Silverlight ClipToBounds – Can I Clip It?, Yes You Can!

Colin Eberhardt, May 12th, 2009

With Silverlight, Panels do not clip their contents by default. See the following example: Where we have a Grid containing another Grid which itself contains an ellipse, and a Canvas which contains an ellipse: <Grid x:Name="LayoutRoot" Back…

Read More


Using CSS Selectors for Styling in WPF

Colin Eberhardt, March 11th, 2009

When I first encountered WPF I was really impressed by its styling and templating features which are more powerful than anything else I had previously seen for desktop software development. The property-value pairing within styles instantly reminded me…

Read More


Implementing RelativeSource binding in Silverlight

Colin Eberhardt, February 27th, 2009

In my previous post I demonstrated how an the WPF ElementName style binding can be emulated with Silverlight via an attached behaviour. As a brief recap, the technique involved creating an attached property, which when bound, adds a handler for the ele…

Read More


ElementName binding in Silverlight via Attached Behaviours

Colin Eberhardt, February 22nd, 2009

As a relative newcomer to Silverlight I was happily greeted by the warm feeling of familiarity when I started developing. It is surprisingly easy to make the transition from WPF to Silverlight developer, with most of the core concepts being just the sa…

Read More

© 2013 Scott Logic Ltd. All Rights Reserved.