mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-06-22 05:47:28 +02:00
Version 3.0.357
This commit is contained in:
parent
5980410182
commit
5c0b2e70c9
84 changed files with 1012 additions and 449 deletions
|
@ -23,6 +23,7 @@ using TINK.Settings;
|
|||
using TINK.View;
|
||||
using TINK.ViewModel.Bikes;
|
||||
using Xamarin.Forms;
|
||||
using Command = Xamarin.Forms.Command;
|
||||
|
||||
namespace TINK.ViewModel.MyBikes
|
||||
{
|
||||
|
@ -31,6 +32,20 @@ namespace TINK.ViewModel.MyBikes
|
|||
/// <summary> Holds the stations to get station names form station ids. </summary>
|
||||
private IEnumerable<IStation> Stations { get; }
|
||||
|
||||
/// <summary>
|
||||
/// True if ListView of Bikes is refreshing after user pulled;
|
||||
/// </summary>
|
||||
private bool _isRefreshing = false;
|
||||
public bool IsRefreshing
|
||||
{
|
||||
get { return _isRefreshing; }
|
||||
set
|
||||
{
|
||||
_isRefreshing = value;
|
||||
OnPropertyChanged(new PropertyChangedEventArgs(nameof(IsRefreshing)));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructs bike collection view model in case information about occupied bikes is available.
|
||||
/// </summary>
|
||||
|
@ -71,8 +86,21 @@ namespace TINK.ViewModel.MyBikes
|
|||
};
|
||||
|
||||
Stations = stations ?? throw new ArgumentException(nameof(stations));
|
||||
|
||||
/// <summary>
|
||||
/// Holds what should be executed on pull to refresh
|
||||
/// </summary>
|
||||
RefreshCommand = new Command(async () => {
|
||||
|
||||
IsRefreshing = true;
|
||||
await OnAppearing();
|
||||
IsRefreshing = false;
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
public Command RefreshCommand { get; }
|
||||
|
||||
/// <summary> Returns if info about the fact that user did not request or book any bikes is visible or not.<summary>
|
||||
/// Gets message that logged in user has not booked any bikes.
|
||||
/// </summary>
|
||||
|
@ -90,7 +118,7 @@ namespace TINK.ViewModel.MyBikes
|
|||
get
|
||||
{
|
||||
return IsNoBikesOccupiedVisible
|
||||
? $"Momentan sind keine Fahrräder auf Benutzer {ActiveUser?.Mail} reserviert/ gebucht."
|
||||
? string.Format(AppResources.MarkingMyBikesNoBikesReservedRented, ActiveUser?.Mail)
|
||||
: string.Empty;
|
||||
}
|
||||
}
|
||||
|
@ -101,6 +129,8 @@ namespace TINK.ViewModel.MyBikes
|
|||
/// </summary>
|
||||
public async Task OnAppearing()
|
||||
{
|
||||
IsIdle = false;
|
||||
|
||||
// Get my bikes from COPRI
|
||||
Log.ForContext<MyBikesPageViewModel>().Information("User request to show page MyBikes/ page re-appearing");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue