public override void OnApplyTemplate() { _nodePropertiesPanel = (FrameworkElement) GetTemplateChild("PART_NodePropertiesPanel"); // _inputPins = (ItemsControl) GetTemplateChild("PART_InputPins"); // _outputPins = (ItemsControl) GetTemplateChild("PART_OutputPins"); // _pinPanel = (PinPanel) GetTemplateChild("PART_ConnectionPointsPanel"); _playPauseButton = (PlayPauseButton)GetTemplateChild("PART_PlayPause"); _nodePropertiesPanel.LayoutTransform = new ScaleTransform(IsCollapsed ? 0 : 1, IsCollapsed ? 0 : 1); // _pinPanel.CollapseCoefficient = IsCollapsed ? 0 : 1; _playPauseButton.Checked += PlayPauseButtonOnChecked; base.OnApplyTemplate(); }