4

DataGridWindows Phone 7 プロジェクト (Silverligt 4) でWpfToolkit を使用しようとしていますが、機能しません。XAML は次のとおりです。

<UserControl x:Class="SilverlightControls.Grid"
    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"
    mc:Ignorable="d"
    xmlns:wtk="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit"
    d:DesignHeight="480" d:DesignWidth="480">

    <Grid x:Name="LayoutRoot" Background="#FF1F1F1F" Width="960">
        <Grid x:Name="TitleGrid">
            <TextBlock Text="{Binding Title}" Style="{StaticResource PhoneTextPageTitle2Style}"/>
        </Grid>
        <wtk:DataGrid>
        </wtk:DataGrid>
    </Grid>
</UserControl>

プロジェクトは正常にコンパイルされますが、このコントロールを読み込もうとすると実行時にクラッシュします。これまでに得た最良の手がかりは、Visual Studio Designer からのものです。コントロールに追加wtk:DataGridすると、ビジュアル デザイナーが読み込まれず、以下に例外が表示されます。

WpfToolkit が PresentationFramework.dll に依存しており、SL4 では利用できないのでしょうか?

System.Reflection.Adds.UnresolvedAssemblyException
タイプ ユニバースはアセンブリを解決できません: PresentationFramework、バージョン = 3.0.0.0、カルチャ = ニュートラル、PublicKeyToken = 31bf3856ad364e35。
   System.Reflection.Adds.AssemblyProxy.GetResolvedAssembly() で
   System.Reflection.Adds.AssemblyProxy.get_FullName() で
   Microsoft.Windows.Design.Metadata.ReflectionMetadataContext.PrepareAttributes (Reflectable`1 ReflectableAssembly) で
   Microsoft.Windows.Design.Metadata.ReflectionMetadataContext.PrepareAttributes (Reflectable`1 ReflectableType) で
   MS.Internal.Metadata.ClrType.GetAttributes[T] (ReflectionMetadataContext コンテキスト、IReflectable`1 メンバー、ITypeMetadata attributeType、ブール値のマージ、AttributeMergeCache& キャッシュ) で
   MS.Internal.Metadata.ClrMember`1.GetLocalAttributes (ITypeMetadata attributeType) で
   MS.Internal.Design.Metadata.Xaml.XamlType.GetSpecialProperty (Int32 idx、PropertyIdentifier pid) で
   MS.Internal.Design.Metadata.Xaml.XamlType.get_ContentProperty() で
   Microsoft.Windows.Design.Metadata.Xaml.XamlExtensionImplementations.GetContentProperty (ITypeMetadata sourceType) で
   Microsoft.Windows.Design.Metadata.Xaml.XamlExtensions.GetContentProperty (ITypeMetadata ソース) で
   MS.Internal.Design.Metadata.ReflectionTypeNode.get_ContentProperty() で
   MS.Internal.Design.Markup.XmlElement.CalcChildWhitespaceImportant (XamlElement 要素) で
   MS.Internal.Design.Markup.XmlElement.ConvertChildrenToXaml (XamlElement の結果、PrefixScope スコープ、IParseContext コンテキスト、IMarkupSourceProvider プロバイダー、ブール値の childrenAsString) で
   MS.Internal.Design.Markup.XmlElement.ConvertToXaml (XamlElement 親、PrefixScope 親スコープ、IParseContext コンテキスト、IMarkupSourceProvider プロバイダー) で
   MS.Internal.Design.Markup.XmlElement.ConvertChildrenToXaml (XamlElement の結果、PrefixScope スコープ、IParseContext コンテキスト、IMarkupSourceProvider プロバイダー、ブール値の childrenAsString) で
   MS.Internal.Design.Markup.XmlElement.ConvertToXaml (XamlElement 親、PrefixScope 親スコープ、IParseContext コンテキスト、IMarkupSourceProvider プロバイダー) で
   MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlSourceDocument.ParseElementFromSkeleton (XamlParseContext コンテキスト、SkeletonNode ノード、XamlElement 親、ブール値の fullElement) で
   MS.Internal.Design.DocumentModel.DocumentTrees.Markup.XamlSourceDocument.UpdateSkeleton (IDamageListener リスナー) で
   Microsoft.Windows.Design.DocumentModel.Trees.MarkupDocumentTreeManager.Update() で
   Microsoft.Windows.Design.DocumentModel.MarkupProducer.Update() で
   Microsoft.Windows.Design.DocumentModel.MarkupProducer.HandleMessage (DocumentTreeCoordinator 送信者、MessageKey キー、MessageArguments args) で
   Microsoft.Windows.Design.DocumentModel.MarkupProducer.Microsoft.Windows.Design.DocumentModel.IDocumentTreeConsumer.HandleMessage (DocumentTreeCoordinator 送信者、MessageKey キー、MessageArguments args) で
   Microsoft.Windows.Design.DocumentModel.DocumentTreeCoordinator.SendMessage[T] (MessageKey`1 キー、T args、ブール値 isPrivateMessage) で
   Microsoft.Windows.Design.DocumentModel.DocumentTreeCoordinator.QueuedMessage`1.Microsoft.Windows.Design.DocumentModel.IQueuedMessage.Invoke() で
   Microsoft.Windows.Design.DocumentModel.DocumentTreeCoordinator.ProcessQueuedMessages (オブジェクト状態) で
   System.Windows.Threading.ExceptionWrapper.InternalRealCall (デリゲート コールバック、オブジェクト引数、Int32 numArgs) で
   MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen (オブジェクト ソース、デリゲート メソッド、オブジェクト引数、Int32 numArgs、デリゲート catchHandler) で

4

1 に答える 1

3

ちょうど質問を投稿しようとしたときに、StackOverflow タグの auto-suggest がSilverlight Toolkitがあることを示しました。明らかにこれは私が使うべきものです。

私はすべての努力を質問に注いだので、質問と回答を、質問の自動回答における StackOverflow の素晴らしさの証として残します。

編集DataGrid を使用するには、Silverlight 3 Toolkit バイナリが必要です。次の 4 つの参照をプロジェクトに追加する必要があります。

  1. System.ComponentModel.DataAnnotations.dll
  2. System.Windows.Controls.Data.dll
  3. System.Windows.Controls.Data.Input.dll
  4. System.Windows.Data.dll
于 2010-03-23T11:47:27.507 に答える