Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
ContractCategoryModel.cs
1using System.Collections.ObjectModel;
2using System.ComponentModel;
3using Microsoft.Maui.Controls.Shapes;
4
6{
12 public class ContractCategoryModel(string Category, ICollection<ContractModel> Contracts) : ObservableCollection<ContractModel>, INotifyPropertyChanged
13 {
14 private bool expanded;
15
19 public string Category { get; } = Category;
20
24 public ICollection<ContractModel> Contracts { get; } = Contracts;
25
29 public int NrContracts => this.Contracts.Count;
30
34 public bool Expanded
35 {
36 get => this.expanded;
37 set
38 {
39 if (this.expanded != value)
40 {
41 this.expanded = value;
42
43 this.OnPropertyChanged(new PropertyChangedEventArgs(nameof(this.Expanded)));
44 this.OnPropertyChanged(new PropertyChangedEventArgs(nameof(this.Symbol)));
45
46 if (this.expanded)
47 {
48 foreach (ContractModel Contract in this.Contracts)
49 this.Add(Contract);
50 }
51 else
52 this.Clear();
53 }
54 }
55 }
56
60 public Geometry Symbol => this.expanded ? Geometries.FolderOpenPath : Geometries.FolderClosedPath;
61 }
62}
Static class containing SVG Paths for symbols used in the app.
Definition: Geometries.cs:11
static readonly Geometry FolderClosedPath
Closed folder
Definition: Geometries.cs:565