Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
NotificationChannelToSvgConverter.cs
1using System;
2using System.Globalization;
3using Microsoft.Maui.Controls;
5
7{
11 public class NotificationChannelToSvgConverter : IValueConverter
12 {
21 public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
22 {
23 string Channel = (value as string)?.Trim() ?? string.Empty;
24
25 switch (Channel)
26 {
28 return "message.svg";
30 return "notifications.svg";
32 return "person.svg";
34 return "contract.svg";
36 return "wallet.svg";
38 return "token.svg";
40 return "thing.svg";
41 default:
42 return "notifications.svg";
43 }
44 }
45
54 public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
55 {
56 throw new NotSupportedException("Converting SVG resource names back to channel labels is not supported.");
57 }
58 }
59}
const string Provisioning
Provisioning channel
Definition: Constants.cs:769
const string Petitions
Petitions channel
Definition: Constants.cs:744
const string Identities
Identities channel
Definition: Constants.cs:749
const string Messages
Messages channel
Definition: Constants.cs:739
const string EDaler
eDaler channel
Definition: Constants.cs:759
const string Tokens
Tokens channel
Definition: Constants.cs:764
const string Contracts
Contracts channel
Definition: Constants.cs:754
A set of never changing property constants and helpful values.
Definition: Constants.cs:24
Converts a notification channel label into the corresponding SVG resource name.
object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
Not implemented because conversion from SVG name back to channel label is not supported.
object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
Converts a notification channel label into an SVG resource name, defaulting to the general notificati...