AppBarButton にこんな Flyout を表示するために ListView を使ってみたのですが、 AppBarButton を押したときに Flyout の中で中身が横にスライドするアニメが残ってしまいました・・・
Flyout 自体の上へせり上がるアニメと二重にインタラクションが発生するので気持ち悪い;
いろいろと試行錯誤した結果、以下のようにコードを記述したら Flyout のアニメのみにできました!
<AppBarButton.Flyout> <Flyout x:Name="PaletteFlyout"> <Grid> <ListView x:Name="PaletteList" ItemContainerStyle="{StaticResource PaletteColorListViewItem}" ItemsSource="{Binding PaletteColors}" SelectedIndex="{Binding SelectedColorIndex, Mode=TwoWay}" SelectionChanged="OnPaletteListSelectionChanged" SelectionMode="Single" ShowsScrollingPlaceholders="False"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <ItemsWrapGrid ItemHeight="48" ItemWidth="48" MaximumRowsOrColumns="4" Orientation="Horizontal"> <ItemsWrapGrid.ChildrenTransitions> <TransitionCollection /> </ItemsWrapGrid.ChildrenTransitions> </ItemsWrapGrid> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate> <DataTemplate> <Grid> <Rectangle Margin="3" StrokeThickness="1"> <Rectangle.Stroke> <SolidColorBrush Color="{Binding BorderColor}" /> </Rectangle.Stroke> <Rectangle.Fill> <SolidColorBrush Color="{Binding Color}" /> </Rectangle.Fill> </Rectangle> </Grid> </DataTemplate> </ItemsControl.ItemTemplate> </ListView> </Grid> </Flyout> </AppBarButton.Flyout>
ちょっと理由はわかりませんが、ItemsPanel の ChildrenTransitions を空にすれば大丈夫みたいです