This is a migrated thread and some comments may be shown as answers.

Shared animations caused Invalid operation

6 Answers 58 Views
DataBoundListBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Nigel
Top achievements
Rank 1
Nigel asked on 18 Feb 2013, 02:35 AM
I have a view containing multiple data-bound list boxes in a pivot. I was wanting to make use of the Item Added Animation and because there are a number of similar lists throughout the application am using xaml styles. However I'm seeing a crash whenever two lists with the same style are on the page, but only when the animations are set.

The assembly version is Telerik.Windows.Controls.Primitives, Version=2012.3.1311.3040, Culture=neutral, PublicKeyToken=5803cfa389c90ce7

The style I'm using is the following.

<Style x:Key="AnimatedList" TargetType="telerikPrimitives:RadDataBoundListBox">
        <Setter Property="Margin" Value="0,0,-12,0" />
        <Setter Property="ItemAddedAnimation">
            <Setter.Value>
                <telerikCore:RadFadeAnimation StartOpacity="0" EndOpacity="1" Duration="0:0:1">
                    <telerikCore:RadFadeAnimation.Easing>
                        <ExponentialEase Exponent="6" EasingMode="EaseOut"/>
                    </telerikCore:RadFadeAnimation.Easing>
                </telerikCore:RadFadeAnimation>
            </Setter.Value>
        </Setter>
        <Setter Property="ItemRemovedAnimation">
            <Setter.Value>
                <telerikCore:RadFadeAnimation StartOpacity="1" EndOpacity="0" Duration="0:0:1">
                    <telerikCore:RadFadeAnimation.Easing>
                        <ExponentialEase Exponent="6" EasingMode="EaseIn"/>
                    </telerikCore:RadFadeAnimation.Easing>
                </telerikCore:RadFadeAnimation>
            </Setter.Value>
        </Setter>
    </Style>

The stack trace is as follows:
   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at System.Collections.Generic.Queue`1.Dequeue()
   at Telerik.Windows.Controls.RadVirtualizingDataControl.OnItemAddedAnimation_Ended(Object sender, EventArgs e)
   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
   at Telerik.Windows.Controls.RadAnimation.OnEnded()
   at Telerik.Windows.Controls.RadAnimation.OnStopped(PlayAnimationInfo info)
   at Telerik.Windows.Controls.RadAnimationManager.StopStoryboard(PlayAnimationInfo info)
   at Telerik.Windows.Controls.RadAnimationManager.OnStoryboardCompleted(Object sender, EventArgs e)
   at MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)

Removing the animation properties stops the error 100% of the time as does moving the animation definition from the style to the list box, but given this style is being used twenty plus times this isn't a long term maintainable solution.

Cheers

6 Answers, 1 is accepted

Sort by
0
Nigel
Top achievements
Rank 1
answered on 20 Feb 2013, 08:40 PM
I can confirm this issue isn't resolved in the Windows Phone 8 2013 Q1 release.
0
Deyan
Telerik team
answered on 21 Feb 2013, 07:35 AM
Hello Nigel,

Thanks for writing and please excuse us for the delay with our answer.

We do not support this approach in RadDataBoundListBox currently. You will have to define the animations inline wherever you have a ListBox control in your application.

The reason for this behavior is that in the ListBox we internally handle events exposed by the animations and when these animations are static and you have multiple listboxes attached to them, they all will handle events which might not be directly related to them.

I hope this helps.

All the best,
Deyan
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Andrey
Top achievements
Rank 1
answered on 17 Apr 2013, 09:17 AM
Correct if i'm wrong but i think we could use x:Shared="false" on resource, at least on Animation object in dictionary, but its impossible on WP8 ?
0
Deyan
Telerik team
answered on 22 Apr 2013, 07:03 AM
Hi Andrey,

The animations used by RadDataBoundListBox are custom objects and they do not support this property.

Regards,
Deyan
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Ryan
Top achievements
Rank 1
answered on 22 Aug 2013, 11:13 PM
Hi Deyan,

I was just running into this problem and fortunately stumbled upon this thread before wasting too much time.

Is there a plan to support reusable animation resources across multiple listboxes in the future? It's very annoying to have to redefine the same animation over and over.

Thanks
Ryan
0
Deyan
Telerik team
answered on 23 Aug 2013, 07:02 AM
Hello Ryan,

Thanks for writing.

We will put this on our TODO list and will try to re-architecture the animations so that they support these scenarios.

Let us know should you have further questions or need assistance.

Regards,
Deyan
Telerik
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Tags
DataBoundListBox
Asked by
Nigel
Top achievements
Rank 1
Answers by
Nigel
Top achievements
Rank 1
Deyan
Telerik team
Andrey
Top achievements
Rank 1
Ryan
Top achievements
Rank 1
Share this question
or