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,
"Kann Lizenzinformationen nicht anzeigen!
Verbindung mit Internet ok?");
PrivacyWebView.Navigating += WebViewHelper.SelectDisplayTarget;
PrivacyWebView.Navigated += (sender, ev) => WebViewHelper.HandleError(
sender,
ev,
"Kann Datenschutzinformationen nicht anzeigen!
Verbindung mit Internet ok?");
GtcWebView.Navigating += WebViewHelper.SelectDisplayTarget;
GtcWebView.Navigated += (sender, ev) => WebViewHelper.HandleError(
sender,
ev,
"Kann allgemeine Geschäftsbedingungen nicht anzeigen!
Verbindung mit Internet ok?");
ImpressWebView.Navigating += WebViewHelper.SelectDisplayTarget;
ImpressWebView.Navigated += (sender, ev) => WebViewHelper.HandleError(
sender,
ev,
"Kann Impressum nicht anzeigen!
Verbindung mit Internet ok?");
}
/// Called when page is shown.
protected override void OnAppearing()
{
ViewModel.OnAppearing();
}
}
}