コード例 #1
0
        public async void Initialize(IServicePool servicePool)
        {
            _sessionService = servicePool.GetService <ISessionService>();

            this.AddCommand          = new DelegateCommand(p => true, this.ExecuteAddCommand);
            this.DeleteCommand       = new DelegateCommand(p => true, this.ExecuteDeleteCommand);
            this.CancelDeleteCommand = new DelegateCommand(p => true, this.ExecuteCancelDeleteCommand);
            this.IsBusy = true;

            _sessionList = await _sessionService.GetSessionListAsync();

            _sessionList.Insert(0, new SessionDto {
                Title = ""
            });
            this.SessionsView = new ListCollectionView(_sessionList);

            this.Slots = await _sessionService.AllSlotsAsync();

            this.SlotsView = new ListCollectionView(this.Slots);
            foreach (var item in this.Slots)
            {
                item.PropertyChanged += this.OnScheduleItemPropertyChanged;
            }
            this.IsBusy    = false;
            this.ErrorText = "Mindestens eine Session wurde mehrfach zugewiesen!";
        }
コード例 #2
0
        public async void Initialize(IServicePool servicePool)
        {
            _sessionService = servicePool.GetService <ISessionService>();

            this.AddCommand          = new DelegateCommand(p => !this.IsBusy, this.ExecuteAddCommand);
            this.EditCommand         = new DelegateCommand(p => !this.IsBusy, this.ExecuteEditCommand);
            this.OkCommand           = new DelegateCommand(p => !this.IsBusy, this.ExecuteOkCommand);
            this.CancelEditCommand   = new DelegateCommand(p => !this.IsBusy, this.ExecuteCancelEditCommand);
            this.DeleteCommand       = new DelegateCommand(p => !this.IsBusy, this.ExecuteDeleteCommand);
            this.CancelDeleteCommand = new DelegateCommand(p => !this.IsBusy, this.ExecuteCancelDeleteCommand);
            this.IsBusy = true;

            _speakerList = await _sessionService.GetSpeakerListAsync();

            _speakerList.Insert(0, new Speaker {
                Id = 0, Name = " "
            });
            this.SpeakersView = new ListCollectionView(_speakerList);

            var trackList = await _sessionService.GetTrackListAsync();

            _uiTrackList = new List <UITrack>();
            foreach (var track in trackList)
            {
                var uiTrack = new UITrack(track);
                _uiTrackList.Add(uiTrack);
                uiTrack.PropertyChanged += this.OnUITrackPropertyChanged;
            }
            this.TracksView = new ListCollectionView(_uiTrackList);

            var sessionTypeList = await _sessionService.GetSessionTypesAsync();

            this.SessionTypesView = new ListCollectionView(sessionTypeList);

            this.Sessions = await _sessionService.GetSessionListAsync();

            this.SessionsView = new ListCollectionView(this.Sessions);
            this.SessionsView.CurrentChanged  += this.OnCurrentSessionChanged;
            this.SessionsView.CurrentChanging += this.OnCurrentSessionChanging;
            _editView = this.SessionsView as IEditableCollectionViewAddNewItem;

            if (this.SessionsView.CurrentItem != null)
            {
                this.SetCurrentSession(this.SessionsView.CurrentItem as SessionDto);
            }

            this.IsBusy = false;
        }
コード例 #3
0
        public async void Initialize(IServicePool servicePool)
        {
            _sessionService = servicePool.GetService<ISessionService>();
            _sessionService.RatingUpdated += this.OnRatingUpdated;
            this.AddCommand = new DelegateCommand(p => !this.IsBusy, this.ExecuteAddCommand);
            this.DeleteCommand = new DelegateCommand(p => !this.IsBusy, this.ExecuteDeleteCommand);
            this.CancelDeleteCommand = new DelegateCommand(p => !this.IsBusy, this.ExecuteCancelDeleteCommand);
            this.IsBusy = true;

            this.Ratings = await _sessionService.GetRatingListAsync();
            this.RatingsView = new ListCollectionView(this.Ratings);

            var sessions = await _sessionService.GetSessionListAsync();
            this.SessionsView = new ListCollectionView(sessions);
            this.SessionsView.CurrentChanged += this.OnCurrentSessionChanged;

            this.OnCurrentSessionChanged(null, EventArgs.Empty);
            this.IsBusy = false;
        }
