452573a11bf8fe0f1062dad28b9c2e7876bf74f1
1
module ParasitemiaUI.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 win = Views.AboutWindow()
15 win.Left <- (if parent
.WindowState = WindowState.Maximized then 0. else parent.Left) + parent.ActualWidth / 2. - win.Width / 2.
16 win.Top <- (if parent.WindowState = WindowState.Maximized then 0. else parent.Top) + parent.ActualHeight / 2. - win.Height / 2.
18 let version = System.Reflection.Assembly.GetEntryAssembly().GetName().Version
19 let txtVersion = sprintf
" %d.%d.%d" version.Major version.Minor version.Revision
20 win.txtAbout
.Inlines.FirstInline.ElementEnd.InsertTextInRun(txtVersion)
22 let navigateTo = Navigation.RequestNavigateEventHandler(fun obj args
->
23 Process.Start(ProcessStartInfo(args
.Uri.AbsoluteUri)) |> ignore
26 win.linkHESSO
.RequestNavigate.AddHandler(navigateTo);
27 win.linkCHUV
.RequestNavigate.AddHandler(navigateTo);
28 win.linkGBurri
.RequestNavigate.AddHandler(navigateTo);
31 win.txtAbout
.Inlines.FirstInline.ElementEnd.InsertTextInRun(" - DEBUG")
34 win.butClose
.Click.AddHandler(fun obj args
-> win.Close())
36 win.ShowDialog() |> ignore