sharee.bike-App/LastenradBayern/TINK/View/FeesAndBikes/FeesAndBikesPage.xaml.cs
2022-10-03 17:55:10 +02:00

51 lines
1.5 KiB
C#

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,
() => 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();
}
}
}