top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is the use of Auto and Asterisk in XAML windows phone 8 application??

+2 votes
480 views

I often see while developing phone app in grid they using Asterisk(*) and Auto , i cant identify its use any people pls kindly give some suggestions....

posted Oct 15, 2014 by Sathish Kumar

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

1 Answer

+2 votes

Then you define a column in a XAML grid you can set the width to one of 3 possible values:

           1. A fixed width,
           2. Auto which means expand to the size of the content, or
           3. * (star) take as much space as available

The * is prefixed by a number (default is 1 if no number is specified). The available space is divided among the starred columns in proportion to the prefix number.

If you have this definition

                 <Grid.ColumnDefinitions>
                              <ColumnDefinition Width="0.07*"/>
                              <ColumnDefinition Width="0.93*"/>
                 </Grid.ColumnDefinitions>

The first column will get 7% of the total space available and the second column would get 93%. On the other hand if you had this definition:

If you want a layout where the second column is double the width of the first and the third column is triple the width of the first you need this definition:

                   <Grid.ColumnDefinitions>
                          <ColumnDefinition Width="*"/>
                         <ColumnDefinition Width="2*"/>
                        <ColumnDefinition Width="3*"/>
                  </Grid.ColumnDefinitions>

If the total width of the grid is 300 you get column widths 50, 100 and 150. If the total width of the grid is 600 you get column widths 100, 200 and 300. And so on.

answer Oct 17, 2014 by Jdk
Similar Questions
+3 votes

what is the Use for XAML in windows phone app?

How to we use XAML in application ??

Please give some example for XAML with code???

+5 votes

Hi friends

What is the Application Life Cycle For Windows Phone 8?? followed..

+1 vote

I am using Visual Studio 2013 for developing windows phone application how to test my application any one explain how can i achieve this... thanks in advance:)

+2 votes

I need XAP File for put my own application in my windows phone local store but i dont know where the XAP file placed in my application...........

...