Inheritance: FrameworkElement, IItemsPresenter, IScrollSnapPointsInfo
Beispiel #1
0
 override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            _suppressAnimations = false;

            _itemsList = GetTemplateChild(ItemsListName) as ItemsPresenter;
#if WINDOWS_PHONE
            _itemsList.CacheMode = new BitmapCache();
#endif
            _translate = GetTemplateChild(SlidingTransformName) as TranslateTransform;
        }
        protected override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            LayoutRoot = (FrameworkElement)GetTemplateChild("LayoutRoot");
            ItemsPresenter = (ItemsPresenter)GetTemplateChild("ItemsPresenter");

            this.ManipulationMode = ManipulationModes.TranslateX | ManipulationModes.TranslateRailsX;
            this.ManipulationStarted += OnManipulationStarted;
            this.ManipulationDelta += OnManipulationDelta;
        }
Beispiel #3
0
        /// <summary>
        /// Gets the template parts and sets event handlers.
        /// </summary>
        protected override void OnApplyTemplate()
        {
            if (_expanderPanel != null)
            {
                _expanderPanel.Tapped -= OnExpanderPanelTap;
            }

            base.OnApplyTemplate();

            _expanderPanel = base.GetTemplateChild(ExpanderPanel) as Grid;
            _expandedToCollapsedFrame = base.GetTemplateChild(ExpandedToCollapsedKeyFrame) as EasingDoubleKeyFrame;
            _collapsedToExpandedFrame = base.GetTemplateChild(CollapsedToExpandedKeyFrame) as EasingDoubleKeyFrame;
            _itemsCanvas = base.GetTemplateChild("ItemsCanvas") as Canvas;

            VisualState expandedState = (base.GetTemplateChild(ExpandedState) as VisualState);
            if (expandedState != null)
            {
                _expandedStateAnimation = expandedState.Storyboard.Children[0] as DoubleAnimation;
            }

            _presenter = base.GetTemplateChild(Presenter) as ItemsPresenter;
            if (_presenter != null)
            {
                _presenter.SizeChanged += OnPresenterSizeChanged;
            }

            if (_expanderPanel != null)
            {
                _expanderPanel.Tapped += OnExpanderPanelTap;
            }

            UpdateVisualState(false);
        }
Beispiel #4
0
        protected override void OnApplyTemplate()
        {
            if (_touchAreaRectangle != null)
            {
                _touchAreaRectangle.Tapped -= OnTouchAreaRectangleTap;
            }
            base.OnApplyTemplate();

            _touchAreaRectangle = GetTemplateChild(TouchAreaRectangle) as Rectangle;
            _expandedToCollapsedFrame = GetTemplateChild(ExpandedToCollapsedKeyFrame) as EasingDoubleKeyFrame;
            _collapsedToExpandedFrame = GetTemplateChild(CollapsedToExpandedKeyFrame) as EasingDoubleKeyFrame;
            _itemsCanvas = GetTemplateChild("ItemsCanvas") as Canvas;
            _header = GetTemplateChild("ExpandableContent") as Border;
            var expandedState = (GetTemplateChild(ExpandedState) as VisualState);
            if (expandedState != null)
            {
                _expandedStateAnimation = expandedState.Storyboard.Children[0] as DoubleAnimation;
            }
            _presenter = GetTemplateChild(Presenter) as ItemsPresenter;
            if (_presenter != null)
            {
                _presenter.SizeChanged += OnPresenterSizeChanged;
            }
            if (_touchAreaRectangle != null)
            {
                _touchAreaRectangle.Tapped += OnTouchAreaRectangleTap;
            }
            if (_itemsCanvas != null)
            {
                _itemsCanvas.SizeChanged += OnPresenterSizeChanged;
            }
            UpdateVisualState(false);
        }
 public ItemsPresenterEvents(ItemsPresenter This)
     : base(This)
 {
     this.This = This;
 }
        /// <summary>
        /// Builds the visual tree for the Accordion control when a 
        /// new template is applied.
        /// </summary>
        protected override void OnApplyTemplate()
        {
            ItemsControlHelper.OnApplyTemplate();
            base.OnApplyTemplate();
            Interaction.OnApplyTemplateBase();

            _presenter = base.GetTemplateChild(Presenter) as ItemsPresenter;
        }