Exemple #1
0
        protected override void OnApplyTemplate()
        {
            _frame = base.GetTemplateChild("frame") as Panel;
            _panel = base.GetTemplateChild("panel") as CarouselPanel;

            _arrows = base.GetTemplateChild("arrows") as Grid;
            _left = base.GetTemplateChild("left") as Button;
            _right = base.GetTemplateChild("right") as Button;

            _gradient = base.GetTemplateChild("gradient") as LinearGradientBrush;
            _clip = base.GetTemplateChild("clip") as RectangleGeometry;

            _frame.ManipulationDelta += OnManipulationDelta;
            _frame.ManipulationCompleted += OnManipulationCompleted;
            _frame.ManipulationMode = ManipulationModes.TranslateX | ManipulationModes.System;

            _frame.PointerMoved += OnPointerMoved;
            _left.Click += OnLeftClick;
            _right.Click += OnRightClick;
            _left.PointerEntered += OnArrowPointerEntered;
            _left.PointerExited += OnArrowPointerExited;
            _right.PointerEntered += OnArrowPointerEntered;
            _right.PointerExited += OnArrowPointerExited;

            base.OnApplyTemplate();
        }
Exemple #2
0
        protected override void OnApplyTemplate()
        {
            _frame = base.GetTemplateChild("frame") as Panel;
            _panel = base.GetTemplateChild("panel") as CarouselPanel;

            _arrows = base.GetTemplateChild("arrows") as Grid;
            _left   = base.GetTemplateChild("left") as Button;
            _right  = base.GetTemplateChild("right") as Button;

            _gradient = base.GetTemplateChild("gradient") as LinearGradientBrush;
            _clip     = base.GetTemplateChild("clip") as RectangleGeometry;

            _frame.ManipulationDelta     += OnManipulationDelta;
            _frame.ManipulationCompleted += OnManipulationCompleted;
            _frame.ManipulationMode       = ManipulationModes.TranslateX | ManipulationModes.System;

            _frame.PointerMoved   += OnPointerMoved;
            _left.Click           += OnLeftClick;
            _right.Click          += OnRightClick;
            _left.PointerEntered  += OnArrowPointerEntered;
            _left.PointerExited   += OnArrowPointerExited;
            _right.PointerEntered += OnArrowPointerEntered;
            _right.PointerExited  += OnArrowPointerExited;

            base.OnApplyTemplate();
        }
Exemple #3
0
        protected override void OnApplyTemplate()
        {
            _frame = base.GetTemplateChild("frame") as Panel;
            _panel = base.GetTemplateChild("panel") as CarouselPanel;

            _gradient = base.GetTemplateChild("gradient") as LinearGradientBrush;
            _clip     = base.GetTemplateChild("clip") as RectangleGeometry;

            _frame.ManipulationDelta     += OnManipulationDelta;
            _frame.ManipulationCompleted += OnManipulationCompleted;
            _frame.ManipulationMode       = ManipulationModes.TranslateX | ManipulationModes.System;

            base.OnApplyTemplate();
        }