mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2024-11-14 14:26:28 +01:00
59 lines
No EOL
1.6 KiB
C#
59 lines
No EOL
1.6 KiB
C#
using System.Globalization;
|
|
using Serilog;
|
|
using TINK.Model.Device;
|
|
using TINK.ViewModel.Login;
|
|
using Xamarin.Forms;
|
|
using Xamarin.Forms.Xaml;
|
|
|
|
namespace TINK.View.CopriWebView
|
|
{
|
|
[XamlCompilation(XamlCompilationOptions.Compile)]
|
|
public partial class ManageAccountPage : ContentPage
|
|
{
|
|
public ManageAccountPage()
|
|
{
|
|
InitializeComponent();
|
|
|
|
ManageAccount.Navigating += (sender, ev) =>
|
|
{
|
|
if (!ev.Url.ToUpper().EndsWith(".PDF"))
|
|
{
|
|
// Stay inside web view except for downloading pdf- files.
|
|
this.IsEnabled = false;
|
|
ActivityIndicatorLoading.IsVisible = true;
|
|
ActivityIndicatorLoading.IsRunning = true;
|
|
return;
|
|
}
|
|
|
|
DependencyService.Get<IExternalBrowserService>().OpenUrl(ev.Url);
|
|
};
|
|
|
|
ManageAccount.Navigated += (sender, ev) =>
|
|
{
|
|
if (ev.Result == WebNavigationResult.Success)
|
|
{
|
|
this.IsEnabled = true;
|
|
ActivityIndicatorLoading.IsVisible = false;
|
|
ActivityIndicatorLoading.IsRunning = false;
|
|
return;
|
|
}
|
|
|
|
Log.ForContext<ManageAccountPage>().Error("Navigation did not succeed.{@Event}{@Sender}", ev, sender);
|
|
ManageAccount.Source = new HtmlWebViewSource
|
|
{
|
|
Html = "<html><b>Kann persönliche Daten nicht anzeigen/ verwalten!</b><br>Verbindung mit Internet ok?</html>"
|
|
};
|
|
|
|
this.IsEnabled = true;
|
|
ActivityIndicatorLoading.IsVisible = false;
|
|
ActivityIndicatorLoading.IsRunning = false;
|
|
};
|
|
|
|
ManageAccount.BindingContext = new ManageAccountViewModel(
|
|
App.ModelRoot.ActiveUser.SessionCookie,
|
|
Model.TinkApp.MerchantId,
|
|
CultureInfo.CurrentUICulture.TwoLetterISOLanguageName,
|
|
App.ModelRoot.NextActiveUri.Host);
|
|
}
|
|
}
|
|
} |