Don't know, here works well.
----
The code can be simplified.
And can validate.
----
The code can be simplified.
C# code:
// script ""
using System.Windows.Controls;
var b = new wpfBuilder("Window");
b.Options(rightAlignLabels: true);
b.Add("PTP Domain", out TextBox ptpDomain).Tooltip("Integer between 0 and 127");
b.Add("Delay Request", out ComboBox ptpDelayReq).Items("Multicast|Unicast");
b.Add("Control Multicast Address:Port", out TextBox controlMC).Tooltip("Port must 49999");
b.R.AddOkCancel();
if (!b.ShowDialog()) return;
And can validate.
C# code:
// script ""
using System.Windows.Controls;
var b = new wpfBuilder("Window");
b.Options(rightAlignLabels: true);
b.Add("PTP Domain", out TextBox ptpDomain)
.Tooltip("Integer between 0 and 127")
.Validation(_ => ptpDomain.Text.ToInt(out int i1) && i1 is >= 0 and <= 127 ? null : "Domain must be integer between 0 and 127");
b.Add("Delay Request", out ComboBox ptpDelayReq).Items("Multicast|Unicast");
b.Add("Control Multicast Address:Port", out TextBox controlMC)
.Tooltip("Port must 49999")
.Validation(_ => controlMC.Text.ToInt() is 49999 ? null : "Port must be 49999");
b.R.AddOkCancel();
if (!b.ShowDialog()) return;