public void SetNavCommands(IEnumerable <BindableCommand> navCommands) { this._viewNavPanel.SuspendLayout(); this._viewNavPanel.Controls.Clear(); if (navCommands == null) { return; } using (Graphics g = CreateGraphics()) { foreach (BindableCommand command in navCommands.Reverse()) { Panel spacer = new Panel() { Height = 1, Dock = DockStyle.Top, BackColor = this.BackColor }; this._viewNavPanel.Controls.Add(spacer); Button newButton = new NavigationButton(); newButton.Dock = System.Windows.Forms.DockStyle.Top; this._viewNavPanel.Controls.Add(newButton); command.BindTo(newButton); } } this._viewNavPanel.ResumeLayout(); }
public void SetNavCommands(IEnumerable<BindableCommand> navCommands) { this._viewNavPanel.SuspendLayout(); this._viewNavPanel.Controls.Clear(); if (navCommands == null) { return; } using (Graphics g = CreateGraphics()) { foreach (BindableCommand command in navCommands.Reverse()) { Panel spacer = new Panel() { Height = 1, Dock = DockStyle.Top, BackColor = this.BackColor }; this._viewNavPanel.Controls.Add(spacer); Button newButton = new NavigationButton(); newButton.Dock = System.Windows.Forms.DockStyle.Top; this._viewNavPanel.Controls.Add(newButton); command.BindTo(newButton); } } this._viewNavPanel.ResumeLayout(); }