我对这个扫描机找到适当的收集方法进行了研究。
Here is the signature of my desired ViewModel. There are some interesting alternatives out there David Hill s CollectionViewModel or ObservableDictionary(Of TKey, TValue) on codeplex. But for now, I would like a built-in collection (for SL4) that handles this. Thanks
public class myViewModel: INotifyPropertyChanged
{
public ObservableCollection<MyDataType> MyCollection;
private ObservableCollection<MyDataType> _myCollection;
public CurrentItem<MyDataType>() { return _myCollection.CurrentItem;}
public int GetCurrentIndex() { return _myCollection.CurrentIndex;}
public SetCurrentIndex(int Index) { _myCollection.CurrentIndex = Index;}