I have a listbox and a combobox described the XAML code below and I am trying to populate this listbox and combobox from within IronPython code and not XAML.
How can I populate this lists from within code?
On the list I need multiple columns.
<ComboBox
x:Name="comboBox1"
Grid.Column="0"
Grid.Row="0"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Margin="53,14.223,0,0"
Width="54"
Height="19" />
<ListBox
x:Name="listBox1"
Grid.Column="0"
Grid.Row="0"
VerticalAlignment="Top"
Margin="0,30.223,14.5,0"
Height="368.639" HorizontalAlignment="Right" Width="442.619" />
Using the accepted answer from following SO post: How do I bind to a ListBox in IronPython? I managed to populate and bind the m the combobox and list from Ironpython code.
I will put all the code here in case anyone find himself/herself in the same situation:
First there is the need of change in the XAML for the listbox to specify the binding:
then you need to also bind the listbox content to this template:
I will put also here the entire code that populates the combobox and listbox ssince it is not that big: