开发者

Silverlight DockPanel exception in runtime

开发者 https://www.devze.com 2023-02-22 01:55 出处:网络
I have a DockPanel in a U开发者_StackOverflow社区serControl, and in the designer looks everything fine, but I get an exception in runtime from the InitializeComponent():

I have a DockPanel in a U开发者_StackOverflow社区serControl, and in the designer looks everything fine, but I get an exception in runtime from the InitializeComponent():

The type 'DockPanel' was not found because 'http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit' is an unknown namespace.

Any idea?

<UserControl x:Class="Controls.PropertiesControl"
    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:my="clr-namespace:Controls"
    xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
    mc:Ignorable="d"
    d:DesignHeight="250" d:DesignWidth="800"
    >

    <Grid x:Name="LayoutRoot" Background="White">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="30"/>
            </Grid.RowDefinitions>

            <toolkit:DockPanel Background="Gray" Grid.Row="0" Grid.Column="0" />
        </Grid>
    </Grid>
</UserControl>


Do you reference the correct System.Windows.Controls.Toolkit.dll assembly in your project? If you're using Silverlight 4, also make sure it's the right version 4 (not 3).

0

精彩评论

暂无评论...
验证码 换一张
取 消