/// <summary>
        /// Invoked when bitmap's Source property is changed.
        /// </summary>
        /// <param name="dependencyObject">Dependency object - bitmap.</param>
        /// <param name="eventArgs">Event data.</param>
        private static void _OnSourceChanged(DependencyObject dependencyObject,
                                             DependencyPropertyChangedEventArgs eventArgs)
        {
            SmartBitmap smartBitmap = (SmartBitmap)dependencyObject;

            smartBitmap._bitmapUIElement.Source = (BitmapSource)eventArgs.NewValue;
        }
        /// <summary>
        /// Initializes parts of control.
        /// </summary>
        private void _InitControlParts()
        {
            _toggleButton = this.GetTemplateChild("PART_HeaderButton") as ToggleButton;
            _toggleButton.Command = ClickCommand;

            _iconBitmap = this.GetTemplateChild("iconBitmap") as SmartBitmap;

            _iconBorder = this.GetTemplateChild("iconBorder") as Border;

            _bitmapStackPanel = this.GetTemplateChild("bitmapStackPanel") as StackPanel;

            _InitIcon();
        }