private void LongListSelector_GroupViewOpened(object sender, GroupViewOpenedEventArgs e) { //Hold a reference to the active long list selector. currentSelector = sender as LongListSelector; //Construct and begin a swivel animation to pop in the group view. IEasingFunction quadraticEase = new QuadraticEase { EasingMode = EasingMode.EaseOut }; Storyboard _swivelShow = new Storyboard(); ItemsControl groupItems = e.ItemsControl; foreach (var item in groupItems.Items) { UIElement container = groupItems.ItemContainerGenerator.ContainerFromItem(item) as UIElement; if (container != null) { Border content = VisualTreeHelper.GetChild(container, 0) as Border; if (content != null) { DoubleAnimationUsingKeyFrames showAnimation = new DoubleAnimationUsingKeyFrames(); EasingDoubleKeyFrame showKeyFrame1 = new EasingDoubleKeyFrame(); showKeyFrame1.KeyTime = TimeSpan.FromMilliseconds(0); showKeyFrame1.Value = -60; showKeyFrame1.EasingFunction = quadraticEase; EasingDoubleKeyFrame showKeyFrame2 = new EasingDoubleKeyFrame(); showKeyFrame2.KeyTime = TimeSpan.FromMilliseconds(85); showKeyFrame2.Value = 0; showKeyFrame2.EasingFunction = quadraticEase; showAnimation.KeyFrames.Add(showKeyFrame1); showAnimation.KeyFrames.Add(showKeyFrame2); Storyboard.SetTargetProperty(showAnimation, new PropertyPath(PlaneProjection.RotationXProperty)); Storyboard.SetTarget(showAnimation, content.Projection); _swivelShow.Children.Add(showAnimation); } } } _swivelShow.Begin(); }
private void LongListSelector_GroupViewOpened(object sender, GroupViewOpenedEventArgs e) { this.currentSelector = sender as LongListSelector; QuadraticEase ease = new QuadraticEase { EasingMode = EasingMode.EaseOut }; IEasingFunction function = ease; Storyboard storyboard = new Storyboard(); ItemsControl itemsControl = e.ItemsControl; foreach (object obj2 in itemsControl.Items) { UIElement reference = itemsControl.ItemContainerGenerator.ContainerFromItem(obj2) as UIElement; if (reference != null) { Border child = VisualTreeHelper.GetChild(reference, 0) as Border; if (child != null) { DoubleAnimationUsingKeyFrames element = new DoubleAnimationUsingKeyFrames(); EasingDoubleKeyFrame frame = new EasingDoubleKeyFrame { KeyTime = System.TimeSpan.FromMilliseconds(0.0), Value = -60.0, EasingFunction = function }; EasingDoubleKeyFrame frame2 = new EasingDoubleKeyFrame { KeyTime = System.TimeSpan.FromMilliseconds(85.0), Value = 0.0, EasingFunction = function }; element.KeyFrames.Add(frame); element.KeyFrames.Add(frame2); Storyboard.SetTargetProperty(element, new PropertyPath(PlaneProjection.RotationXProperty)); Storyboard.SetTarget(element, child.Projection); storyboard.Children.Add(element); } } } storyboard.Begin(); }
private void LongListSelector_GroupViewOpened(object sender, GroupViewOpenedEventArgs e) { var control = e.ItemsControl.Parent as UIElement; var generator = e.ItemsControl.ItemContainerGenerator; foreach (var item in e.ItemsControl.Items) { var container = generator.ContainerFromItem(item); if (addedType == null) { addedType = container.GetType(); TiltEffect.TiltableItems.Add(addedType); } if (container != null) { TiltEffect.SetIsTiltEnabled(container, true); } } ScrollViewer.SetVerticalScrollBarVisibility(control, ScrollBarVisibility.Disabled); }