我有一个名为 FluidPanel 的自定义类,它扩展了Panel并覆盖了方法 MeasureOverride 和 ArrangeOverride。目标是创建 Google Keep 外观。好的,它工作正常。(应用链接)
但是,因为我正在扩展一个基本面板并将其用作 ItemsPanelTemplate,所以我缺少两件事:重新排序和一些转换,这根本无法开箱即用。见代码:
<GridView CanReorderItems="True" CanDrag="True" AllowDrop="True">
<GridView.ItemContainerTransitions>
<TransitionCollection>
<EntranceThemeTransition FromVerticalOffset="200" IsStaggeringEnabled="True"/>
<ReorderThemeTransition/>
</TransitionCollection>
</GridView.ItemContainerTransitions>
<GridView.ItemsPanel>
<ItemsPanelTemplate>
<local:FluidPanel/><!--custom panel = reorder doesn't work-->
<!--<StackPanel/>--><!--reorder and animations work normally (reorder to see)-->
</ItemsPanelTemplate>
</GridView.ItemsPanel>
<Grid Width="50" Height="50" Background="Red"/>
<Grid Width="50" Height="50" Background="Green"/>
<Grid Width="50" Height="50" Background="Blue"/>
<Grid Width="50" Height="50" Background="Orange"/>
<Grid Width="50" Height="50" Background="Purple"/>
<Grid Width="50" Height="50" Background="Pink"/>
</GridView>
所以,主要问题是:如何创建一个完全正常工作的自定义面板,包括动画?(就像向左/向右/的偏移量...)
第二个(不太重要的)问题是:EntranceThemeTransition 工作了吗?