1

https://github.com/igorkulman/AutoCompleteBox/blob/master/AutoCompleteBox/AutoCompleteBox.cs

このコントロールをダウンロードしますが、ビルドできません。

public Func<string, string, bool> SearchFunction
{
   get { return (Func<string, string, bool>)GetValue(SearchFunctionProperty); }
   set { SetValue(SearchFunctionProperty, value); }
}

SearchFunction を public として使用しようとすると、このエラーが発生します。内部として変更すると機能しますが、今回はプロジェクトから SearchFunction にアクセスできません。

Method 'CodeAutoComplete.AutoCompleteBox.SearchFunction.get()' has a parameter of type
 'System.Func<System.String, System.String, System.Boolean>' in its signature. Although 
this generic type is not a valid Windows Runtime type, the type or its generic parameters 
implement interfaces that are valid Windows Runtime types. Consider changing the type 
'System.Func<T1, T2, TResult>' in the method signature. It is not a valid Windows Runtime 
parameter type. C:\\..CodeAutoComplete\AutoCompleteBox.cs CodeAutoComplete (Windows 8.1)

私は何をすべきか?

4

1 に答える 1

3

ファイルを WindowsRuntimeComponent プロジェクトに追加する代わりに、Windows ストア クラス ライブラリに追加します (既にプロジェクトを作成している場合は、プロジェクト プロパティ -> 出力タイプで出力タイプをクラス ライブラリに変更できます)。
問題は、WindowsRuntime コンポーネントを作成する場合、公開できるものはすべて有効な WindowsRuntime 型マッピングを持つ必要があるため、公開できるものが大幅に制限されることです。

于 2013-09-23T19:09:17.280 に答える