FIX #277
[master-thesis.git] / Parasitemia / ParasitemiaUI / CommandLineArguments.fs
diff --git a/Parasitemia/ParasitemiaUI/CommandLineArguments.fs b/Parasitemia/ParasitemiaUI/CommandLineArguments.fs
new file mode 100644 (file)
index 0000000..8025ebf
--- /dev/null
@@ -0,0 +1,20 @@
+module ParasitemiaUI.CommandLineArguments
+
+open System
+open System.Windows
+open System.Windows.Controls
+open System.Diagnostics
+
+let showWindow (parent : Window) =
+    let win = Views.CommandLineArgumentsWindow ()
+    win.Owner <- parent
+
+    win.Left <- (if parent.WindowState = WindowState.Maximized then 0. else parent.Left) + parent.ActualWidth / 2. - win.Width / 2.
+    win.Top <- (if parent.WindowState = WindowState.Maximized then 0. else parent.Top) + parent.ActualHeight / 2. - win.Height / 2.
+
+    win.txtCommandLineArguments.Text <- Utils.argsHelp
+
+    win.butClose.Click.AddHandler (fun obj args -> win.Close ())
+
+    win.ShowDialog () |> ignore
+