14 public static Button Button(Container container, String label, RoutedEventHandler e) |
14 public static Button Button(Container container, String label, RoutedEventHandler e) |
15 { |
15 { |
16 return Application.GetInstance().Exec<Button>(() => Controls.CreateButton(container, label, e)); |
16 return Application.GetInstance().Exec<Button>(() => Controls.CreateButton(container, label, e)); |
17 } |
17 } |
18 |
18 |
|
19 public static Label Label(Container container, String label, int alignment) |
|
20 { |
|
21 HorizontalAlignment a; |
|
22 switch(alignment) |
|
23 { |
|
24 case 0: a = HorizontalAlignment.Left; break; |
|
25 case 1: a = HorizontalAlignment.Right; break; |
|
26 case 2: a = HorizontalAlignment.Center; break; |
|
27 default: a = HorizontalAlignment.Left; break; |
|
28 } |
|
29 return Application.GetInstance().Exec<Label>(() => Controls.CreateLabel(container, label, a)); |
|
30 } |
|
31 |
|
32 public static Label Space(Container container) |
|
33 { |
|
34 return Application.GetInstance().Exec<Label>(() => Controls.CreateLabel(container, null, HorizontalAlignment.Center)); |
|
35 } |
|
36 |
19 public static Button CreateButton(Container container, String label, RoutedEventHandler e) |
37 public static Button CreateButton(Container container, String label, RoutedEventHandler e) |
20 { |
38 { |
21 Button button = new Button(); |
39 Button button = new Button(); |
22 button.Content = label; |
40 button.Content = label; |
23 container.Add(button, false); |
41 container.Add(button, false); |