protected override void OnShown(EventArgs e) { base.OnShown(e); int borderHeight = Height - tableLayoutPanel1.Height; int currentHeight = tableLayoutPanel1.Height; int messageWidth = tableLayoutPanel1.Width - MessageTextLabel.Margin.Horizontal; if (MessageIconBox.Visible) { messageWidth -= MessageIconBox.Width + MessageIconBox.Margin.Horizontal; } var minHeight = MessageTextLabel.GetPreferredSize(new Size(messageWidth, 9999)).Height + MessageTextLabel.Margin.Vertical; if (MessageIconBox.Visible) { minHeight = Math.Max(minHeight, MessageIconBox.Height + MessageIconBox.Margin.Vertical); } if (ErrorDetailTextBox.Visible) { minHeight += 90 + ErrorDetailTextBox.Margin.Vertical; } minHeight += flowLayoutPanel1.Height + flowLayoutPanel1.Margin.Vertical; //if (currentHeight < minHeight) Height = minHeight + borderHeight; }
/// <inheritdoc/> /// <since_tizen> 9 </since_tizen> public override void CopyFrom(BindableObject bindableObject) { base.CopyFrom(bindableObject); if (bindableObject is AlertDialogStyle alertDialogStyle) { TitleTextLabel.CopyFrom(alertDialogStyle.TitleTextLabel); MessageTextLabel.CopyFrom(alertDialogStyle.MessageTextLabel); ActionContent.CopyFrom(alertDialogStyle.ActionContent); } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (!ErrorDetailTextBox.Visible) { tableLayoutPanel1.RowStyles[0].Height = 100; tableLayoutPanel1.RowStyles[0].SizeType = SizeType.Percent; ErrorDetailTextBox.Visible = false; tableLayoutPanel1.RowStyles[1].Height = 0; tableLayoutPanel1.RowStyles[1].SizeType = SizeType.Absolute; var prefSize = MessageTextLabel.GetPreferredSize(new Size(Width, 99999)); int MinHeight = Math.Max(prefSize.Height, MessageIconBox.Height + MessageIconBox.Margin.Vertical); MinHeight = Math.Max(MinHeight, 100); MinHeight += flowLayoutPanel1.Height; Height = MinHeight + 6; MessageTextLabel.Anchor = AnchorStyles.Top; } }