Canvas
Canvas . . Canvas, (AttachedProperties). ( Button). Button Canvas, , :
<Canvas>
<Button Canvas.Top="50" Canvas.Left="50"
Content=" 1" FontSize="18" Width="150" Height="75" />
<Button Canvas.Top="150" Canvas.Left="20"
Content=" 2" FontSize="18" Width="150" Height="75" />
<Button Canvas.Top="85" Canvas.Left="80"
Canvas.ZIndex="-1" Content=" 3" FontSize="18"
Width="150" Height="75" />
</Canvas>
(F5) :
, . , ZIndex, . Canvas , , , , . , c Canvas , , StackPanel Grid.
StackPanel
StackPanel , , , ( ). Button:
<StackPanel>
<Button Margin="10" Content=" 1"
FontSize="18" Width="130" Height="75" />
<Button Margin="10" Content=" 2"
FontSize="18" Width="130" Height="75" />
<Button Margin="10" Content=" 3"
FontSize="18" Width="130" Height="75" />
</StackPanel>
(F5) :
, ( Orientation StackPanel):
<StackPanel Orientation="Horizontal" >
<Button Margin="10" Content=" 1"
FontSize="18" Width="130" Height="75" />
<Button Margin="10" Content=" 2"
FontSize="18" Width="130" Height="75" />
<Button Margin="10" Content=" 3"
FontSize="18" Width="130" Height="75" />
</StackPanel>
(F5) :
|
|
StackPanel , .
Grid
Grid . Grid , . XAML Grid
-,
. Grid, , , . ( , , , , , ): |
<Grid ShowGridLines="True" >
<Grid. RowDefinitions >
<RowDefinition Height="90" />
<RowDefinition Height="90" />
<RowDefinition Height="90" />
</Grid.RowDefinitions>
<Grid. ColumnDefinitions >
<ColumnDefinition Width="150" />
<ColumnDefinition Width="150" />
<ColumnDefinition Width="150" />
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Grid.Row="0"
Content=" 1" FontSize="18"
Width="130" Height="75" />
<Button Grid.Column="2" Grid.Row="0"
Margin="10"
Content=" 2" FontSize="18" Width="130"
Height="75" />
<Button Grid.Column="1" Grid.Row="2"
Margin="10"
Content=" 3" FontSize="18" Width="130"
Height="75" />
</Grid>
Grid 3 3 . , Button Grid . :
, Button (Grid.Column Grid.Row) , .
, Visual Studio, Expression Blend. , XAML-.
Pivot Panorama
Windows Phone , :
- Pivot
- Panorama
Metro-, .
, : Windows Phone Pivot Application Windows Phone Panorama Application. , Pivot Panorama ExploreBaseControls.
Pivot
MainPage.xaml . XAML Grid c x:Name LayoutRoot:
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="Transparent" >
<Grid. RowDefinitions >
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<!--TitlePanel contains the
name of the application and page title-->
<StackPanel x:Name="TitlePanel" Grid.Row="0"
Margin="12,17,0,28" >
<TextBlock x:Name="ApplicationTitle"
Text="MY APPLICATION"
Style="{StaticResource PhoneTextNormalStyle}" />
<TextBlock x:Name="PageTitle"
Text="page name" Margin="9,-7,0,0"
Style="{StaticResource PhoneTextTitle1Style}" />
</StackPanel>
<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentPanel"
Grid.Row="1" Margin="12,0,12,0" >
</Grid>
</Grid>
|
|
, XAML :
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="Transparent">
</Grid>
Pivot. , Toolbox Visual Studio, XAML .
, , XAML .
Pivot , : Microsoft.Phone.Controls
XAML MainPage.xaml:
<phone:PhoneApplicationPage
x:Class="ExploreBaseControls.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" d:DesignWidth="480" d:DesignHeight="768"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
shell:SystemTray.IsVisible="True" >
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Enter :
xmlns:controls=
IntelliSense :
Microsoft.Phone.Controls (Microsoft.Phone.Cotrols).
:
xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
XAML MainPage.xaml :
<phone:PhoneApplicationPage
x:Class="ExploreBaseControls.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"
xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
shell:SystemTray.IsVisible="True" >
|
|
(Ctrl+Shift+B). , IntelliSense.
Pivot .
MainPage.xaml . XAML Grid c x:Name LayoutRoot, :
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="Transparent" >
</Grid>
:
IntelliSense , :
, Pivot Panorama PivotItem PanoramaItem.
XAML Pivot 3 PivotItem, , , XAML :
<controls:Pivot Title="Ψ ">
<controls:PivotItem Header="">
</controls:PivotItem>
<controls:PivotItem Header="">
</controls:PivotItem>
<controls:PivotItem Header="">
</controls:PivotItem>
</controls:Pivot>
(F5) , Pivot.
PivotItem , , / .
XAML Canvas, StackPanel Grid . XAML :
<controls:Pivot Title="Ψ " >
<controls:PivotItem Header="" >
<Canvas>
<Button Canvas.Top="50" Canvas.Left="50"
Content=" 1" FontSize="18" Width="150" Height="75" />
<Button Canvas.Top="150" Canvas.Left="20"
Content=" 2" FontSize="18"
Width="150" Height="75" />
<Button Canvas.Top="85" Canvas.Left="80"
Canvas.ZIndex="-1" Content=" 3" FontSize="18"
Width="150" Height="75" />
</Canvas>
</controls:PivotItem>
<controls:PivotItem Header="" >
<StackPanel>
<Button Margin="10" Content=" 1"
FontSize="18" Width="130" Height="75" />
<Button Margin="10" Content=" 2"
FontSize="18" Width="130" Height="75" />
<Button Margin="10" Content=" 3"
FontSize="18" Width="130" Height="75" />
</StackPanel>
</controls:PivotItem>
<controls:PivotItem Header="" >
<Grid ShowGridLines="True" >
<Grid. RowDefinitions >
<RowDefinition Height="90" />
<RowDefinition Height="90" />
<RowDefinition Height="90" />
</Grid.RowDefinitions>
<Grid. ColumnDefinitions >
<ColumnDefinition Width="150" />
<ColumnDefinition Width="150" />
<ColumnDefinition Width="150" />
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Grid.Row="0"
Content=" 1" FontSize="18" Width="130"
Height="75" />
<Button Grid.Column="2" Grid.Row="0"
Margin="10" Content=" 2" FontSize="18"
Width="130" Height="75" />
<Button Grid.Column="1" Grid.Row="2"
Margin="10"
Content=" 3" FontSize="18" Width="130"
Height="75" />
</Grid>
</controls:PivotItem>
</controls:Pivot>
|
|
(F5) , / Pivot /.
, Pivot / Pivot /, , Pivot-, .
Panorama
MainPage.xaml . XAML Grid c x:Name LayoutRoot, , Pivot.
XAML , Panorama 3 PanoramaItem Grid c x:Name LayoutRoot, , :
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="Transparent" >
</Grid>
, XAML :
<!--LayoutRoot is the root grid where
all page content is placed-->
<Grid x:Name="LayoutRoot"
Background="Transparent">
<controls:Panorama
Title=" ">
<controls:PanoramaItem
Header="">
</controls:PanoramaItem>
<controls:PanoramaItem
Header="">
</controls:PanoramaItem>
<controls:PanoramaItem
Header="">
</controls:PanoramaItem>
</controls:Panorama>
</Grid>
(F5) , Panorama.
/ Panorama .
, PNG 1024x768 PanoramaBackground.png, MainPage.xaml
<controls:Panorama Title=" ">
XAML , PanoramaBackground.png:
<controls:Panorama.Background >
<ImageBrush ImageSource="PanoramaBackground.png" />
</controls:Panorama.Background>
(F5) , Panorama .
/ Panorama , Expression Blend , . Expression : http://www.microsoft.com/design/toolbox/
PanoramaItem, . , - .
, . , , - :
, , . , Silverlight Windows Phone. , .
Border | / . |
Button | , Click. |
CheckBox | . , . |
HyperlinkButton | , . , NavigateUri. |
Image | . |
ListBox | , . . |
MediaElement | . |
PasswordBox | , . |
ProgressBar | . |
RadioButton | . ( GroupName) . |
ScrollViewer | . |
Slider | . Value. |
TextBlock | , . |
TextBox | , . |
Map | Bing |
WebBrowser | HTML |
, , . ExploreBaseControls MainPage.xaml , Grid:
|
|
<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0" > </Grid>
, Toolbox - , , , .
XAML
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="Transparent" >
<ScrollViewer>
<StackPanel>
<Border Margin="10" Width="100" Height="100"
BorderThickness="2" CornerRadius="5"
BorderBrush="
{StaticResource PhoneAccentBrush}" />
<ProgressBar Name="MyProgressBar"
Maximum="10" ValueChanged=
"MyProgressBar_ValueChanged" />
<Slider Name="MySlider"
ValueChanged=
"MySlider_ValueChanged" />
<Button Margin="10" Width="150" Height="100"
Content="Button" Name=
"MyButton" Click="MyButton_Click" />
<CheckBox Margin="10"
Content="CheckBox"
Height="70" HorizontalAlignment="Center"
Name="MyCheckBox"
IsThreeState="True" />
<HyperlinkButton Margin="10"
Content="HyperlinkButton"
Height="30"
Name="MyHyperlinkButton" />
<Image Margin="10"
Height="150" Name="MyImage"
Stretch="Fill" Width="200"
Source="/ExploreBaseControls;component/
PanoramaBackground.png" />
<ListBox Name="MyListBox" >
<TextBlock Margin="10 0 0 0" > 1</TextBlock>
<TextBlock Margin="20 0 0 0" > 2</TextBlock>
<TextBlock Margin="40 0 0 0" > 3</TextBlock>
<TextBlock Margin="10 0 0 0" > 4</TextBlock>
<TextBox Height="70" Width="300" Name="MyTextBox"
Margin="0 10 0 0" />
</ListBox>
<PasswordBox Name="MyPasswordBox" />
<RadioButton GroupName="MyGroup"
Content=" 1" />
<RadioButton GroupName="MyGroup"
Content=" 2" />
<RadioButton GroupName="MyGroup"
Content=" 3" />
<RadioButton GroupName="MyGroup"
Content=" 4" />
</StackPanel>
</ScrollViewer>
</Grid>
, MainPage.xaml.cs
private void MyButton_Click(object sender, RoutedEventArgs e)
{
MyProgressBar.Value += 1;
}
private void MySlider_ValueChanged
(object sender, RoutedPropertyChangedEventArgs< double > e)
{
MyProgressBar.Value = MySlider.Value;
}
private void MyProgressBar_ValueChanged
(object sender, RoutedPropertyChangedEventArgs< double > e)
{
MySlider.Value = MyProgressBar.Value;
}
Silverlight for Windows Phone Toolkit , :
AutoCompleteBox | TextBox . |
ListPicker | TextBo, . |
LongListSelector | ListBox |
ContextMenu | . |
DatePicker | . |
TimePicker | . |
ToggleSwitch | / |
WrapPanel | , . |