Пример #1
0
        public GuitarListViewModel()
        {
            GetAllGuitars();

            _editedGuitar   = new GuitarViewModel(Blogic.NewGuitar());
            _selectedGuitar = new GuitarViewModel(Blogic.NewGuitar());
            _addedGuitar    = new GuitarViewModel(Blogic.NewGuitar());
            _addedGuitar.Validate();
            _view = (ListCollectionView)CollectionViewSource.GetDefaultView(Guitars);
            _addNewGuiatCommand  = new RelayCommand(param => this.AddNewGuitar(), param => this.CanAddNewGuitar());
            _deleteGuitarCommand = new RelayCommand(param => this.DeleteGuitar());
            _editGuitarCommand   = new RelayCommand(param => this.EditGuitar(), param => this.CanEditGuitar());
        }