【发布时间】:2014-01-27 19:17:40
【问题描述】:
我将fluidmovebehavior设置为Listbox:
<ItemsPanelTemplate>
<StackPanel HorizontalAlignment="Stretch">
<i:Interaction.Behaviors>
<ilayout:FluidMoveBehavior AppliesTo="Children" Duration="0:0:0.3">
<ilayout:FluidMoveBehavior.EaseY>
<ExponentialEase EasingMode="EaseOut" />
</ilayout:FluidMoveBehavior.EaseY>
</ilayout:FluidMoveBehavior>
</i:Interaction.Behaviors>
</StackPanel>
</ItemsPanelTemplate>
Listbox 放置在 MainPage.xaml 中,并有一些 List 作为 ItemsSource。动画工作正常,但是当我导航到新页面(无论是哪个页面,甚至是空白页面)时,我都会得到 System.ArgumentException。然后我评论了所有 xaml 代码 ItemsPanelTemplate ,即关闭流体动画。然后导航工作正常。
堆栈跟踪:
System.Windows.ni.dll!MS.Internal.XcpImports.MethodEx(System.IntPtr ptr, string name, MS.Internal.CValue[] cvData)
System.Windows.ni.dll!MS.Internal.XcpImports.MethodPack(System.IntPtr objectPtr, string methodName, object[] rawData)
System.Windows.ni.dll!MS.Internal.XcpImports.UIElement_TransformToVisual(System.Windows.UIElement element, System.Windows.UIElement visual)
System.Windows.ni.dll!System.Windows.UIElement.TransformToVisual(System.Windows.UIElement visual)
microsoft.expression.interactions.DLL!Microsoft.Expression.Interactivity.Layout.FluidMoveBehaviorBase.TranslateRect(System.Windows.Rect rect, System.Windows.FrameworkElement from, System.Windows.FrameworkElement to)
microsoft.expression.interactions.DLL!Microsoft.Expression.Interactivity.Layout.FluidMoveBehaviorBase.UpdateLayoutTransition(System.Windows.FrameworkElement child)
microsoft.expression.interactions.DLL!Microsoft.Expression.Interactivity.Layout.FluidMoveBehaviorBase.AssociatedObject_LayoutUpdated(object sender, System.EventArgs e)
System.Windows.ni.dll!System.Windows.FrameworkElement.OnLayoutUpdated(object sender, System.EventArgs e)
System.Windows.ni.dll!MS.Internal.JoltHelper.RaiseEvent(System.IntPtr target, uint eventId, System.IntPtr coreEventArgs, uint eventArgsTypeIndex)
添加:如果我设置为 listbox.ItemsSource = null ,在导航到另一个页面之前,不会发生异常。
我做错了什么?
对不起,我的语言不好)。
【问题讨论】:
标签: c# windows-phone-8 listbox