To .NET 5 (lot of refactoring)
[master-thesis.git] / Parasitemia / ParasitemiaUI / DPICalculator.fs
index 2cdc184..697bbef 100644 (file)
@@ -2,19 +2,15 @@
 
 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
 open ParasitemiaCore.Types
 open ParasitemiaCore.UnitsOfMeasure
 
 open Types
 
 let showWindow (parent : Window) : int option =
-    let win = Views.PPICalculatorWindow ()
+    let win = PPICalculatorWindow ()
     win.Owner <- parent
     win.Left <- parent.Left + parent.ActualWidth / 2. - win.Width / 2.
     win.Top <- parent.Top + parent.ActualHeight / 2. - win.Height / 2.
@@ -30,7 +26,7 @@ let showWindow (parent : Window) : int option =
         let { w = w; h = h } = win.cmbSensorSize.SelectedValue :?> SensorSize
         let ratio = h / w
 
-        let parseDouble txt errorMess = match Double.TryParse (txt) with true, value -> Success value | _ -> Fail errorMess
+        let parseDouble (txt : string) (errorMess : string) = match Double.TryParse (txt) with true, value -> Success value | _ -> Fail errorMess
 
         match
             (result {