【发布时间】:2011-06-13 13:06:51
【问题描述】:
我已经四处寻找——找不到合适的收藏
这是我想要的 ViewModel 的签名。有一些有趣的 Codeplex 上的 David Hill 的 CollectionViewModel 或 ObservableDictionary(Of TKey, TValue) 的替代品。但是现在,我想要一个内置的集合(用于 SL4)来处理这个问题。谢谢
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;}
【问题讨论】:
标签: mvvm silverlight-4.0 mvvm-light