예제 #1
0
        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);
            }
        }
예제 #2
0
        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));
            }
        }
예제 #3
0
 public bool IsViewModelOf(AccessoriesManager manager)
 {
     return(manager == _manager);
 }