sharee.bike-App/LastenradBayern/TINK/View/Info/InfoTabbedPage.xaml.cs

61 lines
2 KiB
C#
Raw Normal View History

2022-10-03 17:55:10 +02:00
using System.Globalization;
2022-08-30 15:42:25 +02:00
using TINK.ViewModel;
2021-11-07 19:42:59 +01:00
using TINK.ViewModel.Info;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace TINK.View.Info
{
2022-09-06 16:08:19 +02:00
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class InfoPage : TabbedPage
{
public InfoPageViewModel ViewModel { get; }
2021-11-07 19:42:59 +01:00
2022-09-06 16:08:19 +02:00
public InfoPage()
{
InitializeComponent();
2021-11-07 19:42:59 +01:00
2022-09-06 16:08:19 +02:00
ViewModel = new InfoPageViewModel(
App.ModelRoot.NextActiveUri.Host,
App.ModelRoot.ResourceUrls.AgbResourcePath,
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);
2022-09-06 16:08:19 +02:00
TabbedInfoPage.BindingContext = ViewModel;
2021-11-07 19:42:59 +01: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-11-07 19:42:59 +01:00
2022-10-03 17:55:10 +02:00
InfoDatenschutz.Navigating += WebViewHelper.SelectDisplayTarget;
InfoDatenschutz.Navigated += (sender, ev) => WebViewHelper.HandleError(
sender,
ev,
"<html><b>Kann Datenschutzinformationen nicht anzeigen!</b><br>Verbindung mit Internet ok?</html>");
InfoABG.Navigating += WebViewHelper.SelectDisplayTarget;
InfoABG.Navigated += (sender, ev) => WebViewHelper.HandleError(
sender,
ev,
"<html><b>Kann allgemeine Geschäftsbedingungen nicht anzeigen!</b><br>Verbindung mit Internet ok?</html>");
InfoImpressum.Navigating += WebViewHelper.SelectDisplayTarget;
InfoImpressum.Navigated += (sender, ev) => WebViewHelper.HandleError(
sender,
ev,
"<html><b>Kann Impressum nicht anzeigen!</b><br>Verbindung mit Internet ok?</html>");
2022-09-06 16:08:19 +02:00
}
2021-11-07 19:42:59 +01: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
}