WPツールキットCustomMessageBox
から使用して、それに挿入できますTextbox
TextBox txtBox = new TextBox();
txtBox.Width = 460;
txtBox.Text = selectedChild.Name;
txtBox.HorizontalAlignment = HorizontalAlignment.Center;
txtBox.MaxLength = 14;
CustomMessageBox messageBox = new CustomMessageBox();
messageBox.Caption = "hello";
messageBox.Content = txtBox;
messageBox.LeftButtonContent = "OK";
messageBox.RightButtonContent = "Cancel";
messageBox.IsFullScreen = false;
messageBox.Dismissed += MessageBoxDismissed;
messageBox.Show();
ここにコールバックがあります
private void MessageBoxDismissed(object sender, DismissedEventArgs e)
{
CustomMessageBox messageBox = sender as CustomMessageBox;
if (messageBox != null && e.Result == CustomMessageBoxResult.LeftButton)
{
TextBox tb = messageBox.Content as TextBox;
if (tb != null && !string.IsNullOrEmpty(tb.Text.Trim()))
{
//do your stuff
}
}
else
{
}
}