ui/wpf/UIcore/Window.cs

changeset 78
135920fe441b
child 81
5eb765a7a793
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ui/wpf/UIcore/Window.cs	Sat Jan 24 19:14:29 2015 +0100
@@ -0,0 +1,34 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace UI
+{
+    public class MainWindow : Window
+    {
+        private Label label1;
+        
+        public MainWindow(String title)
+        {
+            Title = title;
+            Width = 300;
+            Height = 300;
+            GC.KeepAlive(this); // remove KeepAlive and add the Window to the application
+        }
+
+        public static MainWindow CreateMainWindow(String title)
+        {
+            return Application.GetInstance().Exec<MainWindow>(() => new MainWindow(title));
+        }
+
+        public void ShowWindow()
+        {
+            Application.GetInstance().Exec(() => this.Show());
+        }
+    }
+}

mercurial