File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 2
2
using OpenLoco . Dat . Types ;
3
3
using ReactiveUI ;
4
4
using ReactiveUI . Fody . Helpers ;
5
+ using System ;
5
6
using System . ComponentModel ;
6
7
using System . ComponentModel . DataAnnotations ;
7
8
@@ -29,6 +30,9 @@ public S5HeaderViewModel(S5Header s5Header)
29
30
Checksum = s5Header . Checksum ;
30
31
SourceGame = s5Header . SourceGame ;
31
32
ObjectType = s5Header . ObjectType ;
33
+
34
+ _ = this . WhenAnyValue ( o => o . Checksum )
35
+ . Subscribe ( _ => this . RaisePropertyChanged ( nameof ( ChecksumHex ) ) ) ;
32
36
}
33
37
34
38
[ Reactive , MaxLength ( 8 ) ]
@@ -37,6 +41,9 @@ public S5HeaderViewModel(S5Header s5Header)
37
41
[ Reactive ]
38
42
public uint32_t Checksum { get ; set ; }
39
43
44
+ [ MinLength ( 8 ) , MaxLength ( 8 ) ]
45
+ public string ChecksumHex => string . Format ( $ "{ Checksum : X} ") ;
46
+
40
47
[ Reactive ]
41
48
public SourceGame SourceGame { get ; set ; }
42
49
You can’t perform that action at this time.
0 commit comments