Local Application
Wisej.NET Hybrid applications can be configured to run offline without any need to connect to a remote web server.
Last updated
Wisej.NET Hybrid applications can be configured to run offline without any need to connect to a remote web server.
Last updated
When creating a new Hybrid Client application, an offline application can be specified with the UseWisejOffline() extension method.
In the example above the client application registers an offline app, OfflineStartup, which runs an embedded web server that serves the Wisej.NET application:
The default OfflineStartup file can be found within the Wisej.NET Hybrid Offline Application project template in Visual Studio.
It is possible to switch between the offline (disconnected) application and online (connected) application with one few line of code:
At any point in time, simply use Application.Navigate("url", "target") to switch between URLs.
For example, if an offline application was registered on port 5000, but you're currently connected to an "online" application, you can use the following line of code anywhere in your Wisej.NET application to switch to the offline version:
If you would like to switch to the offline version of an application when the network gets disconnected, configure the OfflineTimeout member inside of the client app's Startup.cs file:
The line config.OfflineTimeout = 5000;
in the example above specifies that when the user is no longer connected to a network, the application should automatically switch from the "online" version to the "offline" version of the application.