X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=Parasitemia%2FParasitemia%2FGUI%2FAbout.fs;fp=Parasitemia%2FParasitemia%2FGUI%2FAbout.fs;h=bc8f3e5b102172afa80c5bc64c7bf40feafe7505;hb=48ecdfc43001c444eff6ad442986049384674af2;hp=0000000000000000000000000000000000000000;hpb=81d1b86719a1ebaf649c1de4c1364603155a53e1;p=master-thesis.git diff --git a/Parasitemia/Parasitemia/GUI/About.fs b/Parasitemia/Parasitemia/GUI/About.fs new file mode 100644 index 0000000..bc8f3e5 --- /dev/null +++ b/Parasitemia/Parasitemia/GUI/About.fs @@ -0,0 +1,33 @@ +module Parasitemia.GUI.About + +open System +open System.Windows +open System.Windows.Media +open System.Windows.Markup +open System.Windows.Shapes +open System.Windows.Controls +open System.Diagnostics + +let showWindow (parent: Window) = + let window = Views.AboutWindow() + window.Root.Owner <- parent + window.Root.Left <- parent.Left + parent.ActualWidth / 2. - window.Root.Width / 2. + window.Root.Top <- parent.Top + parent.ActualHeight / 2. - window.Root.Height / 2. + + let ctrl (name: string): 'a = window.Root.FindName(name) :?> 'a + + let butClose: Button = ctrl "butClose" + let txtAbout: TextBlock = ctrl "txtAbout" + + let version = System.Reflection.Assembly.GetEntryAssembly().GetName().Version + let txtVersion = sprintf "%d.%d.%d" version.Major version.Minor version.Revision + txtAbout.Inlines.FirstInline.ElementEnd.InsertTextInRun(txtVersion) + +#if DEBUG + txtAbout.Inlines.FirstInline.ElementEnd.InsertTextInRun(" - DEBUG") +#endif + + butClose.Click.AddHandler(fun obj args -> window.Root.Close()) + + window.Root.ShowDialog() |> ignore +