Esempio n. 1
0
        private static void OnIsExpandedChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            LoopingSelector picker = (LoopingSelector)sender;

            if (picker.IsExpanded)
            {
                picker.Balance();
            }
            else
            {
                picker.SelectAndSnapToClosest();
            }

            picker.UpdateItemState();

            if (picker._state == State.Normal || picker._state == State.Expanded)
            {
                picker._state = picker.IsExpanded ? State.Expanded : State.Normal;
            }

            picker._actualIsExpanded = picker.IsExpanded;

            var listeners = picker.IsExpandedChanged;

            if (listeners != null)
            {
                listeners(picker, e);
            }
        }
Esempio n. 2
0
        private static void OnDataSourceChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
        {
            LoopingSelector picker = (LoopingSelector)obj;

            if (e.OldValue != null)
            {
                ((ILoopingSelectorDataSource)e.OldValue).SelectionChanged -= picker.OnDataSourceSelectionChanged;
            }

            if (e.NewValue != null)
            {
                ((ILoopingSelectorDataSource)e.NewValue).SelectionChanged += picker.OnDataSourceSelectionChanged;
            }

            picker.UpdateData();
        }
Esempio n. 3
0
        private static void OnItemTemplateChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
        {
            LoopingSelector picker = (LoopingSelector)obj;

            picker.UpdateItemTemplates();
        }