1

我在使用元素创建3D类似效果时遇到问题。Border我写了以下标记。但这不会3D effect像以下 URL 中的屏幕截图那样正确生成。

截图图片网址

<Window x:Class="MainWindow"  
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" 
    Height="400" Width="225" WindowStyle="None" Topmost="True" 
    AllowsTransparency="True" Background="Transparent">

<Border x:Name="border" Margin="10" CornerRadius="10,10,10,10" BorderBrush="#111111" BorderThickness="0" Background="#111111">
    <Border.Effect>
        <DropShadowEffect ShadowDepth="0" Direction="0" BlurRadius="15" Color="Black" Opacity="1"/>
    </Border.Effect>
    <Border x:Name="border1" Margin="5" CornerRadius="{Binding CornerRadius, ElementName=border}">
        <Border.Background>
            <LinearGradientBrush StartPoint="0,0" EndPoint="0,1" >
                <GradientStop Color="#FF373737" Offset="0"/>
                <GradientStop Color="#FF222222" Offset="0.75"/>
                <GradientStop Color="#FF373737" Offset="1"/>
            </LinearGradientBrush>
        </Border.Background>
        <Border.Effect>
            <DropShadowEffect ShadowDepth="0" Direction="0" BlurRadius="10" Color="White" Opacity="1"/>
        </Border.Effect>
    </Border>
</Border>
</Window>
4

0 回答 0