C# AutoSuggestBox查询所选文本框
我正在使用AutoSuggestBox控件显示一些结果,例如:C# AutoSuggestBox查询所选文本框,c#,xaml,mvvm,uwp,C#,Xaml,Mvvm,Uwp,我正在使用AutoSuggestBox控件显示一些结果,例如: <AutoSuggestBox Width="192" PlaceholderText="Search" HorizontalAlignment="Right" ItemsSource="{Binding
<AutoSuggestBox Width="192"
PlaceholderText="Search"
HorizontalAlignment="Right"
ItemsSource="{Binding SearchResults}">
<i:Interaction.Behaviors>
...
</i:Interaction.Behaviors>
<AutoSuggestBox.ItemTemplate>
<DataTemplate>
<TextBlock>
<Run Text="{Binding Name}" />
<Run Text="(" /><Run Text="{Binding Origin_Country[0]}" /><Run Text=")" />
</TextBlock>
</DataTemplate>
</AutoSuggestBox.ItemTemplate>
选择条目后:
我想要的是为文本框定义某种类型的模板,以绑定到模型的属性之一,从而不显示模型路径。这可能吗 将TextMemberPath
属性设置为要显示的模型属性之一
TextMemberPath="someproperty"
我自己不是Windows 8 phones开发人员,但你能点击SuggestionSelected事件,取消选择并手动设置文本框的内容吗?哇,比我想象的要简单。非常感谢。
TextMemberPath="someproperty"