Microsoft.Silverlight.Testing.Controls.TreeViewItem.OnApplyTemplate C# (CSharp) Method

OnApplyTemplate() public method

Builds the visual tree for the T:Microsoft.Silverlight.Testing.Controls.TreeViewItem control when a new control template is applied.
public OnApplyTemplate ( ) : void
return void
        public override void OnApplyTemplate()
        {
            ItemsControlHelper.OnApplyTemplate();

            // Get the template parts
            ExpanderButton = GetTemplateChild(ExpanderButtonName) as ToggleButton;
            HeaderElement = GetTemplateChild(HeaderName) as FrameworkElement;

            // Try to get the ExpansionStates visual state group
            ExpansionStateGroup = VisualStates.TryGetVisualStateGroup(this, VisualStates.GroupExpansion);

            Interaction.OnApplyTemplateBase();
            base.OnApplyTemplate();
        }