sharee.bike-App/LastenradBayern/ShareeBike/View/LegalInformation/LegalInformationPage.xaml.cs
2024-04-09 12:53:23 +02:00

60 lines
2.1 KiB
C#

using System.Globalization;
using ShareeBike.ViewModel;
using ShareeBike.ViewModel.LegalInformation;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace ShareeBike.View.LegalInformation
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class LegalInformationPage : TabbedPage
{
public LegalInformationPageViewModel ViewModel { get; }
public LegalInformationPage()
{
InitializeComponent();
ViewModel = new LegalInformationPageViewModel(
App.ModelRoot.NextActiveUri.Host,
App.ModelRoot.ResourceUrls.GtcResourcePath,
App.ModelRoot.ResourceUrls.PrivacyResourcePath,
App.ModelRoot.ResourceUrls.ImpressResourcePath,
App.ModelRoot.IsSiteCachingOn,
resourceName => ViewModelResourceHelper.GetSource(resourceName),
() => App.ModelRoot.GetConnector(App.ModelRoot.GetIsConnected()).Query,
resourceUrls => App.ModelRoot.ResourceUrls = resourceUrls);
this.BindingContext = ViewModel;
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>");
PrivacyWebView.Navigating += WebViewHelper.SelectDisplayTarget;
PrivacyWebView.Navigated += (sender, ev) => WebViewHelper.HandleError(
sender,
ev,
"<html><b>Kann Datenschutzinformationen nicht anzeigen!</b><br>Verbindung mit Internet ok?</html>");
GtcWebView.Navigating += WebViewHelper.SelectDisplayTarget;
GtcWebView.Navigated += (sender, ev) => WebViewHelper.HandleError(
sender,
ev,
"<html><b>Kann allgemeine Geschäftsbedingungen nicht anzeigen!</b><br>Verbindung mit Internet ok?</html>");
ImpressWebView.Navigating += WebViewHelper.SelectDisplayTarget;
ImpressWebView.Navigated += (sender, ev) => WebViewHelper.HandleError(
sender,
ev,
"<html><b>Kann Impressum nicht anzeigen!</b><br>Verbindung mit Internet ok?</html>");
}
/// <summary> Called when page is shown. </summary>
protected override void OnAppearing()
{
ViewModel.OnAppearing();
}
}
}