public AccessoriesManagerViewModel(AccessoriesManager accessoriesManager) { AddSeatCommand = new DelegateCommand(AddSeat); RemoveSeatCommand = new DelegateCommand <SeatViewModel>(RemoveSeat); AddSpeakerCommand = new DelegateCommand(AddSpeaker); RemoveSpeakerCommand = new DelegateCommand <SpeakerViewModel>(RemoveSpeaker); if (accessoriesManager != null) { LoadFrom(accessoriesManager); } }
override public void LoadFrom(Subsystem accessoriesManager) { _manager = (AccessoriesManager)accessoriesManager; Seats = new ObservableCollection <SeatViewModel>(); foreach (Seat seat in _manager.Seats) { Seats.Add(new SeatViewModel(seat)); } Speakers = new ObservableCollection <SpeakerViewModel>(); foreach (Speaker speaker in _manager.Speakers) { Speakers.Add(new SpeakerViewModel(speaker)); } }
public bool IsViewModelOf(AccessoriesManager manager) { return(manager == _manager); }