The AutoSuggestBox
shows a ListView
for the suggestions. That animation is actually the ListView
's animation. The following code should disable the animation:
public MainPage()
{
this.InitializeComponent();
this.AutoSuggestBoxControl.Loaded += AutoSuggestBoxControl_Loaded;
}
private void AutoSuggestBoxControl_Loaded(object sender, RoutedEventArgs _)
{
if (sender is not AutoSuggestBox autoSuggestBox ||
VisualTreeHelper.GetChild(autoSuggestBox, 0) is not Grid grid ||
grid.Children.FirstOrDefault(gridChild => gridChild is Popup) is not Popup popup ||
popup.Child is not Border popupChildBorder ||
popupChildBorder.Child is not ListView popupListView)
{
return;
}
popupListView.ItemContainerTransitions = null;
}
UPDATE
If you want to do this in XAML:
<AutoSuggestBox
ItemsSource="{x:Bind Cats}"
TextChanged="AutoSuggestBoxControl_TextChanged">
<AutoSuggestBox.Resources>
<Style TargetType="ListView">
<Setter Property="ItemContainerTransitions">
<Setter.Value>
<TransitionCollection/>
</Setter.Value>
</Setter>
</Style>
</AutoSuggestBox.Resources>
</AutoSuggestBox>