Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/silverlight/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/284.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
自定义搜索上的Silverlight自动完成框_Silverlight_Autocompletebox - Fatal编程技术网

自定义搜索上的Silverlight自动完成框

自定义搜索上的Silverlight自动完成框,silverlight,autocompletebox,Silverlight,Autocompletebox,我有一个目标: public class Person { public string FirstName { get; set; } public string LastName { get; set; } public string FullName { get { return string.Format("{0} {1}", FirstName, LastName); } } public override string

我有一个目标:

public class Person
{
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public string FullName
    {
        get { return string.Format("{0} {1}", FirstName, LastName); }
    }

    public override string ToString()
    {
        return "Person " + LastName;
    }
}
这位同事:

public ICollection<Person> Persons { get; set; }
public ICollection Persons{get;set;}
我的自动完成框是:

<sdk:AutoCompleteBox ItemsSource="{Binding Persons}" FilterMode="Contains"
                                    SelectedItem="{Binding EmployeeSelected,Mode=TwoWay}"
                                 MinimumPrefixLength="2"/>

当我在Persons集合中搜索时,我希望按名字搜索?
在自动完成框中,哪一个是按名字搜索的属性?

使用
ValueMemberPath

<sdk:AutoCompleteBox ItemsSource="{Binding Persons}" FilterMode="Contains"
                                 SelectedItem="{Binding EmployeeSelected,Mode=TwoWay}"
                                 MinimumPrefixLength="2"
                                 ValueMemberPath="FirstName"/>