2023-11-21 15:26:57 +01:00
|
|
|
using System.Globalization;
|
|
|
|
using Serilog;
|
2024-04-09 12:53:23 +02:00
|
|
|
using ShareeBike.ViewModel;
|
|
|
|
using ShareeBike.ViewModel.Help;
|
2023-11-21 15:26:57 +01:00
|
|
|
using Xamarin.Forms;
|
|
|
|
using Xamarin.Forms.Xaml;
|
|
|
|
|
2024-04-09 12:53:23 +02:00
|
|
|
namespace ShareeBike.View.Help
|
2023-11-21 15:26:57 +01:00
|
|
|
{
|
|
|
|
[XamlCompilation(XamlCompilationOptions.Compile)]
|
|
|
|
public partial class HelpPage : TabbedPage
|
|
|
|
{
|
|
|
|
public HelpPageViewModel ViewModel { get; }
|
|
|
|
|
|
|
|
public HelpPage()
|
|
|
|
{
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
|
|
|
|
|
|
/// Info about renting.
|
|
|
|
TariffsWebView.Navigating += WebViewHelper.SelectDisplayTarget;
|
|
|
|
|
|
|
|
TariffsWebView.Navigated += (sender, ev) => WebViewHelper.HandleError(
|
|
|
|
sender,
|
|
|
|
ev,
|
|
|
|
"<html><b>Kann Mietinformationen nicht anzeigen!</b><br>Verbindung mit Internet ok?</html>");
|
|
|
|
|
|
|
|
/// Info about types of bikes.
|
|
|
|
ManualWebView.Navigating += WebViewHelper.SelectDisplayTarget;
|
|
|
|
|
|
|
|
ManualWebView.Navigated += (sender, ev) => WebViewHelper.HandleError(
|
|
|
|
sender,
|
|
|
|
ev,
|
|
|
|
"<html><b>Kann Radinformationen nicht anzeigen!</b><br>Verbindung mit Internet ok?</html>");
|
|
|
|
|
|
|
|
ViewModel = new HelpPageViewModel(
|
|
|
|
App.ModelRoot.NextActiveUri.Host,
|
|
|
|
App.ModelRoot.ResourceUrls.TariffsResourcePath,
|
|
|
|
App.ModelRoot.ResourceUrls.ManualResourcePath,
|
|
|
|
App.ModelRoot.IsSiteCachingOn,
|
|
|
|
CultureInfo.CurrentUICulture.TwoLetterISOLanguageName,
|
|
|
|
() => App.ModelRoot.GetConnector(App.ModelRoot.GetIsConnected()).Query,
|
|
|
|
resourceUrls => App.ModelRoot.ResourceUrls = resourceUrls);
|
|
|
|
|
|
|
|
this.BindingContext = ViewModel;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary> Called when page is shown. </summary>
|
|
|
|
protected override void OnAppearing()
|
|
|
|
{
|
|
|
|
ViewModel.OnAppearing();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|