What I can suggest you in this case is to pass the Grid which hold the Button as CommandParameter. This way you will have the ViewModel of the Grid as well as the Button which is inside of it (you will to name the Button in this case). The Button in the EditAppointmentDialog ControlTemplate should look like this (I have passed the Grid with name Details
as a parameter):
And the Command in the ViewModel should look like shown below:
private void OnButtonClick(object obj)
// Get the AppointmentDialogViewModel
var grid = obj as Grid;
var vm = grid.DataContext as AppointmentDialogViewModel;
// Do the additional logic here
// Confirm the dialog below
var button = grid.FindName("CustomButton") as RadButton;
Hope this works for you.
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>