I have created a sample using mvvm , i want to write code on selection changed event of the xamcomboeditor , could you please let me know how i can do this , I have attached my sample application ,in which i have attached the event which is handled in xaml.cs , but i want to handle it in viewmodel, could you please look at the code and suggest changes i can do to achieve this.
Thanks
Prashant C
Hello Prashant,
Thank you for your post.
I have been looking into this, and being that your XamComboEditor is in an EditorStyle for one of your fields, I would recommend that you write an attached property to handle the SelectedItemChanged event. This attached property can be of any type, you simply need to handle the property changed event on it. Since the object that this attached property will be placed on is the XamComboEditor, the sender/dependency object in the property changed handler will be the XamComboEditor, and you can hook into the SelectedItemChanged event that way.
I have attached a modified version of the sample you sent to demonstrate the above.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
Thanks Andrew Goldenbaum, It works, Actually i am binding command , but is there a way to pass command paramter similarly.
Prashant Chavan
You can use this with commands as well. The AttachedProperty type that I had provided to you in my original response was for a bool property, but if you were to make it an ICommand instead, you could pass the command to the AttachedProperty. Then, using the static GetMyAttachedProperty method, you can retrieve that command and call Execute(parameter) on it in the SelectedItemChanged event for the XamComboEditor.
Just checking in, did you have any other questions or concerns on this matter?