0

UserControlにDockPanelがあり、デザイナではすべて正常に見えますが、実行時にInitializeComponent()から例外が発生します。

「 http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit」が不明な名前空間であるため、タイプ「DockPanel」が見つかりませんでした。

何か案が?

<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>
4

1 に答える 1

1

プロジェクトで正しいSystem.Windows.Controls.Toolkit.dllアセンブリを参照していますか?Silverlight 4を使用している場合は、それが正しいバージョン4(3ではない)であることも確認してください。

于 2011-04-04T11:08:17.290 に答える