AdministrationWindow: Fix default value handling
This commit is contained in:
1 parent
1f377483a5
commit
5aa8e45652
5 files changed
+52
-9
No files matched your search
@@ -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