Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
MyContractsPage.xaml.cs
3
5{
9 [XamlCompilation(XamlCompilationOptions.Compile)]
10 public partial class MyContractsPage
11 {
16 {
18 this.Title = ViewModel.Title;
19 this.ContentPageModel = ViewModel;
20
21 this.InitializeComponent();
22 }
23
24 private void ContractsSelectionChanged(object? Sender, SelectionChangedEventArgs e)
25 {
26 if (this.ContentPageModel is MyContractsViewModel MyContractsViewModel)
27 {
28 object SelectedItem = this.Contracts.SelectedItem;
29
30 if (SelectedItem is HeaderModel Category)
31 {
32 Category.Expanded = !Category.Expanded;
33 MyContractsViewModel.AddOrRemoveContracts(Category, Category.Expanded);
34 }
35 else if (SelectedItem is ContractModel Contract)
36 {
37 MyContractsViewModel.ContractSelected(Contract.ContractId);
38
39 if (Contract.HasEvents)
40 ServiceRef.NotificationService.DeleteEvents(Contract.Events);
41 }
42 else if (SelectedItem is EventModel Event)
43 Event.Clicked();
44
45 this.Contracts.SelectedItem = null;
46 }
47 }
48 }
49}
Base class that references services in the app.
Definition: ServiceRef.cs:31
static IUiService UiService
Service serializing and managing UI-related tasks.
Definition: ServiceRef.cs:55
static INotificationService NotificationService
Service for managing notifications for the user.
Definition: ServiceRef.cs:211
Holds navigation parameters specific to views displaying a list of contacts.
A page that displays a list of the current user's contracts.
MyContractsPage()
Creates a new instance of the MyContractsPage class.
The view model to bind to when displaying 'my' contracts.
void ContractSelected(string ContractId)
Add or remove the contracts from the collection
void AddOrRemoveContracts(HeaderModel Category, bool Expanded)
Add or remove the contracts from the collection