Skip Navigation LinksHome / Tips / View Tip

XAML Element Binding

+ Add to SilverlightShow Favorites
3 comments   /   posted by Emil Stoychev on Mar 24, 2009
(2 votes)
Categories: General , Binding

Silverlight 3 enables property binding to CLR objects and other UI components via XAML – UI to UI binding. It is useful in a lot of scenarios and saves time for both developers and designers.

Example

Get Microsoft Silverlight

Download source code

Syntax

{Binding Value, ElementName=MySlider}

where Value is property of a CLR object and MySlider is the name of this object

Hope that helps!

Share


Comments

Comments RSS RSS
  • RE: XAML Element Binding  

    posted by Matt on Sep 11, 2009 19:12
    Is there supposed to be something in this article between the Example heading and the Download source code? Just checking because my screen shows a huge white space (Firefox browser). Just letting you know - keep up the good work.

    -Matt (VB)


  • RE: XAML Element Binding  

    posted by emil on Sep 14, 2009 10:14
    Thanks, Matt! The demo is fixed.
  • RE: XAML Element Binding  

    posted by charlierlee on May 07, 2010 00:30
    That's great, but what if the item you want to bind to is not anywhere your current FrameworkElement? The binding fails :(
    Anyways, it turns out, if you wrap your content in a ContentControl, the binding succeeds.

Add Comment

 
 

   
  
  
   
Please add 3 and 1 and type the answer here:

Join the free SilverlightShow webcast 'Running Silverlight Outside the Browser and with Elevated Trust'. Sept 7th, 8 am - 9 am PDT.
In this live session Chris Anderson will cover configuring and debugging OOB mode, toast notifications, elevated trust, direct file access and much more.
Learn more | Register | See more webinars (hide this)