You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.1 KiB

  1. using GMCabsDriverAssistantSolution.ViewModels;
  2. namespace GMCabsDriverAssistantSolution.Views;
  3. public partial class BookingsPage : ContentPage
  4. {
  5. #region Fields
  6. private readonly BookingsViewModel _viewModel;
  7. #endregion
  8. #region Properties
  9. #endregion
  10. #region Constructor
  11. public BookingsPage(double? lat, double? lng)
  12. {
  13. InitializeComponent();
  14. BindingContext = _viewModel = new BookingsViewModel();
  15. if (lat == null)
  16. {
  17. var currentLocation = Geolocation.GetLastKnownLocationAsync();
  18. lat = currentLocation.Result.Latitude;
  19. lng = currentLocation.Result.Longitude;
  20. }
  21. _viewModel.CurrentLat = lat.Value;
  22. _viewModel.CurrentLng = lng.Value;
  23. }
  24. #endregion
  25. #region Methods
  26. protected override void OnAppearing()
  27. {
  28. base.OnAppearing();
  29. _viewModel.OnAppearing();
  30. }
  31. private async void OnBookingViewClicked(object sender, EventArgs e)
  32. {
  33. await Navigation.PushAsync(new BookingDetailsPage(), true);
  34. }
  35. #endregion
  36. }