sharee.bike-App/Meinkonrad/TINK/View/FeesAndBikes/FeesAndBikesPage.xaml.cs

52 lines
1.5 KiB
C#
Raw Normal View History

2022-10-03 17:55:10 +02:00
using Serilog;
using TINK.ViewModel;
2022-08-30 15:42:25 +02:00
using TINK.ViewModel.Contact;
2021-11-07 19:42:59 +01:00
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace TINK.View.Contact
{
2022-09-06 16:08:19 +02:00
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class FeesAndBikesPage : TabbedPage
{
public FeesAndBikesPageViewModel ViewModel { get; }
2021-11-07 19:42:59 +01:00
2022-09-06 16:08:19 +02:00
public FeesAndBikesPage()
{
InitializeComponent();
2021-11-07 19:42:59 +01:00
2022-10-03 17:55:10 +02:00
/// 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>");
2022-09-06 16:08:19 +02:00
ViewModel = new FeesAndBikesPageViewModel(
App.ModelRoot.NextActiveUri.Host,
App.ModelRoot.ResourceUrls.FeesResourcePath,
App.ModelRoot.ResourceUrls.BikesResourcePath,
2022-10-03 17:55:10 +02:00
App.ModelRoot.IsSiteCachingOn,
() => App.ModelRoot.GetConnector(App.ModelRoot.GetIsConnected()).Query,
resourceUrls => App.ModelRoot.ResourceUrls = resourceUrls);
2021-11-07 19:42:59 +01:00
2022-09-06 16:08:19 +02:00
BindingContext = ViewModel;
}
2021-11-07 19:42:59 +01:00
2022-09-06 16:08:19 +02:00
/// <summary> Called when page is shown. </summary>
protected override void OnAppearing()
{
ViewModel.OnAppearing();
}
}
2022-10-03 17:55:10 +02:00
}