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.
 

42 lines
1.1 KiB

using GMCabsDriverAssistantSolution.ViewModels;
namespace GMCabsDriverAssistantSolution.Views;
public partial class BookingsPage : ContentPage
{
#region Fields
private readonly BookingsViewModel _viewModel;
#endregion
#region Properties
#endregion
#region Constructor
public BookingsPage(double? lat, double? lng)
{
InitializeComponent();
BindingContext = _viewModel = new BookingsViewModel();
if (lat == null)
{
var currentLocation = Geolocation.GetLastKnownLocationAsync();
lat = currentLocation.Result.Latitude;
lng = currentLocation.Result.Longitude;
}
_viewModel.CurrentLat = lat.Value;
_viewModel.CurrentLng = lng.Value;
}
#endregion
#region Methods
protected override void OnAppearing()
{
base.OnAppearing();
_viewModel.OnAppearing();
}
private async void OnBookingViewClicked(object sender, EventArgs e)
{
await Navigation.PushAsync(new BookingDetailsPage(), true);
}
#endregion
}