private void showPage(Type page, bool validate) { if (!_setupPages.ContainsKey(page)) { throw new KeyNotFoundException(); } //Wenn dies nicht die erste Seite ist, dann if (_currentPage != null) { if (validate && !_currentPage.View.onValidate()) //Benutzereingaben validieren { return; } //Letzte Seite entfernen _currentPage.View.onHide(); _currentPage.View.changePage -= View_changePage; pnlContent.Controls.Remove(_currentPage.View); } _currentPage = _setupPages[page]; _currentPage.Context = _context; _currentPage.View.onShow(); _currentPage.View.changePage += View_changePage; lblTitle.Text = _currentPage.Title; pnlContent.Controls.Add(_currentPage.View); pnlContent.Controls[_currentPage.View.Name].Dock = DockStyle.Fill; btnBack.Enabled = (_currentPage.backwardPage != null); btnNext.Enabled = (_currentPage.forwardPage != null || _currentPage.isLastPage); }
private void showPage(Type page, bool validate) { if (!_setupPages.ContainsKey(page)) throw new KeyNotFoundException(); //Wenn dies nicht die erste Seite ist, dann if (_currentPage != null) { if (validate && !_currentPage.View.onValidate()) //Benutzereingaben validieren return; //Letzte Seite entfernen _currentPage.View.onHide(); _currentPage.View.changePage -= View_changePage; pnlContent.Controls.Remove(_currentPage.View); } _currentPage = _setupPages[page]; _currentPage.Context = _context; _currentPage.View.onShow(); _currentPage.View.changePage += View_changePage; lblTitle.Text = _currentPage.Title; pnlContent.Controls.Add(_currentPage.View); pnlContent.Controls[_currentPage.View.Name].Dock = DockStyle.Fill; btnBack.Enabled = (_currentPage.backwardPage != null); btnNext.Enabled = (_currentPage.forwardPage != null || _currentPage.isLastPage); }