I am tying to bind a list of custom objects as a source to listbox where my listbox has user template as
<DataTemplate x:Key="UserTemplate1" >
<StackPanel Orientation="Horizontal">
<TextBlock Name="vmname" Text="{Binding }" Width="100"/>
<CheckBox Name="cb" IsChecked="{Binding ischeck}"/>
</StackPanel>
</DataTemplate>
and I used this template as datatype for listbox
<ListBox Name="listbox3" Visibility="Hidden" Height="134" Width="156" Margin="515,82,62,104" IsSynchronizedWithCurrentItem="True" ItemTemplate="{StaticResource UserTemplate1}" />
I have list of objects of custom datatype
class item{
string name;
bool val;
}
I am not able to bind this list to listbox. i want to bind list in such a way that whenever change is made to checkbox in list, they should reflect in list of objects(item).
listbox3.itemsource = list_items
This does not work for me
Here, I am not able to bind listbox3 to the list of objects of class checkvm.