Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ObservableCheckboxField.cs
1using System.Linq;
3
5{
10 {
14 public override string? StringValue
15 {
16 get => string.Join(",", this.SelectedOptions.Select(o => o.Value));
17 set
18 {
19 this.SelectedOptions.Clear();
20 if (!string.IsNullOrWhiteSpace(value))
21 {
22 string[] OptionValues = value.Split(',', System.StringSplitOptions.RemoveEmptyEntries | System.StringSplitOptions.TrimEntries);
23 foreach (string OptionValue in OptionValues)
24 {
25 KycOption? Opt = this.Options.FirstOrDefault(o => o.Value == OptionValue);
26 MainThread.BeginInvokeOnMainThread(()=>
27 {
28 if (Opt is not null)
29 this.SelectedOptions.Add(Opt);
30 });
31 }
32 }
33 }
34 }
35 }
36}
override? string StringValue
Gets or sets the value as a comma-separated list of selected option values.
The base KYC field model. Use as-is for generic fields, or subclass for custom logic.
ObservableCollection< KycOption > SelectedOptions
For Checkbox type: multi-selection of options.
ObservableCollection< KycOption > Options
All possible options (for picker, country, checkbox, radio).