コード例 #4
0
        public async void Initialize(IServicePool servicePool)
        {
            _sessionService = servicePool.GetService <ISessionService>();
            _sessionService.RatingUpdated += this.OnRatingUpdated;
            this.AddCommand          = new DelegateCommand(p => !this.IsBusy, this.ExecuteAddCommand);
            this.DeleteCommand       = new DelegateCommand(p => !this.IsBusy, this.ExecuteDeleteCommand);
            this.CancelDeleteCommand = new DelegateCommand(p => !this.IsBusy, this.ExecuteCancelDeleteCommand);
            this.IsBusy = true;

            this.Ratings = await _sessionService.GetRatingListAsync();

            this.RatingsView = new ListCollectionView(this.Ratings);

            var sessions = await _sessionService.GetSessionListAsync();

            this.SessionsView = new ListCollectionView(sessions);
            this.SessionsView.CurrentChanged += this.OnCurrentSessionChanged;

            this.OnCurrentSessionChanged(null, EventArgs.Empty);
            this.IsBusy = false;
        }
コード例 #5
0
        public async void Initialize(IServicePool servicePool)
        {
            _sessionService = servicePool.GetService<ISessionService>();

            this.AddCommand = new DelegateCommand(p => !this.IsBusy, this.ExecuteAddCommand);
            this.EditCommand = new DelegateCommand(p => !this.IsBusy, this.ExecuteEditCommand);
            this.OkCommand = new DelegateCommand(p => !this.IsBusy, this.ExecuteOkCommand);
            this.CancelEditCommand = new DelegateCommand(p => !this.IsBusy, this.ExecuteCancelEditCommand);
            this.DeleteCommand = new DelegateCommand(p => !this.IsBusy, this.ExecuteDeleteCommand);
            this.CancelDeleteCommand = new DelegateCommand(p => !this.IsBusy, this.ExecuteCancelDeleteCommand);
            this.IsBusy = true;

            this.Speakers = await _sessionService.GetSpeakerListAsync();
            this.SpeakersView = new ListCollectionView(this.Speakers);
            this.SpeakersView.CurrentChanging += this.OnCurrentSpeakerChanging;
            this.SpeakersView.CurrentChanged += this.OnCurrentSpeakerChanged;
            _editView = this.SpeakersView as IEditableCollectionViewAddNewItem;
            this.OnCurrentSpeakerChanged(null, EventArgs.Empty);

            this.IsBusy = false;
        }
コード例 #6
0
        public async void Initialize(IServicePool servicePool)
        {
            _sessionService = servicePool.GetService<ISessionService>();

            this.AddCommand = new DelegateCommand(p => !this.IsBusy, this.ExecuteAddCommand);
            this.EditCommand = new DelegateCommand(p => !this.IsBusy, this.ExecuteEditCommand);
            this.OkCommand = new DelegateCommand(p => !this.IsBusy, this.ExecuteOkCommand);
            this.CancelEditCommand = new DelegateCommand(p => !this.IsBusy, this.ExecuteCancelEditCommand);
            this.DeleteCommand = new DelegateCommand(p => !this.IsBusy, this.ExecuteDeleteCommand);
            this.CancelDeleteCommand = new DelegateCommand(p => !this.IsBusy, this.ExecuteCancelDeleteCommand);
            this.IsBusy = true;

            _speakerList = await _sessionService.GetSpeakerListAsync();
            _speakerList.Insert(0, new Speaker { Id = 0, Name = " " });
            this.SpeakersView = new ListCollectionView(_speakerList);

            var trackList = await _sessionService.GetTrackListAsync();
            _uiTrackList = new List<UITrack>();
            foreach (var track in trackList)
            {
                var uiTrack = new UITrack(track);
                _uiTrackList.Add(uiTrack);
                uiTrack.PropertyChanged += this.OnUITrackPropertyChanged;
            }
            this.TracksView = new ListCollectionView(_uiTrackList);

            var sessionTypeList = await _sessionService.GetSessionTypesAsync();
            this.SessionTypesView = new ListCollectionView(sessionTypeList);

            this.Sessions = await _sessionService.GetSessionListAsync();
            this.SessionsView = new ListCollectionView(this.Sessions);
            this.SessionsView.CurrentChanged += this.OnCurrentSessionChanged;
            this.SessionsView.CurrentChanging += this.OnCurrentSessionChanging;
            _editView = this.SessionsView as IEditableCollectionViewAddNewItem;

            if (this.SessionsView.CurrentItem != null)
                this.SetCurrentSession(this.SessionsView.CurrentItem as SessionDto);

            this.IsBusy = false;
        }
