sharee.bike-App/LastenradBayern/TINK/View/FeesAndBikes/FeesAndBikesPage.xaml.cs
2023-08-31 12:31:38 +02:00

53 lines
1.6 KiB
C#

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,
"<html><b>Kann Mietinformationen nicht anzeigen!</b><br>Verbindung mit Internet ok?</html>");
/// Info about types of bikes.
InfoTypesOfBikesWebView.Navigating += WebViewHelper.SelectDisplayTarget;
InfoTypesOfBikesWebView.Navigated += (sender, ev) => WebViewHelper.HandleError(
sender,
ev,
"<html><b>Kann Radinformationen nicht anzeigen!</b><br>Verbindung mit Internet ok?</html>");
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;
}
/// <summary> Called when page is shown. </summary>
protected override void OnAppearing()
{
ViewModel.OnAppearing();
}
}
}