SurfaceAnimateUtility.ThrowSVI

Mar 3, 2011 at 5:08 AM

Hi Blake,

Sorry if I'm doing something stupid here, I've got a specific SVI initialized and displaying on the screen and I've hooked up a double-tap gesture event to throw the SVI using your utility. I have an issue where the first double-tap produces this error:

System.ArgumentException: 'NaN,NaN' is not a valid value for property 'From'.   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)   at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value)   at System.Windows.Media.Animation.PointAnimation..ctor(Point fromValue, Point toValue, Duration duration)   at Blake.NUI.WPF.Utility.AnimateUtility.AnimateElementPoint(DependencyObject element, DependencyProperty property, Point targetValue, Double fromTime, Double toTime, IEasingFunction ease)   at Blake.NUI.WPF.SurfaceToolkit.Utility.SurfaceAnimateUtility.ThrowSVI(ScatterViewItem svi, Point targetPoint, Double targetOrientation, Double fromTime, Double toTime, IEasingFunction ease)   at Waterloo.Main.MainWindow.DoubleTap(Object sender, EventArgs e) in E:\My Projects\EVA\Showcase\Waterloo\Waterloo.MultiTouch\MainWindow.xaml.cs:line 220

However, if I move/drag the SVI around a little first and then double-tap it works fine. Do you know if I should manually set the SVI's position or something on initialize?

Rav

Mar 3, 2011 at 5:18 AM

if I manually set the Center property in the constructor before calling the ThrowSVI function it works

Coordinator
Mar 3, 2011 at 5:38 AM

Yes, the Center property defaults to (NaN, NaN) which cannot be animated from. I'll look at adding some validation checking but for now you can set the Center property and it will work.

Coordinator
Mar 3, 2011 at 5:39 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Mar 3, 2011 at 8:23 AM

Hey Josh,

Got another issue, in my project I wasn't able to add a WCF service reference using the Visual Studio tools. I found that when I set the tool to 'Reuse types in specified referenced assemblies' and select everything EXCEPT the Blake.NUI dlls it worked. Might be some strange assembly conflict in there somewhere?

Rav

Coordinator
Mar 3, 2011 at 9:09 PM

No idea. Can you email me a minimal project that reproduces that issue?