Click here to Skip to main content
15,881,455 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a collection List Adapters in my view model. Equivalent to the collection I want to have List.Count() number of radio buttons with their names .and by default I should have Adapters[0] as selected (IsChecked) radio button on launch of the Tool. But later user may change the selection between and based on the selection Submit button should be triggered. List Adapters contains minimum of 1 and maximum of three items.

What I have tried:

Please help since I am new to wpf and not able to create radio buttons dynamically from the View Model's collection by MVVM.
Posted
Updated 18-Dec-20 9:16am
Comments
[no name] 18-Dec-20 8:51am    
The restrictions are only in your mind: MVVM is not "real"; it's a pattern; it's not your "master".

1 solution

I am not sure if I understood your question correctly. It would have been good if you had shared your code.

However in order to generate items dynamically, use ObservableCollection and bind it to radiobutton control in xaml.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900