Strange CommandParameter with View.CurrentItem
I have in ViewModel
a collection, with ICollect开发者_如何学JAVAionView view;
Well, in XAML I have
<Button ... Command="cmdDelete" CommandParameter="{Binding view.CurrentItem}" />
But it's strange because the CommandParameter
is not resolved at the time of click. I get some values which don't reflect the CurrentItem
.
Update: View is created as CollectionViewSource.GetDefaultView(observablecollection);
and this collection is bound to the DataGrid.ItemsSource
.
use this:
CommandParameter="{Binding view/}"
精彩评论