You already have a reference to the TextBox, so where is the issue?
mb.Dismissed += (e1, e2) =>
{
System.Diagnostics.Debug.WriteLine(tbName.Text);
};
Question
I have create a CustomMessageBox like this:
TextBox tbName = new TextBox();
tbName.Text = "test";
tbName.Name = "tbName";
Grid grid = new Grid();
grid.Children.Add(tbName);
grid.Name = "grid";
CustomMessageBox mb = new CustomMessageBox()
{
Caption = "test",
Message = "message",
Content = grid,
LeftButtonContent = "ok",
RightButtonContent = "cancel"
};
mb.Dismissed += (e1, e2) =>
{
//how to get textbox text ?
};
mb.Show();
I want to retrieve the textbox content, how can I do that ?
Thanxs
Solution
You already have a reference to the TextBox, so where is the issue?
mb.Dismissed += (e1, e2) =>
{
System.Diagnostics.Debug.WriteLine(tbName.Text);
};