Silverlight Dockpanel边框样式

时间:2011-04-04 11:08:41

标签: silverlight

有没有人知道如何向Dockpanel添加边框。我有这个:

<Style x:Key="DockPanelStyle" TargetType="controlsToolkit:DockPanel">        
    <Setter Property="Border">
        <Setter.Value>
            <Border BorderBrush="Gray" BorderThickness="1"/>
        </Setter.Value>
    </Setter>
    <Setter Property="HorizontalAlignment" Value="Stretch" />
    <Setter Property="VerticalAlignment" Value="Stretch" />
</Style>

但是它发送了一个错误,即Property border不正确

谢谢

1 个答案:

答案 0 :(得分:1)

您可以这样做:

<Border BorderBrush="Black" BorderThickness="4" Width="200" Height="150">
  <controlsToolkit:DockPanel ... />
</Border>