AdministrationWindow: Fix default value handling
This commit is contained in:
@ -203,5 +203,21 @@ namespace Elwig.Helpers {
|
||||
public static void SelectCheckComboBoxItems(Xceed.Wpf.Toolkit.CheckComboBox ccb, IEnumerable<object>? items, Func<object?, object?> getId) {
|
||||
SelectCheckComboBoxItems(ccb, getId, items?.Select(i => getId(i)));
|
||||
}
|
||||
|
||||
public static object? GetInputValue(Control input) {
|
||||
if (input is TextBox tb) {
|
||||
return tb.Text;
|
||||
} else if (input is ComboBox sb) {
|
||||
return sb.SelectedItem;
|
||||
} else if (input is Xceed.Wpf.Toolkit.CheckComboBox ccb) {
|
||||
return ccb.SelectedItems.Cast<object>().ToArray();
|
||||
} else if (input is CheckBox cb) {
|
||||
return cb.IsChecked;
|
||||
} else if (input is RadioButton rb) {
|
||||
return rb.IsChecked;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user