Example #1
0
        /// <summary>
        /// Called when alignment is changed.
        /// </summary>
        /// <param name="dpObj">The dependency object.</param>
        /// <param name="e">The <see cref="DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
        private static void OnAlignmentChanged(DependencyObject dpObj, DependencyPropertyChangedEventArgs e)
        {
            ChartDockPanel dockPanel = VisualTreeHelper.GetParent(dpObj) as ChartDockPanel;

            if (dockPanel != null)
            {
                dockPanel.InvalidateMeasure();
            }
        }
Example #2
0
        /// <summary>
        /// DockProperty property changed handler.
        /// </summary>
        /// <param name="d">UIElement that changed its ChartDock.</param>
        /// <param name="e">Event arguments.</param>
        private static void OnDockPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            if (e.NewValue.Equals(e.OldValue))
            {
                return;
            }

            // Ignore the change if requested
            if (_ignorePropertyChange)
            {
                _ignorePropertyChange = false;
                return;
            }

            UIElement element = (UIElement)d;

            // Cause the DockPanel to update its layout when a child changes
            ChartDockPanel panel = VisualTreeHelper.GetParent(element) as ChartDockPanel;

            if (panel != null)
            {
                panel.InvalidateMeasure();
            }
        }