|
1 using System; |
|
2 using System.Collections.Generic; |
|
3 using System.Linq; |
|
4 using System.Text; |
|
5 using System.Threading.Tasks; |
|
6 using System.Windows; |
|
7 using System.Windows.Controls; |
|
8 |
|
9 namespace UI |
|
10 { |
|
11 public class Controls |
|
12 { |
|
13 |
|
14 public static Button Button(Container container, String label, RoutedEventHandler e) |
|
15 { |
|
16 return Application.GetInstance().Exec<Button>(() => Controls.CreateButton(container, label, e)); |
|
17 } |
|
18 |
|
19 public static Button CreateButton(Container container, String label, RoutedEventHandler e) |
|
20 { |
|
21 Button button = new Button(); |
|
22 button.Content = label; |
|
23 container.Add(button, false); |
|
24 |
|
25 button.Click += e; |
|
26 |
|
27 return button; |
|
28 } |
|
29 |
|
30 |
|
31 } |
|
32 } |