(X) Hide this Watch the recordings of our recent webinars: Switch or no switch: Can I build my business apps in LightSwitch and Switching on the Cloud for Silverlight by Gill Cleeren
Our next webinar is on May 11th: Getting started with the Silverlight 5 Beta. Join it!
Skip Navigation LinksHome / Search


Results Per Page

Found 9 results for Attached Behaviour.
Date between: <not defined> and <not defined>
Search in: News , Articles , Tips , Shows , Showcase , Books

Order by Publish Date   Ascending Title   Rating  

  • A Simplified Grid Markup for Silverlight and WPF

    0 comments  /  posted by  Silverlight Show  on  Dec 22, 2010 (4 months ago)

    In this blog post, Colin Eberhardt describes a simple attached property that allows you to specify row and column widths / heights as a simple comma separated list.

    Source: ScottLogic

    The Grid is probably one of the most useful and versatile layouts that Silverlight and WPF offers. However, if you hand craft your XAML, as I do, you will probably start to find the Grid markup for defining rows and columns to be verbose and cumbersome.

  • 0 comments  /  posted by  Silverlight Show  on  Dec 01, 2010 (5 months ago)

    SilverlightShow Page for all Silverlight and Windows Phone 7 (WP7) things on TwitterIn this post, Phil Middlemiss describes an attached-behavior for a TreeView control that allows you to achieve two-way binding on the SelectedItem property.

    Source: Silverlight Scratchpad

    In this post I described an attached behavior that lets you achieve two-way binding on the TreeView.SelectedItem property. The behavior is especially useful if you are using the MVVM pattern to keep your views and view models separate, and want to avoid code in the View’s code-behind file.

  • 0 comments  /  posted by  Silverlight Show  on  Nov 24, 2010 (5 months ago)

    SilverlightShow Page for all Silverlight and Windows Phone 7 (WP7) things on TwitterIn this post, Phil Middlemiss describes a behavior that you can attach to your controls and bind to a property on that control.

    Source: Silverlight Scratchpad

    The behavior will monitor the value of that property and store any changes to it in Isolated Storage. The next time you start the application the behavior will look in Isolated Storage and load the value if it can find it, then restore the value to the control. This is a handy behavior for things like grid splitters, sliders, or similar types of controls (dial’s too!) where you want any changes the user makes to be remembered the next time they run your app.

  • 0 comments  /  posted by  Silverlight Show  on  Oct 21, 2010 (6 months ago)

    In his previous post Colin Eberhardt described the process of creating a lookless gauge control and introduced the concept of an attached view model. In this next post he demonstrates how this allows for great flexibility when re-templating the control.

    Source: ScottLogic

    In this post I will create two different templates for this control. The first is a small variation on the radial gauge which is rendered as a semi-circle. The second is very different, a bullet graph, where the gauge is rendered as a linear indicator. With each, an attached view model is introduced into the controls template in order to compute properties that aid in the rendering of the control.

    Follow us on twitterWe tweet all news and content updates - follow us on Twitter! 

  • 1 comments  /  posted by  Silverlight Show  on  Jul 22, 2010 (9 months ago)
    In this post, Colin Eberhardt talks about the Silverlight ScrollViewer and demonstrates a simple attached behaviour that exposes the current vertical and horizontal scroll offsets as read / write dependency properties allowing them to be bound to.

    The Silverlight ScrollViewer is a very useful control, if you have some content that is larger than the space available in your application, just sit it inside a ScrollViewer and it will automatically add vertical or horizontal scrollbars as required. Simple.

    The ScrollViewer exposes readonly properties which indicate the current vertical and horizontal scroll offset. I have been used a ScrollViewer on many occasions without finding this to be an issue, however, recently I was creating an MVVM application which contained a list of items within a ScrollViewer.

  • 0 comments  /  posted by  Silverlight Show  on  Jun 16, 2010 (10 months ago)
    Take a look at this cool Expression Blend post of Phil Middlemiss on rounding off buttons.

    I have the following requirements for this radio button style:

    • It must be re-sizable
    • The rounded ends must stay perfect half circles in proportion to the height of the button
    • It must behave correctly in Blend
    • Optional Extra: It would be nice to not have to manually edit XAML in Blend

  • Silverlight ClipToBounds - Can I Clip It?, Yes You Can!

    0 comments  /  posted by  Silverlight Show  on  May 12, 2009 (more than a year ago)

    Colin Eberhardt has created a simple little attached behaviour, which allows you to define a clipping using the attached property Clip.ToBounds.

    With Silverlight, Panels do not clip their contents by default.  [...] Fortunately Silverlight provides a Clip property on UIElement, allowing you to provide the clipping geometry for the element.

  • 0 comments  /  posted by  Silverlight Show  on  Mar 13, 2009 (more than a year ago)

    To illustrate the mechanics of Attached Behaviors, Karim Hernandez decided to implement a working RadioButtonGroup.

    I was recently asked by a customer, “Why doesn’t RadioButton.GroupName work when a single RadioButton is put in a DataTemplate within an ItemsControl?” I had no answer. When I tried it out myself, lo and behold, two checked RadioButtons were staring back at me. A quick search told me that others have encountered this issue, and none had found a solution based in markup.

  • 0 comments  /  posted by  Ilia Iordanov  on  Feb 23, 2009 (more than a year ago)

    Colin Eberhardt has a blog post concentrated on ElementName binding in Silverlight via Attached Behaviour.

    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 same. However, there are some parts of the WPF framework that you start to miss. One of those is ElementName binding.