I am having a StackPanel under which I have to create and add few RadioButtons based on some dynamic data. I don't want to create RadioButton objects in my .cs file which violates the MVVM pattern. So I tried the Observable Collection class for RDOItemCollection. My xaml looks like :-
<StackPanel>
<ItemControl ItemSource ={Binding RDOItemCollection}>
<ItemsControl.ItemTemplate>
<RadioButton Content ={Binding Path = RadioBtnName}">
<ItemsControl.ItemTemplate>
</ItemsCotrol>
</StackPanel>
When I run this WPF application, I don't see the RadioButton contents/text. Is something wrong in my Binding metod. What is the simple way to create and add radiobutton with proper content and checked property which is coming from collection class ?
Please suggest me to implement in MVVM for the dynamic control creation of RadioButtons. Thanks.