top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Explain XAML Layouts with Code?

+3 votes
211 views

i need to know about xaml layout code any one help for that???

posted Oct 10, 2014 by Sathish Kumar

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+2 votes

The built-in layout panels in Windows Phone are: Canvas, StackPanel, Grid

CANVAS:

Canvas defines an area within which you can explicitly position child elements by coordinates relative to the Canvas area. Canvas is useful for scenarios where the UI elements contained within it never move.
You can position the control inside the Canvas by specifying x and y coordinates. The x and y coordinates are specified by using

the Canvas.Left and Canvas.Top

attached properties. Canvas.Left specifies the object's distance from the left side of the containing Canvas (the x-coordinate), and Canvas.Top specifies the object's distance from the top of the containing Canvas (the y-coordinate).

XAML Code:

              <Canvas Background="Gray">
             <TextBlock TextWrapping="Wrap" FontSize="30" Text="Query Home Canvas Sample"                 
              Canvas.Left="41" Canvas.Top="77" HorizontalAlignment="Center" Width="412" Height="34"/>
              <Rectangle Canvas.Left="115" Canvas.Top="184"
              Fill="red" Width="200" Height="200" />
              </Canvas>

enter image description here


answer Oct 13, 2014 by Jdk
...