Exemplo n.º 1
0
        /// <summary>
        /// SizeHeightToContentProperty property changed handler.
        /// </summary>
        /// <param name="d">DynamicCanvas that changed its SizeHeightToContent.</param>
        /// <param name="e">Event arguments.</param>
        private static void OnSizeHeightToContentPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            DynamicCanvas source   = (DynamicCanvas)d;
            bool          oldValue = (bool)e.OldValue;
            bool          newValue = (bool)e.NewValue;

            source.OnSizeHeightToContentPropertyChanged(oldValue, newValue);
        }
Exemplo n.º 2
0
        /// <summary>
        /// CenterTopProperty property changed handler.
        /// </summary>
        /// <param name="dependencyObject">UIElement that changed its CenterTop.</param>
        /// <param name="eventArgs">Event arguments.</param>
        public static void OnCenterTopPropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs eventArgs)
        {
            UIElement source = dependencyObject as UIElement;

            if (source == null)
            {
                throw new ArgumentException("dependencyObject");
            }
            DynamicCanvas parent = VisualTreeHelper.GetParent(source) as DynamicCanvas;

            parent?.Invalidate();
        }