Windows Phone 8.1 Border

network | | 访问(60)
<StackPanel>
    <Border Background="Coral"  Padding="10" CornerRadius="30,38,150,29" BorderThickness="8 15 10 2" BorderBrush="Azure"></Border>
    <Border BorderThickness="1,3,5,7" BorderBrush="Blue" CornerRadius="10" Width="200" >
        <TextBlock Text="蓝色的Border" ToolTipService.ToolTip="这是蓝色的Border吗?" FontSize="30"  TextAlignment="Center" />
    </Border>
    <Border x:Name="TextBorder" BorderThickness="10">
        <Border.BorderBrush>
            <SolidColorBrush Color="Red" Opacity="0"/>
        </Border.BorderBrush>
        <TextBlock Text="请单击一下我!" PointerPressed="TextBlock_PointerPressed" FontSize="20"/>
    </Border>
    <Border x:Name="brdTest" BorderThickness="4" Width="200" Height="150" >
        <Border.BorderBrush>
            <LinearGradientBrush x:Name="borderLinearGradientBrush" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0" EndPoint="0.5,1">
                <LinearGradientBrush.GradientStops>
                    <GradientStop Color="Yellow" Offset="0" />
                    <GradientStop Color="Blue" Offset="1" />
                </LinearGradientBrush.GradientStops>
            </LinearGradientBrush>
        </Border.BorderBrush>
    </Border>
</StackPanel>
public sealed partial class MainPage: Page {
    public MainPage() {
        this.InitializeComponent();
        Rectangle rectBlue = new Rectangle();
        rectBlue.Width = 1000;
        rectBlue.Height = 1000;
        SolidColorBrush scBrush = new SolidColorBrush(Colors.Blue);
        rectBlue.Fill = scBrush;
        this.brdTest.Child = rectBlue;
    }

    private void TextBlock_PointerPressed(object sender, PointerRoutedEventArgs e) {
        TextBorder.BorderBrush.Opacity = 0.5;
    }

    protected override void OnNavigatedTo(NavigationEventArgs e) {}

}