main
1using System;
2using System.Windows;
3using System.Windows.Controls;
4using System.Windows.Input;
5using solidware.financials.windows.ui.presenters;
6using solidware.financials.windows.ui.views.icons;
7
8namespace solidware.financials.windows.ui.views.controls
9{
10 public partial class ButtonBar : View<ButtonBarPresenter>
11 {
12 public ButtonBar()
13 {
14 InitializeComponent();
15 }
16
17 public void AddCommand(string text, Action action, UIIcon icon)
18 {
19 AddCommand(text, new SimpleCommand(action), icon);
20 }
21
22 public void AddCommand(string text, ICommand command, UIIcon icon)
23 {
24 DockPanel.Add<Button>(x =>
25 {
26 x.ToIconButton(icon, command).Text(text);
27 x.VerticalAlignment = VerticalAlignment.Stretch;
28 x.HorizontalAlignment = HorizontalAlignment.Right;
29 });
30 }
31 }
32}