mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-11-16 07:06:33 +01:00
55 lines
No EOL
1.4 KiB
C#
55 lines
No EOL
1.4 KiB
C#
|
|
using System.Globalization;
|
|
using Serilog;
|
|
using ShareeBike.Model.Device;
|
|
using ShareeBike.ViewModel.CopriWebView;
|
|
using Xamarin.Forms;
|
|
using Xamarin.Forms.Xaml;
|
|
|
|
namespace ShareeBike.View.CopriWebView
|
|
{
|
|
[XamlCompilation(XamlCompilationOptions.Compile)]
|
|
public partial class RegisterPage : ContentPage
|
|
{
|
|
public RegisterPage()
|
|
{
|
|
DependencyService.Get<IWebView>().ClearCookies();
|
|
|
|
InitializeComponent();
|
|
|
|
RegisterView.Navigating += (sender, ev) =>
|
|
{
|
|
this.IsEnabled = false;
|
|
ActivityIndicatorLoading.IsVisible = true;
|
|
ActivityIndicatorLoading.IsRunning = true;
|
|
};
|
|
|
|
RegisterView.Navigated += (sender, ev) =>
|
|
{
|
|
if (ev.Result == WebNavigationResult.Success)
|
|
{
|
|
this.IsEnabled = true;
|
|
ActivityIndicatorLoading.IsVisible = false;
|
|
ActivityIndicatorLoading.IsRunning = false;
|
|
return;
|
|
}
|
|
|
|
Log.ForContext<RegisterPage>().Error("Navigation did not succeed. {@Event}", ev);
|
|
RegisterView.Source = new HtmlWebViewSource
|
|
{
|
|
Html = "<html><b>Kann Anmeldeseite nicht anzeigen</b>!<br>Verbindung mit Internet ok?</html>"
|
|
};
|
|
|
|
this.IsEnabled = true;
|
|
ActivityIndicatorLoading.IsVisible = false;
|
|
ActivityIndicatorLoading.IsRunning = false;
|
|
};
|
|
|
|
RegisterView.BindingContext = new RegisterPageViewModel(
|
|
Model.ShareeBikeApp.MerchantId,
|
|
CultureInfo.CurrentUICulture.TwoLetterISOLanguageName,
|
|
App.ModelRoot.NextActiveUri.Host);
|
|
|
|
}
|
|
}
|
|
} |