Over at, there is an example of <a href=”″>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.



      <RotateTransform Angle="{l:RandomNumber Min=0, Max=360}" />



Pretty cool. Apparently it only works when it isn’t placed inside a template… which makes it of limited usefulness, but still pretty neat.