Grids are used to organize other controls. Rows and columns can be defined so that other controls can locate themselves in the location they need to be. Example below shows a simple maxinpage.xml that uses grids and row controls a little bit
<phone:PhoneApplicationPage
x:Class="BasicLayout01.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
shell:SystemTray.IsVisible="True">
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
<TextBlock Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}" Margin="12,0"/>
<TextBlock Text="page name" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
</StackPanel>
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/> <!-- When used * means th of avalable space-->
<RowDefinition Height="2*"/> <!-- Here it is 2/6 of available space -->
<RowDefinition Height="3*"/>
</Grid.RowDefinitions>
<Rectangle Fill="Red" Grid.Row="0" />
<Rectangle Fill="Blue" Grid.Row="1" />
<Rectangle Fill="Green" Grid.Row="2" />
</Grid>
</Grid>
</phone:PhoneApplicationPage>
The output screen looks like that
Sunday, January 19, 2014
Subscribe to:
Post Comments (Atom)
Categories
Blog Archive
-
▼
2014
(22)
-
▼
January
(22)
- What is Asynchronous Programming?
- Quality C# (C sharp) Code Examples
- Windows phone emulator not connected to internet
- Using ListBoxes with Buttons and Adding Many Buttons
- Data Binding with a Slider
- Data Binding with Radio Buttons and Two Way Binding
- Data Binding to Control Multiple Objects - Part 1
- High End Windows 8 Phones
- Adding Event Handlers to Controls
- Stack Panel Experiments Part 1
- Using Grid in Windows Phone 8 Development Part 3
- Using Grid in Windows Phone 8 Development Part 2
- Using Grid in Windows Phone 8 Development Part 1
- Simplest Data Binding for Windows Phone 8
- Very simple code using generics
- Casting nedir?
- Generics nedir? Basitce ne ise yariyor
- Windows Store trends, interesting data showing wha...
- How to submit your app to windows app store
- Boxing and Unboxing
- Using Indexers
- Setting logo, publisher name, tile image and some ...
-
▼
January
(22)
Popular Posts
Powered by Blogger.
0 comments:
Post a Comment