using System.Globalization;
using Serilog;
using TINK.ViewModel;
using TINK.ViewModel.Help;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace TINK.View.Help
{
[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,
"Kann Mietinformationen nicht anzeigen!
Verbindung mit Internet ok?");
/// Info about types of bikes.
ManualWebView.Navigating += WebViewHelper.SelectDisplayTarget;
ManualWebView.Navigated += (sender, ev) => WebViewHelper.HandleError(
sender,
ev,
"Kann Radinformationen nicht anzeigen!
Verbindung mit Internet ok?");
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;
}
/// Called when page is shown.
protected override void OnAppearing()
{
ViewModel.OnAppearing();
}
}
}