Binding To Attached Properties (like Grid.Row, Grid.Column, Canvas.Left, Canvas.Top, blah.something, etc)

I recently spent a couple hours trying desperately to bind a TextBlock to the Canvas.Left and Canvas.Top properties for a project I’m working on. My binding looked like this:  {Binding ElementName=MyElement, Path=Canvas.Left, Mode=Default} Couldn’t do it. I tried bloody everything to get this thing to work, but it wouldn’t do it. Then I found a…

Read More

MarkupExtension

Over at nostatic.com, there is an example of <a href=”http://notstatic.com/archives/118″>using MarkupExtension</a> that that we can access some custom code functionality directly from the XAML.  In his example, the following XAML accesses a random number generator within the code. <Button> <Button.RenderTransform>   <RotateTransform Angle=”{l:RandomNumber Min=0, Max=360}” />   </Button.RenderTransform> </Button> Pretty cool. Apparently it only works…

Read More