Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ObservableFieldItem.cs
1using CommunityToolkit.Mvvm.ComponentModel;
3
5{
13 public partial class ObservableFieldItem : ObservableObject
14 {
15 private readonly LegalIdentity model;
16 private readonly string key;
17
21 [ObservableProperty]
22 [NotifyPropertyChangedFor(nameof(Value))]
23 private string? overrideValue;
24
28 [ObservableProperty]
29 private bool isChecked;
30
34 public string Key
35 => this.key;
36
40 public string Label { get; }
41
45 public bool IsReviewable { get; }
46
50 public string? Value
51 => this.OverrideValue ?? this.model[this.key];
52
57 string key,
58 string label,
59 LegalIdentity model,
60 bool isReviewable,
61 string? initialOverride = null)
62 {
63 this.key = key;
64 this.Label = label;
65 this.model = model;
66 this.IsReviewable = isReviewable;
67
68 // initialize generated property
69 this.OverrideValue = initialOverride;
70 }
71
72 }
73}
ViewModel for a single property field of a LegalIdentity.
string Key
The key for the field. This is the name of the field in the LegalIdentity model.
string? Value
Either the user‑override (if set), or else the model value.
ObservableFieldItem(string key, string label, LegalIdentity model, bool isReviewable, string? initialOverride=null)
ctor.