module ParasitemiaUI.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
+open ParasitemiaUIControls
+
let showWindow (parent : Window) =
- let win = Views.AboutWindow()
+ let win = AboutWindow ()
win.Owner <- parent
win.Left <- (if parent.WindowState = WindowState.Maximized then 0. else parent.Left) + parent.ActualWidth / 2. - win.Width / 2.
let version = System.Reflection.Assembly.GetEntryAssembly().GetName().Version
let txtVersion = sprintf " %d.%d.%d" version.Major version.Minor version.Revision
- win.txtAbout.Inlines.FirstInline.ElementEnd.InsertTextInRun(txtVersion)
+ win.txtAbout.Inlines.FirstInline.ElementEnd.InsertTextInRun txtVersion
- let navigateTo = Navigation.RequestNavigateEventHandler(fun obj args ->
- Process.Start(ProcessStartInfo(args.Uri.AbsoluteUri)) |> ignore
- args.Handled <- true)
+ let navigateTo =
+ Navigation.RequestNavigateEventHandler (
+ fun obj args ->
+ Process.Start (ProcessStartInfo (args.Uri.AbsoluteUri, UseShellExecute = true)) |> ignore
+ args.Handled <- true
+ )
- win.linkHESSO.RequestNavigate.AddHandler(navigateTo);
- win.linkCHUV.RequestNavigate.AddHandler(navigateTo);
- win.linkGBurri.RequestNavigate.AddHandler(navigateTo);
+ win.linkHESSO.RequestNavigate.AddHandler navigateTo;
+ win.linkCHUV.RequestNavigate.AddHandler navigateTo;
+ win.linkGBurri.RequestNavigate.AddHandler navigateTo;
#if DEBUG
- win.txtAbout.Inlines.FirstInline.ElementEnd.InsertTextInRun(" - DEBUG")
+ win.txtAbout.Inlines.FirstInline.ElementEnd.InsertTextInRun " - DEBUG"
#endif
- win.butClose.Click.AddHandler(fun obj args -> win.Close())
+ win.butClose.Click.AddHandler (fun obj args -> win.Close ())
- win.ShowDialog() |> ignore
+ win.ShowDialog () |> ignore