2022-10-03 17:55:10 +02:00
|
|
|
using System.Globalization;
|
2024-04-09 12:53:23 +02:00
|
|
|
using ShareeBike.ViewModel;
|
|
|
|
using ShareeBike.ViewModel.LegalInformation;
|
2021-05-13 20:16:41 +02:00
|
|
|
using Xamarin.Forms;
|
|
|
|
using Xamarin.Forms.Xaml;
|
|
|
|
|
2024-04-09 12:53:23 +02:00
|
|
|
namespace ShareeBike.View.LegalInformation
|
2021-05-13 20:16:41 +02:00
|
|
|
{
|
2022-09-06 16:08:19 +02:00
|
|
|
[XamlCompilation(XamlCompilationOptions.Compile)]
|
2023-11-21 15:26:57 +01:00
|
|
|
public partial class LegalInformationPage : TabbedPage
|
2022-09-06 16:08:19 +02:00
|
|
|
{
|
2023-11-21 15:26:57 +01:00
|
|
|
public LegalInformationPageViewModel ViewModel { get; }
|
2021-05-13 20:16:41 +02:00
|
|
|
|
2023-11-21 15:26:57 +01:00
|
|
|
public LegalInformationPage()
|
2022-09-06 16:08:19 +02:00
|
|
|
{
|
|
|
|
InitializeComponent();
|
2021-05-13 20:16:41 +02:00
|
|
|
|
2023-11-21 15:26:57 +01:00
|
|
|
ViewModel = new LegalInformationPageViewModel(
|
2022-09-06 16:08:19 +02:00
|
|
|
App.ModelRoot.NextActiveUri.Host,
|
2023-11-21 15:26:57 +01:00
|
|
|
App.ModelRoot.ResourceUrls.GtcResourcePath,
|
2022-09-06 16:08:19 +02:00
|
|
|
App.ModelRoot.ResourceUrls.PrivacyResourcePath,
|
|
|
|
App.ModelRoot.ResourceUrls.ImpressResourcePath,
|
|
|
|
App.ModelRoot.IsSiteCachingOn,
|
2022-10-03 17:55:10 +02:00
|
|
|
resourceName => ViewModelResourceHelper.GetSource(resourceName),
|
|
|
|
() => App.ModelRoot.GetConnector(App.ModelRoot.GetIsConnected()).Query,
|
|
|
|
resourceUrls => App.ModelRoot.ResourceUrls = resourceUrls);
|
2023-11-21 15:26:57 +01:00
|
|
|
this.BindingContext = ViewModel;
|
2021-05-13 20:16:41 +02:00
|
|
|
|
2022-10-03 17:55:10 +02:00
|
|
|
InfoLicenses.Navigating += WebViewHelper.SelectDisplayTarget;
|
|
|
|
InfoLicenses.Navigated += (sender, ev) => WebViewHelper.HandleError(
|
|
|
|
sender,
|
|
|
|
ev,
|
|
|
|
"<html><b>Kann Lizenzinformationen nicht anzeigen!</b><br>Verbindung mit Internet ok?</html>");
|
2021-05-13 20:16:41 +02:00
|
|
|
|
2023-11-21 15:26:57 +01:00
|
|
|
PrivacyWebView.Navigating += WebViewHelper.SelectDisplayTarget;
|
|
|
|
PrivacyWebView.Navigated += (sender, ev) => WebViewHelper.HandleError(
|
2022-10-03 17:55:10 +02:00
|
|
|
sender,
|
|
|
|
ev,
|
|
|
|
"<html><b>Kann Datenschutzinformationen nicht anzeigen!</b><br>Verbindung mit Internet ok?</html>");
|
|
|
|
|
2023-11-21 15:26:57 +01:00
|
|
|
GtcWebView.Navigating += WebViewHelper.SelectDisplayTarget;
|
|
|
|
GtcWebView.Navigated += (sender, ev) => WebViewHelper.HandleError(
|
2022-10-03 17:55:10 +02:00
|
|
|
sender,
|
|
|
|
ev,
|
|
|
|
"<html><b>Kann allgemeine Geschäftsbedingungen nicht anzeigen!</b><br>Verbindung mit Internet ok?</html>");
|
|
|
|
|
2023-11-21 15:26:57 +01:00
|
|
|
ImpressWebView.Navigating += WebViewHelper.SelectDisplayTarget;
|
|
|
|
ImpressWebView.Navigated += (sender, ev) => WebViewHelper.HandleError(
|
2022-10-03 17:55:10 +02:00
|
|
|
sender,
|
|
|
|
ev,
|
|
|
|
"<html><b>Kann Impressum nicht anzeigen!</b><br>Verbindung mit Internet ok?</html>");
|
2022-09-06 16:08:19 +02:00
|
|
|
}
|
2021-05-13 20:16:41 +02:00
|
|
|
|
2022-09-06 16:08:19 +02:00
|
|
|
/// <summary> Called when page is shown. </summary>
|
|
|
|
protected override void OnAppearing()
|
|
|
|
{
|
|
|
|
ViewModel.OnAppearing();
|
|
|
|
}
|
|
|
|
}
|
2022-10-03 17:55:10 +02:00
|
|
|
}
|