From 5f18dab31987b2608d30c943f9248b45f757765b Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Sat, 21 Mar 2020 07:03:12 -0400 Subject: [PATCH] handle the CustomOptionFieldChoice now that we have a working ComboBox control in UWT --- .../Dialogs/CustomOptionsDialog.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CSharp/Libraries/UniversalEditor.UserInterface/Dialogs/CustomOptionsDialog.cs b/CSharp/Libraries/UniversalEditor.UserInterface/Dialogs/CustomOptionsDialog.cs index 1cc47c47..43049179 100644 --- a/CSharp/Libraries/UniversalEditor.UserInterface/Dialogs/CustomOptionsDialog.cs +++ b/CSharp/Libraries/UniversalEditor.UserInterface/Dialogs/CustomOptionsDialog.cs @@ -92,7 +92,9 @@ namespace UniversalEditor.UserInterface.Dialogs DefaultTreeModel tm = new DefaultTreeModel(new Type[] { typeof(string) }); foreach (CustomOptionFieldChoice choice in option.Choices) { - tm.Rows.Add(new TreeModelRow(new TreeModelRowColumn[] { new TreeModelRowColumn(tm.Columns[0], choice) })); + TreeModelRow row = new TreeModelRow(new TreeModelRowColumn[] { new TreeModelRowColumn(tm.Columns[0], choice) }); + row.SetExtraData("choice", choice); + tm.Rows.Add(row); } cbo.Model = tm; // cbo.Dock = DockStyle.Fill; @@ -282,13 +284,11 @@ namespace UniversalEditor.UserInterface.Dialogs CheckBox itm = (ctl as CheckBox); (eo as CustomOptionBoolean).Value = itm.Checked; } - /* else if (ctl is ComboBox) { - CustomOptionFieldChoice choice = ((ctl as ComboBox).SelectedItem as CustomOptionFieldChoice); + CustomOptionFieldChoice choice = (ctl as ComboBox).SelectedItem.GetExtraData("choice"); (eo as CustomOptionChoice).Value = choice; } - */ else if (ctl is TextBox) { TextBox itm = (ctl as TextBox);