ArcGISPortalViewer.Controls.LiveTile.OnApplyTemplate C# (CSharp) Method

OnApplyTemplate() protected method

Invoked whenever application code or internal processes (such as a rebuilding layout pass) call ApplyTemplate. In simplest terms, this means the method is called just before a UI element displays in an application. Override this method to influence the default post-template logic of a class.
protected OnApplyTemplate ( ) : void
return void
        protected override void OnApplyTemplate()
        {
            _scroller = GetTemplateChild(SCROLLER_PARTNAME) as FrameworkElement;
            _currentElement = GetTemplateChild(CURRENT_PARTNAME) as FrameworkElement;
            _nextElement = GetTemplateChild(NEXT_PARTNAME) as FrameworkElement;
            _translate = GetTemplateChild(TRANSLATE_PARTNAME) as TranslateTransform;
            _stackPanel = GetTemplateChild(STACK_PARTNAME) as StackPanel;
            if (_stackPanel != null)
            {
                if (Direction == SlideDirection.Up)
                    _stackPanel.Orientation = Orientation.Vertical;
                else
                    _stackPanel.Orientation = Orientation.Horizontal;
            }
            if(ItemsSource != null)
                Start();
            base.OnApplyTemplate();
        }