I put my AdRotator control inside a stackpanel that also contains a "close" button, and bind that panel's visibility to a property that's either "Visible" or "Collapsed" depending on whether the user has purchased the "no
ads" upgrade. When the stackpanel is Visible the control works fine. However when the panel is collapsed, I get the exception "Value does not fall within the expected range" (stack is listed below):
This occurs after my page's constructor is called but before the page's "Loaded" event happens.
System.ArgumentException at Windows.UI.Xaml.Media.Animation.Storyboard.SetTarget(Timeline timeline, DependencyObject target)
at AdRotatorWin8.AdRotatorControl.InitialiseSlidingAnimations() at AdRotatorWin8.AdRotatorControl.AdRotatorControl_Loaded(Object sender, RoutedEventArgs e)