sharee.bike-App/LastenradBayern/TINK/View/CopriWebView/RegisterPage.xaml.cs

55 lines
1.4 KiB
C#
Raw Normal View History

2021-11-07 19:42:59 +01:00

2022-08-30 15:42:25 +02:00
using System.Globalization;
2022-04-10 17:38:34 +02:00
using Serilog;
2021-11-07 19:42:59 +01:00
using TINK.Model.Device;
using TINK.ViewModel.CopriWebView;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace TINK.View.CopriWebView
{
2022-09-06 16:08:19 +02:00
[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.TinkApp.MerchantId,
CultureInfo.CurrentUICulture.TwoLetterISOLanguageName,
App.ModelRoot.NextActiveUri.Host);
}
}
2021-11-07 19:42:59 +01:00
}