bc8f3e5b102172afa80c5bc64c7bf40feafe7505
1
module Parasitemia.GUI.About
5 open System.Windows.Media
6 open System.Windows.Markup
7 open System.Windows.Shapes
8 open System.Windows.Controls
9 open System.Diagnostics
11 let showWindow (parent
: Window) =
12 let window = Views.AboutWindow()
13 window.Root.Owner <- parent
14 window.Root.Left <- parent
.Left + parent
.ActualWidth / 2. - window.Root.Width / 2.
15 window.Root.Top <- parent
.Top + parent
.ActualHeight / 2. - window.Root.Height / 2.
17 let ctrl (name
: string): 'a = window.Root.FindName(name) :?> 'a
19 let butClose: Button = ctrl "butClose"
20 let txtAbout: TextBlock = ctrl "txtAbout"
22 let version = System.Reflection.Assembly.GetEntryAssembly().GetName().Version
23 let txtVersion = sprintf
"%d.%d.%d" version.Major version.Minor version.Revision
24 txtAbout.Inlines.FirstInline.ElementEnd.InsertTextInRun(txtVersion)
27 txtAbout.Inlines.FirstInline.ElementEnd.InsertTextInRun(" - DEBUG")
30 butClose.Click.AddHandler(fun obj args
-> window.Root.Close())
32 window.Root.ShowDialog() |> ignore