using System.Globalization;
using Serilog;
using TINK.ViewModel;
using TINK.ViewModel.Contact;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace TINK.View.Contact
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class FeesAndBikesPage : TabbedPage
{
public FeesAndBikesPageViewModel ViewModel { get; }
public FeesAndBikesPage()
{
InitializeComponent();
/// Info about renting.
InfoRentBikeWebView.Navigating += WebViewHelper.SelectDisplayTarget;
InfoRentBikeWebView.Navigated += (sender, ev) => WebViewHelper.HandleError(
sender,
ev,
"Kann Mietinformationen nicht anzeigen!
Verbindung mit Internet ok?");
/// Info about types of bikes.
InfoTypesOfBikesWebView.Navigating += WebViewHelper.SelectDisplayTarget;
InfoTypesOfBikesWebView.Navigated += (sender, ev) => WebViewHelper.HandleError(
sender,
ev,
"Kann Radinformationen nicht anzeigen!
Verbindung mit Internet ok?");
ViewModel = new FeesAndBikesPageViewModel(
App.ModelRoot.NextActiveUri.Host,
App.ModelRoot.ResourceUrls.FeesResourcePath,
App.ModelRoot.ResourceUrls.BikesResourcePath,
App.ModelRoot.IsSiteCachingOn,
CultureInfo.CurrentUICulture.TwoLetterISOLanguageName,
() => App.ModelRoot.GetConnector(App.ModelRoot.GetIsConnected()).Query,
resourceUrls => App.ModelRoot.ResourceUrls = resourceUrls);
BindingContext = ViewModel;
}
/// Called when page is shown.
protected override void OnAppearing()
{
ViewModel.OnAppearing();
}
}
}