Basics
Validating Client
To validate if the client application is connected using Wisej.NET Hybrid, you can use:
Reading Device Information
Information about the hybrid client device is available using the Device.Info member. The Info member contains a number of predefined modules such as system, app version, and battery state information. These modules can be accessed using the following approach in C# and Wisej.NET:
Some modules that register information about the hybrid client device are registered dynamically like those that are provided in the Wisej.NET Hybrid Extensions. Those modules can be accessed using the Device.Use<T>() method included where T is an implementation of IClientInfoProvider.
This same approach can be used to access built-in modules:
Properties
A number of properties used to configure the hybrid client device are exposed through built-in modules such as Device.Flyout and Device.Email.
The first time a property is read from the value will be retrieved modally from the client device. This operation will suspend the current thread until a value is retrieved.
Alternatively, properties can be registered through dynamic modules such as those provided in the Wisej.NET Hybrid Extensions. These can be read from and assigned using the Device.Use<T> method where T is the name of the module type.
Methods
Methods can be used to interact with the hybrid client device's hardware or user interface such as toggling a flashlight or writing a file to the client device.
Alternatively, some Wisej.NET Hybrid Extensions may register modules with methods dynamically. These can be called using the Device.Get<T> method where T is the name of the module type.
In the case of calling any method that returns a value with Wisej.NET Hybrid, the operation is modal. The modal operation suspends the current thread until the value is returned from the client device.
Events
Events from the hybrid client device are automatically wired from the client device to the Wisej.NET application. Events can be accessed from a member of a built-in module such as Device.Battery, Device.Flyout, or Device.TabBar:
Alternatively, dynamically registered modules such as the Wisej.NET Hybrid Extensions can be accessed and attached using the Device.Use<T>() method where T is the name of the module type.
All Device member events should be manually disconnected when the event is no longer in use.
Last updated