This project is read-only.

XAML Sample 2

This sample demonstrates:
  • Using xmlns to reference local types.
  • Complex property assignment, e.g. RadialLayout.AnimationEasing
  • Simple binding
  • ItemsControl with bound Items property and user defined ItemTemplate.
<?xml version="1.0" encoding="utf-8" ?>
<DrawingPanel
  xmlns="http://mobileui.codeplex.com/v1"
  xmlns:x="http://mobileui.codeplex.com/xaml"
  xmlns:Demo="Demo.Presenters,Demo"
  DesiredSize="Unbound">

  <DrawingPanel DesiredSize="Unbound" Background="{null}">
    <DrawingPanel.LayoutEngine>
      <StackLayout Margin="8,4" Padding="4"/>
    </DrawingPanel.LayoutEngine>

    <ButtonBar Text="Back" SecondaryText="Return to main menu" DesiredSize="UnboundAxis, 80" Background="{null}" Command="{Binding BackCommand}"/>
    <ButtonBar Text="Add to Circle" SecondaryText="Adds and item to the collection" DesiredSize="UnboundAxis, 80" Background="{null}" Command="{Binding AddItemCommand}"/>
    <ButtonBar Text="Remove from Circle" SecondaryText="Removes last item from the collection" DesiredSize="UnboundAxis, 80" Background="{null}" Command="{Binding RemoveItemCommand}"/>

  </DrawingPanel>

  <ItemsControl x:Name="circlePanel" DesiredSize="UnboundAxis,400" HorizontalAlignment="Center" VerticalAlignment="Bottom" Items="{Binding Items}">
    <ItemsControl.LayoutEngine>
      <RadialLayout AnimateMovements="True" AnimationDuration="0:0:1">
        <RadialLayout.AnimationEasing>
          <ElasticEasing/>
        </RadialLayout.AnimationEasing>
      </RadialLayout>
    </ItemsControl.LayoutEngine>
    <ItemsControl.ItemTemplate>
      <Demo:DemoItemTemplate/>
    </ItemsControl.ItemTemplate>
  </ItemsControl>  
  
</DrawingPanel>
test

Last edited Nov 2, 2009 at 12:16 AM by spencen, version 3

Comments

No comments yet.