ui/wpf/UIcore/Window.cs

changeset 78
135920fe441b
child 81
5eb765a7a793
equal deleted inserted replaced
77:bc0ed99e49c7 78:135920fe441b
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5 using System.Threading;
6 using System.Threading.Tasks;
7 using System.Windows;
8 using System.Windows.Controls;
9
10 namespace UI
11 {
12 public class MainWindow : Window
13 {
14 private Label label1;
15
16 public MainWindow(String title)
17 {
18 Title = title;
19 Width = 300;
20 Height = 300;
21 GC.KeepAlive(this); // remove KeepAlive and add the Window to the application
22 }
23
24 public static MainWindow CreateMainWindow(String title)
25 {
26 return Application.GetInstance().Exec<MainWindow>(() => new MainWindow(title));
27 }
28
29 public void ShowWindow()
30 {
31 Application.GetInstance().Exec(() => this.Show());
32 }
33 }
34 }

mercurial