private async void AnimateNext(AccordionItem control)
        {
            _isBusy = true;
            await control.AnimateYAsync(GetTopBound());
            _isBusy = false;

            if (!control.IsUp)
            {
                control.IsUp = true;
                this.SelectedIndex++;
            }
        }
Example #2
0
        private async void AnimatePrev(AccordionItem control)
        {
            _isBusy = true;
            await control.AnimateYAsync(0);

            _isBusy = false;

            if (control.IsUp)
            {
                control.IsUp = false;
                this.SelectedIndex--;
            }
        }
Example #3
0
        private async void AnimateNext(AccordionItem control)
        {
            _isBusy = true;
            await control.AnimateYAsync(GetTopBound());

            _isBusy = false;

            if (!control.IsUp)
            {
                control.IsUp = true;
                this.SelectedIndex++;
            }
        }
        private void OnManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
        {
            if ((Math.Sign(e.Delta.Translation.Y) < 0 && this.SelectedIndex == this.Children.Count - 1))
            {
                e.Complete();
                return;
            }

            _current = _current ?? GetEligibleControl(e.Delta.Translation.Y);

            double deltaY = e.Delta.Translation.Y;
            double translateY = _current.GetTranslateY();
            _lastDeltaSign = Math.Sign(deltaY);

            double y = Math.Max(GetTopBound(), translateY + deltaY);
            y = Math.Min(0, y);
            _current.TranslateY(y);
        }
Example #5
0
 private void SetItemsSource(IEnumerable <object> items)
 {
     base.Children.Clear();
     if (items != null)
     {
         int n = items.Count() - 1;
         foreach (var item in items.Reverse())
         {
             var control = new AccordionItem
             {
                 Index           = n--,
                 Content         = item,
                 ContentTemplate = this.ItemTemplate,
                 Header          = item,
                 HeaderTemplate  = this.HeaderTemplate
             };
             base.Children.Add(control);
         }
     }
 }
Example #6
0
        private void OnManipulationDelta(object sender, ManipulationDeltaRoutedEventArgs e)
        {
            if ((Math.Sign(e.Delta.Translation.Y) < 0 && this.SelectedIndex == this.Children.Count - 1))
            {
                e.Complete();
                return;
            }

            _current = _current ?? GetEligibleControl(e.Delta.Translation.Y);

            double deltaY     = e.Delta.Translation.Y;
            double translateY = _current.GetTranslateY();

            _lastDeltaSign = Math.Sign(deltaY);

            double y = Math.Max(GetTopBound(), translateY + deltaY);

            y = Math.Min(0, y);
            _current.TranslateY(y);
        }
Example #7
0
 private void SetItemsSource(IEnumerable<object> items)
 {
     base.Children.Clear();
     if (items != null)
     {
         int n = items.Count() - 1;
         foreach (var item in items.Reverse())
         {
             var control = new AccordionItem
             {
                 Index = n--,
                 Content = item,
                 ContentTemplate = this.ItemTemplate,
                 Header = item,
                 HeaderTemplate = this.HeaderTemplate
             };
             base.Children.Add(control);
         }
     }
 }
        private async void AnimatePrev(AccordionItem control)
        {
            _isBusy = true;
            await control.AnimateYAsync(0);
            _isBusy = false;

            if (control.IsUp)
            {
                control.IsUp = false;
                this.SelectedIndex--;
            }
        }
 private void OnManipulationStarted(object sender, ManipulationStartedRoutedEventArgs e)
 {
     _current = null;
 }
Example #10
0
 private void OnManipulationStarted(object sender, ManipulationStartedRoutedEventArgs e)
 {
     _current = null;
 }