Hi , I am Using XamDataGrid In which I have Image column which is binded to a command using attached property(ImageClickEvent), my attach property class contains method
private static void OnImageSeltected(DependencyObject d, DependencyPropertyChangedEventArgs e) { }
which doesnt get executed
I have binded image in following manner
<Image local:ImageClickEvent.SelectedImage="{Binding ImageSelector,RelativeSource={RelativeSource AncestorType={x:Type Window}}}" Source="Images\shuffle_up.png" />
I have attached the sample as well. Could you please let me know where i am going wrong.
Thanks
Prashant Chavan
Hi Prashant,
The binding is slightly wrong. The binding is going up to the Window and looking for an ImageSelector property on the Window. The ImageSelector property, however, is inside the view model so change it to look like this: "{Binding DataContext.ImageSelector, ..."
Let me know if you have any further questions on this.