Click here to Skip to main content
15,892,161 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am new to WPF.I wanted to implement selectionChange event of ComboBox in Viewmodel class where combobox is there in Xaml.

I don't need in selection Change event in xaml.cs

Please suggest the better approach.

Thanks,
Prasant
Posted

1 solution

Prasant, for this you have to use ICommand Property inside your viewmodel. And bind this property to your SelectionChanged event in XAML.
Please refer this links -

http://nerobrain.blogspot.in/2012/01/execute-command-on-combobox-selection.html[^]

* You can also use Interaction triggers -

http://www.mindfiresolutions.com/Using-Interaction-Triggers-to-bind-Events-to-View-Modals-2196.php[^]
 
Share this answer
 
v2

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