XAML Sample 1

This sample demonstrates simple value converters (float/boolean/enum), color and brush converters, padding converter, once only binding (for commands) and complex property setter (for LayoutEngine). It also shows how to import classes from other CLR namespaces using XML namespaces.

<?xml version="1.0" encoding="utf-8" ?>
<DrawingPanel 
  xmlns="http://mobileui.codeplex.com/v1" 
  xmlns:Drawing="System.Drawing"
  DesiredSize="Unbound">

  <GradientRectangleElement DesiredSize="Unbound" StartColor="240,240,240" EndColor="200,80,0"/>

  <TextElement DesiredSize="400,500" Foreground="220,90,10" Text="Demo" Angle="315" AutoSize="True" 
                       HorizontalAlignment="Center" VerticalAlignment="Center"/>
  
  <DrawingPanel DesiredSize="Unbound" Background="{null}">
    <DrawingPanel.LayoutEngine>
      <StackLayout Margin="8,4" Padding="4"/>
    </DrawingPanel.LayoutEngine>

    <ButtonBar Text="Animations" SecondaryText="Animate properties of graph primitives" 
                     DesiredSize="UnboundAxis, 80" Background="{null}"/>
    <ButtonBar Text="Trasitions" SecondaryText="Optimized bitmap animations" 
                     DesiredSize="UnboundAxis, 80" Background="{null}"/>
    <ButtonBar Text="Primitives" SecondaryText="Polygon, Ellipse, Image, Text" 
                     DesiredSize="UnboundAxis, 80" Background="{null}" />
    <ButtonBar Text="Behaviours" SecondaryText="Drag with slide" 
                     DesiredSize="UnboundAxis, 80" Background="{null}" Command="{Binding DragDemoCommand}"/>
    <ButtonBar Text="Layout" SecondaryText="Stack, Wrap and Radial" 
                     DesiredSize="UnboundAxis, 80" Background="{null}" Command="{Binding LayoutDemoCommand}"/>

  </DrawingPanel>

</DrawingPanel>

Last edited Oct 26, 2009 at 2:28 PM by spencen, version 1

Comments

No comments yet.