1

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

I download this control, But I cannot build it,

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

When I try using SearchFunction as public,I am getting this error. When I change it as internal it is working but this time I can't access SearchFunction from my project.

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)

What should I do?

Müslüm ÖZTÜRK
  • 961
  • 1
  • 11
  • 30

1 Answers1

3

Instead of adding the file to a WindowsRuntimeComponent project, add it to Windows store class library (if you have already created the project you can change the output type to class library in project properties->Output type).
The problem is if you create a WindowsRuntime component, you are a lot more limited in what you can make public as everything you make public need to have a valid WindowsRuntime type mapping.

Benoit Catherinet
  • 3,335
  • 1
  • 13
  • 12