0

私はメトロアプリのこのxamlコードを持っています。

    <Grid Width="531" Height="531">
        <Grid.Background>
            <ImageBrush ImageSource="{Binding image1}" Stretch="UniformToFill"  />
        </Grid.Background>
        <StackPanel Background="#0072B0" Opacity="0.7" VerticalAlignment="Bottom">
            <Border BorderThickness="0,0,0,1" BorderBrush="White">
                <TextBlock Text="{Binding name}" VerticalAlignment="Bottom" Opacity="1"  Style="{StaticResource BigTopDealItemTitle}"/>
            </Border>
        </StackPanel>
    </Grid>

ぼかしパネルを作成し、その上にテキストをクリアしたい。しかし、TextBlock のテキストもぼやけているように見えます。Opacity を 1 に設定しても。

4

1 に答える 1

1

テキストボックスをぼやけさせずに背景をぼかすには、次のようにします。

<Grid Width="531" Height="531">
    <Grid.Background>
        <ImageBrush ImageSource="{Binding image1}" Stretch="UniformToFill"  />
    </Grid.Background>
    <StackPanel Background="#0072B0" Opacity="0.7" VerticalAlignment="Bottom">
        <Grid>
            <Border BorderThickness="0,0,0,1" BorderBrush="White"/>
            <TextBlock Text="{Binding name}" VerticalAlignment="Bottom" Style="{StaticResource BigTopDealItemTitle}"/>
        </Grid>
    </StackPanel>
</Grid>

これにより、 のプロパティの影響を受けずに がTextBlock背景 (つまり ) の上に配置されます。BorderBorder

于 2012-10-08T19:15:32.920 に答える