1
我有一个AutoSuggestBox,它的ItemSource与我的虚拟机有关。我该如何清除AutoSuggestBox项目
<AutoSuggestBox x:Name="MyBox" Grid.Row="1" GotFocus="MyBox_GotFocus"
QueryIcon="Find" PlaceholderText="Search"
QuerySubmitted="MyBox_QuerySubmitted"
TextMemberPath="Description"
Header="Search"
ItemsSource="{Binding SearchMatches}"
Style="{StaticResource SearchAutoSuggestBoxStyle}"
ItemTemplate="{StaticResource SearchItemTemplate}"/>
因此,可以说是这样的:
如何删除/清除其项/建议我void方法?
MyBox.Items.Clear() // this shows Catastrophic failure error
感谢
'SearchMatches.Clear()'。 –
@JustinXL大声笑今天太多的代码,我对一个简单的问题xD感到困惑,你能否请把这添加为答案,所以我可以将它标记为答案谢谢 – NicoTing
是的,这发生在我们所有人身上。 :) –