Beispiel #1
0
        private static void ItemsSource_OnChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            SlideView slideView = (SlideView)d;

            slideView.UpdateSources(new bool?());
            if (e.NewValue != null)
            {
                slideView.SelectedIndex = 0;
            }
            slideView.StartAutoSlide();
        }
Beispiel #2
0
 private void UpdateSources(bool update0, bool update1, bool update2)
 {
     if (update1)
     {
         SlideView.SetDataContext(this._elements[1], this.GetItem(this._selectedIndex));
     }
     if (update0)
     {
         SlideView.SetDataContext(this._elements[0], this.GetItem(this._selectedIndex - 1));
     }
     if (!update2)
     {
         return;
     }
     SlideView.SetDataContext(this._elements[2], this.GetItem(this._selectedIndex + 1));
 }
Beispiel #3
0
        private void UpdateSources(bool?movedForvard = null)
        {
            if (this._elements == null)
            {
                return;
            }
            if (!movedForvard.HasValue)
            {
                SlideView.SetDataContext(this._elements[1], this.GetItem(this._selectedIndex));
            }
            int num = !movedForvard.HasValue ? 1 : (movedForvard.Value ? 1 : 0);

            if ((!movedForvard.HasValue ? 1 : (!movedForvard.Value ? 1 : 0)) != 0)
            {
                SlideView.SetDataContext(this._elements[0], this.GetItem(this._selectedIndex - 1));
            }
            if (num == 0)
            {
                return;
            }
            SlideView.SetDataContext(this._elements[2], this.GetItem(this._selectedIndex + 1));
        }