如何跟踪CollectionView.CurrentPosition

时间:2014-12-19 13:34:46

标签: wpf vb.net

我已经用如此定义的N ICollectionView dependencyProperty构建了一个wpf用户控件;

Public Shared ReadOnly DataIcvProperty As DependencyProperty = DependencyProperty.Register("DataIcv", GetType(ICollectionView), GetType(DataNavigator), New FrameworkPropertyMetadata(Nothing))


<Description("The CollectionView (as an ICollectionView) to be passed to the DataNavigator control"), Category("Navigation Data Source")>
Public Property DataIcv As ICollectionView
    Get
        Return GetValue(DataIcvProperty)
    End Get
    Set(ByVal Value As ICollectionView)
        SetValue(DataIcvProperty, Value)
    End Set
End Property

控件的目的是充当数据导航器。当在mvvm场景中使用时,我可以将它绑定到模型集合视图,并在绑定到同一模型的集合视图的网格上导航记录。但是,如果我主动在网格中选择行(并使用键盘向上和向下箭头移动,而网格中的行选择更改,导航器控件中的当前位置不会更新。您可以看到我的意思的插图here

我认为我需要做的是跟踪DataIcv.CurrentPosition。如何在我的Data Navigator中的代码中执行此操作?

由于

0 个答案:

没有答案
相关问题