2023-01-18 14:22:51 +01:00
|
|
|
|
2022-08-30 15:42:25 +02:00
|
|
|
using System.Globalization;
|
2022-04-10 17:38:34 +02:00
|
|
|
using Serilog;
|
2024-04-09 12:53:23 +02:00
|
|
|
using ShareeBike.ViewModel.CopriWebView;
|
2021-11-07 19:42:59 +01:00
|
|
|
using Xamarin.Forms;
|
|
|
|
using Xamarin.Forms.Xaml;
|
|
|
|
|
2024-04-09 12:53:23 +02:00
|
|
|
namespace ShareeBike.View.CopriWebView
|
2021-11-07 19:42:59 +01:00
|
|
|
{
|
2022-09-06 16:08:19 +02:00
|
|
|
[XamlCompilation(XamlCompilationOptions.Compile)]
|
|
|
|
public partial class PasswordForgottenPage : ContentPage
|
|
|
|
{
|
|
|
|
public PasswordForgottenPage()
|
|
|
|
{
|
|
|
|
InitializeComponent();
|
2022-04-10 17:38:34 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
PasswordForgottenWebView.Navigating += (sender, ev) =>
|
|
|
|
{
|
|
|
|
this.IsEnabled = false;
|
|
|
|
ActivityIndicatorLoading.IsVisible = true;
|
|
|
|
ActivityIndicatorLoading.IsRunning = true;
|
|
|
|
};
|
2021-11-07 19:42:59 +01:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
PasswordForgottenWebView.Navigated += (sender, ev) =>
|
|
|
|
{
|
|
|
|
if (ev.Result == WebNavigationResult.Success)
|
|
|
|
{
|
|
|
|
this.IsEnabled = true;
|
|
|
|
ActivityIndicatorLoading.IsVisible = false;
|
|
|
|
ActivityIndicatorLoading.IsRunning = false;
|
|
|
|
return;
|
|
|
|
}
|
2021-11-07 19:42:59 +01:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
Log.ForContext<PasswordForgottenPage>().Error("Navigation did not succeed. {@Event}", ev);
|
|
|
|
PasswordForgottenWebView.Source = new HtmlWebViewSource
|
|
|
|
{
|
|
|
|
Html = "<html><b>Kann Passwort vergessen Seite nicht anzeigen!</b><br>Verbindung mit Internet ok?</html>"
|
|
|
|
};
|
2022-04-10 17:38:34 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
this.IsEnabled = true;
|
|
|
|
ActivityIndicatorLoading.IsVisible = false;
|
|
|
|
ActivityIndicatorLoading.IsRunning = false;
|
|
|
|
};
|
2021-11-07 19:42:59 +01:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
PasswordForgottenWebView.BindingContext = new PasswordForgottonViewModel(
|
2024-04-09 12:53:23 +02:00
|
|
|
Model.ShareeBikeApp.MerchantId,
|
2022-09-06 16:08:19 +02:00
|
|
|
CultureInfo.CurrentUICulture.TwoLetterISOLanguageName,
|
|
|
|
App.ModelRoot.NextActiveUri.Host);
|
|
|
|
}
|
|
|
|
}
|
2023-01-18 14:22:51 +01:00
|
|
|
}
|