public HandphoneSearchVM() { ListPhoto = new List <Photo>(); ListPhotoView = (CollectionView)CollectionViewSource.GetDefaultView(ListPhoto); StorageView = (CollectionView)CollectionViewSource.GetDefaultView(dal.Storages); MemoryView = (CollectionView)CollectionViewSource.GetDefaultView(dal.Rams); CameraBackView = (CollectionView)CollectionViewSource.GetDefaultView(dal.CamBacks); CameraFrontView = (CollectionView)CollectionViewSource.GetDefaultView(dal.CamFronts); OsView = (CollectionView)CollectionViewSource.GetDefaultView(dal.OSs); ProducentView = (CollectionView)CollectionViewSource.GetDefaultView(pr.GetData()); Source = new ObservableCollection <handphone>(); SourceView = (CollectionView)CollectionViewSource.GetDefaultView(this.Source); SearchCommand = new CommandHandler { CanExecuteAction = SearchValiation, ExecuteAction = x => SearchAction() }; Alternatives = new List <AlternativeHandPhone>(); Datas = handphoneCollection.GetData(); collection = (CollectionView)CollectionViewSource.GetDefaultView(Datas); collection.Filter = colFilter; }
public LaptopVM() { ListPhoto = new List <Photo>(); ListPhotoView = (CollectionView)CollectionViewSource.GetDefaultView(ListPhoto); AddCommand = new CommandHandler { CanExecuteAction = addCommandvalidation, ExecuteAction = addCommandAction }; EditCommand = new CommandHandler { CanExecuteAction = editCommandValidation, ExecuteAction = editCommandAction }; DeleteCommand = new CommandHandler { CanExecuteAction = deleteCommandValidation, ExecuteAction = deleteCommandAction }; Source = new ObservableCollection <computer>(data.GetData()); SourceView = (CollectionView)CollectionViewSource.GetDefaultView(Source); AddPhoto = new CommandHandler { CanExecuteAction = x => SelectedItem != null, ExecuteAction = AddPhotoAction }; }