public static bool GetDisabledHeight(DesignerContainer m_DesignerItem) { var disabledH = (m_DesignerItem.Item != null && (!Double.IsNaN(m_DesignerItem.Item.MinHeight) && m_DesignerItem.Item.MinHeight != 0 && m_DesignerItem.Item.MaxHeight == m_DesignerItem.Item.MinHeight)) || (m_DesignerItem.Content is ContentControl && (m_DesignerItem.Content as ContentControl).MaxHeight != 0 && !Double.IsInfinity((m_DesignerItem.Content as ContentControl).MaxHeight) && (m_DesignerItem.Content as ContentControl).MaxHeight == (m_DesignerItem.Content as ContentControl).MinHeight); return(disabledH); }
private static void OnLockPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { DesignerContainer s = sender as DesignerContainer; if (s == null) { return; } s.Editable = !(bool)e.NewValue; if (!s.Editable) { s.IsSelected = true; } }
public static bool GetDisabledWidth(DesignerContainer m_DesignerItem) { var disabledW = (m_DesignerItem.Item != null && (!Double.IsNaN(m_DesignerItem.Item.MinWidth) && m_DesignerItem.Item.MinWidth != 0 && m_DesignerItem.Item.MinWidth == m_DesignerItem.Item.MaxWidth && m_DesignerItem.Item.GetType() != typeof(DesignerContainer))) || (m_DesignerItem.Content is ContentControl && (m_DesignerItem.Content as ContentControl).MaxWidth != 0 && !Double.IsInfinity((m_DesignerItem.Content as ContentControl).MaxWidth) && (m_DesignerItem.Content as ContentControl).MaxWidth == (m_DesignerItem.Content as ContentControl).MinWidth); return(disabledW); }