public static WrapInTextBox ( this text, System.Windows.Controls.TextBlock box ) : System.Windows.Controls.TextBlock | ||
text | this | The text to be wrapped inside the TextBox. |
box | System.Windows.Controls.TextBlock | The wrapper TextBox. |
return | System.Windows.Controls.TextBlock |
public static TextBlock WrapInTextBox(this string text, TextBlock box)
{
if (text == null)
{
throw new NullReferenceException("Provided string was null");
}
if (box == null)
{
throw new NullReferenceException("Wrapper element was null");
}
box.Text = text;
return box;
}