File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22using OpenLoco . Dat . Types ;
33using ReactiveUI ;
44using ReactiveUI . Fody . Helpers ;
5+ using System ;
56using System . ComponentModel ;
67using System . ComponentModel . DataAnnotations ;
78
@@ -29,6 +30,9 @@ public S5HeaderViewModel(S5Header s5Header)
2930 Checksum = s5Header . Checksum ;
3031 SourceGame = s5Header . SourceGame ;
3132 ObjectType = s5Header . ObjectType ;
33+
34+ _ = this . WhenAnyValue ( o => o . Checksum )
35+ . Subscribe ( _ => this . RaisePropertyChanged ( nameof ( ChecksumHex ) ) ) ;
3236 }
3337
3438 [ Reactive , MaxLength ( 8 ) ]
@@ -37,6 +41,9 @@ public S5HeaderViewModel(S5Header s5Header)
3741 [ Reactive ]
3842 public uint32_t Checksum { get ; set ; }
3943
44+ [ MinLength ( 8 ) , MaxLength ( 8 ) ]
45+ public string ChecksumHex => string . Format ( $ "{ Checksum : X} ") ;
46+
4047 [ Reactive ]
4148 public SourceGame SourceGame { get ; set ; }
4249
You can’t perform that action at this time.
0 commit comments