开发者

Strange CommandParameter with View.CurrentItem

开发者 https://www.devze.com 2023-03-12 02:58 出处:网络
I have in ViewModel a collection, with ICollect开发者_如何学JAVAionView view; Well, in XAML I have

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/}"
0

精彩评论

暂无评论...
验证码 换一张
取 消