Method wpfBuilder.End
Overload
Ends adding controls etc to the window or nested panel (wpfBuilder.StartGrid etc).
public wpfBuilder End()
Returns
Remarks
Always call this method to end a nested panel. For root panel it is optional if using wpfBuilder.ShowDialog.
You can use code like using (b.R.StartGrid()) { /*auto-indented code*/ } //don't need b.End(). However then control variables must be declared outside (in most cases).
Examples
var b = new wpfBuilder("Window"); //creates the outermost grid panel
b.WinSize(400);
b.R.Add("Text", out TextBox _);
CheckBox c1, c2, c3, c4;
b.StartGrid();
b.R.Panel.Background = Brushes.Aqua;
b.R.Add(out c1, "Check1");
b.R.Add(out c2, "Check2");
b.End(); //end the grid panel
//the same with `using` block
using (b.R.StartGrid()) {
b.R.Panel.Background = Brushes.PaleGreen;
b.R.Add(out c3, "Check3");
b.R.Add(out c4, "Check4");
} //end the grid panel (don't need b.End();)
b.End(); //finally end the outermost grid panel added by the constructor. This is optional.
if (!b.ShowDialog()) return;