2using System.Windows.Input;
7using System.Threading.Tasks;
11using CommunityToolkit.Mvvm.Input;
27 Label TitleLabel =
new();
28 TitleLabel.SetBinding(Label.TextProperty,
new Binding(nameof(this.TitleLabelText), source:
this));
29 TitleLabel.SetBinding(Label.StyleProperty,
new Binding(nameof(this.TitleLabelStyle), source:
this));
35 Entry.SetBinding(
CompositeEntry.IsValidProperty,
new Binding(nameof(this.IsValid), source:
this));
36 Entry.SetBinding(
CompositeEntry.StyleProperty,
new Binding(nameof(this.EntryStyle), source:
this));
37 Entry.SetBinding(
CompositeEntry.LabelTextProperty,
new Binding(nameof(this.TopText), source:
this));
44 Command =
new AsyncRelayCommand(() => this.
ScanQr(Entry))
51 Command =
new AsyncRelayCommand(() => this.OpenContract(Entry))
56 Style = AppStyles.SecondaryButton
62 Grid ButtonGrid =
new Grid()
64 ColumnDefinitions =
new ColumnDefinitionCollection
66 new ColumnDefinition { Width = GridLength.Auto },
67 new ColumnDefinition { Width = GridLength.Star }
69 ColumnSpacing = AppStyles.SmallSpacing
71 ButtonGrid.Add(ScanQrButton, 0, 0);
72 ButtonGrid.Add(ChooseContractButton, 1, 0);
74 Entry.RightView = OpenButton;
83 #region Bindable Properties
90 public string TitleLabelText
101 public Style TitleLabelStyle
111 public Style EntryStyle
122 public string TopText
133 public Style TopTextStyle
144 public string EntryData
155 public string EntryPlaceholderText
177 public string ButtonText
188 public Style ButtonStyle
199 public ICommand ButtonCommand
220 if (
string.IsNullOrEmpty(Url))
223 MainThread.BeginInvokeOnMainThread(() =>
225 Entry.EntryData = Url;
237 if (
string.IsNullOrEmpty(Entry.
EntryData))
const string IotSc
The IoT Smart Contract URI Scheme (iotsc)
A set of never changing property constants and helpful values.
A strongly-typed resource class, for looking up localized strings, etc.
static string QrScanCode
Looks up a localized string similar to Scan QR code.
static string RequestToAccessContract
Looks up a localized string similar to Request to access contract.
Base class that references services in the app.
static ILogService LogService
Log service.
static IContractOrchestratorService ContractOrchestratorService
Contract orchestrator service.
static IReportingStringLocalizer Localizer
Localization service
Helper class to perform scanning of QR Codes by displaying the UI and handling async results.
static async Task< string?> ScanQrCode(string? QrTitle, string[] AllowedSchemas)
Navigates to the Scan QR Code Page, waits for scan to complete, and returns the result....
Static class that gives access to app-specific styles
static Style SecondaryImageButton
Style for secondary image buttons.
A customizable entry control that allows setting views on the left and right sides of the entry.
string EntryData
Gets or sets the text displayed in the entry.
static readonly BindableProperty EntryDataProperty
Bindable property for the text displayed in the entry.
static readonly BindableProperty PlaceholderProperty
Bindable property for the placeholder text displayed when the entry is empty.
A custom control for selecting a contract
static readonly BindableProperty TitleLabelTextProperty
Bindable property for the title label text.
ContractSelector()
Constructor for the ContractSelector.
static readonly BindableProperty ButtonStyleProperty
Bindable Property for the select contract button style.
static readonly BindableProperty EntryDataProperty
Bindable Property for the contract id entry data.
static readonly BindableProperty IsValidProperty
Bindable Property for the contract id entry isvalid.
async Task ScanQr(CompositeEntry Entry)
Command that opens the ScanQrPage. And gets the url from the QR code.
static readonly BindableProperty ButtonCommandProperty
Bindable Property for the select contract button command.
static readonly BindableProperty TopTextProperty
Bindable Property for the contract id entry top label text.
static readonly BindableProperty TitleLabelStyleProperty
Bindable Property for the title label style.
static readonly BindableProperty EntryPlaceholderTextProperty
Bindable Property for the contract id entry placeholder text.
static readonly BindableProperty TopTextStyleProperty
Bindable Property for the contract id entry top label style.
static readonly BindableProperty EntryStyleProperty
Bindable Property for the contract id entry style.
static readonly BindableProperty ButtonTextProperty
Bindable Property for the select contract button text.
static readonly BindableProperty LabelDataProperty
Bindable property for LabelData.
Static class containing SVG Paths for symbols used in the app.
static readonly Geometry ScanQrIconPath
Scan QR code button icon