我已经对该模板的边框应用了一种效果。然后将效果应用于其中的每个元素,因此我得到的阴影比我关心的要多。有没有办法禁用效果?你可以看到我在里面添加了一个模糊效果,但是我最终得到了模糊的阴影:)
DataTemplate x:Key="TestInstanceViewModelTemplate">
<Border BorderThickness="1" BorderBrush="#FF0909B4">
<Border.Effect>
<DropShadowEffect/>
</Border.Effect>
<DockPanel>
<DockPanel.Effect>
<BlurEffect/>
</DockPanel.Effect>
<Grid DockPanel.Dock="Top">
<Grid.ColumnDefinitions>
<ColumnDefinition MinWidth="50" Width="1*" />
<ColumnDefinition MinWidth="50" Width="1*"/>
</Grid.ColumnDefinitions>
<Button Command="{Binding Path=StartCommand}" Content="Start" Grid.Column="0" Grid.Row="0" />
<Button Command="{Binding Path=StopCommand}" Content="Stop" Grid.Column="1" Grid.Row="0"/>
</Grid>
<WpfTestingClient:StatusControl DockPanel.Dock="Top" HorizontalAlignment="Stretch"></WpfTestingClient:StatusControl>
</DockPanel>
</Border>
</DataTemplate>