X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=Parasitemia%2FParasitemiaUI%2FUtils.fs;h=a536853b1ea9046336a59dc6e3914a5917323407;hb=24bfd2ea10b5945100168ad5a1b2545e43d05569;hp=4dcb7d44e8f4f648fdff213ba4310317ab7ae071;hpb=cd9c55f80bcdc4fc6b85eb1b81474aed005e5016;p=master-thesis.git diff --git a/Parasitemia/ParasitemiaUI/Utils.fs b/Parasitemia/ParasitemiaUI/Utils.fs index 4dcb7d4..a536853 100644 --- a/Parasitemia/ParasitemiaUI/Utils.fs +++ b/Parasitemia/ParasitemiaUI/Utils.fs @@ -103,4 +103,19 @@ let argsHelp = "Interactive mode:\n" + (sprintf " %s [] [--debug]\n" programName) + " : a PIAZ file to automatically open at startup\n" + - " --debug : output information like intermediate images in the current directory (it takes more CPU and memory)" \ No newline at end of file + " --debug : output information like intermediate images in the current directory (it takes more CPU and memory)" + +open System +open System.Windows + +// Inspired by https://github.com/fsprojects/FSharp.ViewModule/blob/master/src/FSharp.ViewModule/FunCommand.fs +type FunCommand (execute : obj -> unit, canExecute : obj -> bool) = + let canExecuteChanged = Event () + + interface Input.ICommand with + [] + member this.CanExecuteChanged = canExecuteChanged.Publish + + member this.CanExecute (param : obj) = canExecute param + + member this.Execute (param : obj) = execute param \ No newline at end of file