没有找到DockPanel的附加属性Dock

时间:2012-06-27 04:39:08

标签: silverlight

这是我的代码......我们可以在此代码中找到按钮标记。有按钮标签我想使用DockPanel的附加属性Dock。但我并没有得到它的支持。我怎么能得到它。

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
xmlns:mswindows="clr-namespace:Microsoft.Windows;assembly=System.Windows.Controls.Toolkit"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">

<toolkit:DockPanel x:Name="LayoutRoot">
    <Button Content="Create New Employee" Height="27" Width="136"></Button>
    <sdk:DataGrid Background="White">

    </sdk:DataGrid>

</toolkit:DockPanel>

1 个答案:

答案 0 :(得分:1)

附加属性与DockPanel位于同一个空间中,因此您需要使用toolkit:DockPanel.Dock

<toolkit:DockPanel x:Name="LayoutRoot">
    <Button toolkit:DockPanel.Dock="Top" Content="Create New Employee" />    
</toolkit:DockPanel>

这是一个很好的tutorial how to use the DockPanel in Silverlight

相关问题