在這裡,把一些最基本的控制項列出來,其實也就是沒有歸類的控制項都放在這裡了。
一.TextBlock:這個控制項其實就是Label控制項。
<TextBlock x:Name="PageTitle" Text="page name" Margin="-3,-8,0,0" Style="{StaticResource PhoneTextTitle1Style}" TextWrapping="Wrap"/>Style:設定字型、字色、大小等樣式,用StaticResource方式可以綁定預設的樣式。
TextWrapping:設定是否自動換行。
Text:在控制項上要顯示的文字。
二.CheckBox:多選控制項,通過blend工具也可以產生多種效果,另外要想將選擇框加大,並不是能過設定Width,Height來完成的,而是通過RenderTransform的Scale來完成的。
<CheckBox Content="CheckBox1" Height="80" HorizontalAlignment="Left" Margin="102,113,0,0" Name="checkBox1" VerticalAlignment="Top" Width="279" BorderBrush="Red" Foreground="Blue" Checked="checkBox1_Checked" Background="Yellow"/>
<CheckBox Content="CheckBox2" Height="72" HorizontalAlignment="Left" Margin="148,0,0,346" Name="checkBox2" VerticalAlignment="Bottom" Checked="checkBox2_Checked" RenderTransformOrigin="0.5,0.5" BorderBrush="#BFFB2200" Foreground="#FF1008F7">
<CheckBox.Background>
<LinearGradientBrush EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0">
<GradientStop Color="White" Offset="0.504"/>
<GradientStop Color="#FFF7E306" Offset="1"/>
<GradientStop Color="#FFF7E306" Offset="0.004"/>
</LinearGradientBrush>
</CheckBox.Background>
<CheckBox.RenderTransform>
<CompositeTransform ScaleX="2" ScaleY="2"/>
</CheckBox.RenderTransform>
</CheckBox>