WPF Recursion Controls
Project DescriptionWPF Recursion Controls presents a simple language for drawing pictures that illustrates
the power of data abstraction and closure, and also exploits higher-order procedures
in an essential way. The language is designed to make it easy to experiment with
patterns such as the on
http://e4d.co.il/piclang/ See demo in Silverlight
Beside Sample:
The XAML code:
<E4D:Beside Width="512" Height="256" Content="Beside">
<!-- Can be any UIElement-->
<Image Source="..\Images\E4D.png" Stretch="Fill"/>
</E4D:Beside>
The Function code:
public static UIElement Below( this UIElement source )
{
UIElement cloned = source.Clone();
return Below( source, cloned );
}
public static UIElement Below( this UIElement source, UIElement element )
{
Grid g = new Grid();
RowDefinition r1 = new RowDefinition ();
r1.Height = new GridLength ( 0.5 , GridUnitType.Star );
RowDefinition r2 = new RowDefinition();
r2.Height = new GridLength ( 0.5 , GridUnitType.Star );
g.RowDefinitions.Add( r1 );
g.RowDefinitions.Add( r2 );
g.ShowGridLines = ShowGridLines;
g.Children.Add( source );
g.Children.Add( element );
Grid.SetRow( source, 0 );
Grid.SetRow( element, 1 );
return g;
}
The Result in Blend

More Sample:




