-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStep.fs
91 lines (74 loc) · 2.6 KB
/
Step.fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
namespace TranscripterUI.Models
//open System.ComponentModel
open TranscripterUI.ViewModels
type StepProgress =
| Completed
| InProgress
| Upcoming
type Step(num: int, text: string, vm: ViewModelBase, isLast: bool, progress: StepProgress) =
[<Literal>]
let white = "#fff"
[<Literal>]
let backgroundGrey = "#2c2f33"
[<Literal>]
let accent = "#268bd2"
[<Literal>]
let veryLightGrey = "#686f78"
[<Literal>]
let lighterGrey = "#3f4449"
// let event = Event<_, _>()
//
// let mutable progressState = progress
// member this.ProgressState
// with get(): StepProgress = progressState
// and set value =
// progressState <- value
// event.Trigger(this, PropertyChangedEventArgs("ProgressState"))
//
// interface INotifyPropertyChanged with
// [<CLIEvent>]
// member this.PropertyChanged = event.Publish
member val ProgressState = progress with get, set
member val IsNotLast = not isLast
member val Position = num * 2
member val SeparatorIndex = if isLast then 0 else (num * 2) + 1
member val Num = num + 1
member val Index = num
member val Text = text
member val StepViewModel = vm
member val Enabled = true with get, set
member this.IsCompleted =
match this.ProgressState with
| StepProgress.Completed -> true
| StepProgress.InProgress
| StepProgress.Upcoming -> false
member this.IsEnabled =
this.Enabled
&& (match this.ProgressState with
| StepProgress.Completed -> true
| _ -> false)
member this.NumberColour =
match this.ProgressState with
| StepProgress.Completed -> backgroundGrey
| StepProgress.InProgress -> white
| StepProgress.Upcoming -> white
member this.TextColour =
match this.ProgressState with
| StepProgress.Completed -> white
| StepProgress.InProgress -> accent
| StepProgress.Upcoming -> veryLightGrey
member this.BorderColour =
match this.ProgressState with
| StepProgress.Completed -> accent
| StepProgress.InProgress -> accent
| StepProgress.Upcoming -> veryLightGrey
member this.LineColour =
match this.ProgressState with
| StepProgress.Completed -> accent
| StepProgress.InProgress -> lighterGrey
| StepProgress.Upcoming -> lighterGrey
member this.InnerCircleColour =
match this.ProgressState with
| StepProgress.Completed -> accent
| StepProgress.InProgress -> backgroundGrey
| StepProgress.Upcoming -> lighterGrey