コード例 #7
0
        public async void Initialize(IServicePool servicePool)
        {
            _sessionService = servicePool.GetService<ISessionService>();

            this.AddCommand = new DelegateCommand(p => true, this.ExecuteAddCommand);
            this.DeleteCommand = new DelegateCommand(p => true, this.ExecuteDeleteCommand);
            this.CancelDeleteCommand = new DelegateCommand(p => true, this.ExecuteCancelDeleteCommand);
            this.IsBusy = true;

            _sessionList = await _sessionService.GetSessionListAsync();
            _sessionList.Insert(0, new SessionDto { Title = "" });
            this.SessionsView = new ListCollectionView(_sessionList);

            this.Slots = await _sessionService.AllSlotsAsync();
            this.SlotsView = new ListCollectionView(this.Slots);
            foreach (var item in this.Slots)
            {
                item.PropertyChanged += this.OnScheduleItemPropertyChanged;
            }
            this.IsBusy = false;
            this.ErrorText = "Mindestens eine Session wurde mehrfach zugewiesen!";
        }
コード例 #8
0
        public async void Initialize(IServicePool servicePool)
        {
            _sessionService = servicePool.GetService <ISessionService>();

            this.AddCommand          = new DelegateCommand(p => !this.IsBusy, this.ExecuteAddCommand);
            this.EditCommand         = new DelegateCommand(p => !this.IsBusy, this.ExecuteEditCommand);
            this.OkCommand           = new DelegateCommand(p => !this.IsBusy, this.ExecuteOkCommand);
            this.CancelEditCommand   = new DelegateCommand(p => !this.IsBusy, this.ExecuteCancelEditCommand);
            this.DeleteCommand       = new DelegateCommand(p => !this.IsBusy, this.ExecuteDeleteCommand);
            this.CancelDeleteCommand = new DelegateCommand(p => !this.IsBusy, this.ExecuteCancelDeleteCommand);
            this.IsBusy = true;

            this.Speakers = await _sessionService.GetSpeakerListAsync();

            this.SpeakersView = new ListCollectionView(this.Speakers);
            this.SpeakersView.CurrentChanging += this.OnCurrentSpeakerChanging;
            this.SpeakersView.CurrentChanged  += this.OnCurrentSpeakerChanged;
            _editView = this.SpeakersView as IEditableCollectionViewAddNewItem;
            this.OnCurrentSpeakerChanged(null, EventArgs.Empty);

            this.IsBusy = false;
        }
コード例 #9
0
        public async void Initialize(IServicePool pool)
        {
            _isInititializing = true;
            this.State = "ReadOnly";

            if (Application.Current != null &&
                Application.Current.MainWindow != null &&
                !DesignerProperties.GetIsInDesignMode(Application.Current.MainWindow))
            {
                _speakerService = pool.GetService<ISpeakersService>();
                this.SaveCommand = new DelegateCommand(this.CanExecuteSaveCommand, this.ExecuteSaveCommand);
                var list = await _speakerService.GetSpeakerListAsync();
                this.SpeakerList = new ObservableCollection<SpeakerDto>(list);
                this.CurrentSpeaker = this.SpeakerList[0];
                this.SpeakerListView = new ListCollectionView(this.SpeakerList);
                this.SpeakerListView.CurrentChanged += SpeakerListView_CurrentChanged;
                this.SpeakerListView.MoveCurrentTo(this.SpeakerList[1]);
                //this.SpeakerListView.Filter = item => ((Speaker)item).FirstName.StartsWith("C");
                _speakerEditView = this.SpeakerListView as IEditableCollectionView;
            }

            _isInititializing = false;
        }