protected override Size OnArrange(Size finalSize) { if (m_CheckBox.MeasuredSize.Height > m_Label.MeasuredSize.Height) { m_CheckBox.Arrange(new Rectangle(0, 0, m_CheckBox.MeasuredSize.Width, m_CheckBox.MeasuredSize.Height)); m_Label.Arrange(new Rectangle(m_CheckBox.MeasuredSize.Width + 4, (m_CheckBox.MeasuredSize.Height - m_Label.MeasuredSize.Height) / 2, m_Label.MeasuredSize.Width, m_Label.MeasuredSize.Height)); } else { m_CheckBox.Arrange(new Rectangle(0, (m_Label.MeasuredSize.Height - m_CheckBox.MeasuredSize.Height) / 2, m_CheckBox.MeasuredSize.Width, m_CheckBox.MeasuredSize.Height)); m_Label.Arrange(new Rectangle(m_CheckBox.MeasuredSize.Width + 4, 0, m_Label.MeasuredSize.Width, m_Label.MeasuredSize.Height)); } return(MeasuredSize); }
protected override Size OnArrange(Size finalSize) { if (m_SubmenuArrow != null) { m_SubmenuArrow.Arrange(new Rectangle(finalSize.Width - Padding.Right - m_SubmenuArrow.MeasuredSize.Width, (finalSize.Height - m_SubmenuArrow.MeasuredSize.Height) / 2, m_SubmenuArrow.MeasuredSize.Width, m_SubmenuArrow.MeasuredSize.Height)); } if (m_Accelerator != null) { m_Accelerator.Arrange(new Rectangle(finalSize.Width - Padding.Right - m_Accelerator.MeasuredSize.Width, (finalSize.Height - m_Accelerator.MeasuredSize.Height) / 2, m_Accelerator.MeasuredSize.Width, m_Accelerator.MeasuredSize.Height)); } return(base.OnArrange(finalSize)); }
protected override Size OnArrange(Size finalSize) { Properties parent = Parent as Properties; if (parent != null) { m_Label.Arrange(new Rectangle(Padding.Left, Padding.Top, parent.LabelWidth - Padding.Left - Padding.Right, m_Label.MeasuredSize.Height)); m_Property.Arrange(new Rectangle(parent.LabelWidth + Padding.Left, Padding.Top, finalSize.Width - parent.LabelWidth - Padding.Left - Padding.Right, m_Property.MeasuredSize.Height)); return(new Size(finalSize.Width, Math.Max(m_Label.MeasuredSize.Height, m_Property.MeasuredSize.Height) + Padding.Top + Padding.Bottom)); } return(Size.Zero); }