Version 3.0.294

This commit is contained in:
Oliver Hauff 2022-04-25 22:15:15 +02:00
parent d92fb4a40f
commit 8f40f2c208
133 changed files with 17890 additions and 14246 deletions

View file

@ -17,7 +17,7 @@
<!-- Add more resources here -->
<ResourceDictionary.MergedDictionaries>
<!-- Add more resource dictionaries here -->
<themes:ShareeBike/>
<themes:Konrad/>
<!-- Add more resource dictionaries here -->
</ResourceDictionary.MergedDictionaries>
<!-- Add more resources here -->

View file

@ -11,7 +11,7 @@ namespace TINK.View.BikesAtStation
using System.Threading.Tasks;
using TINK.Model.Device;
#if USEFLYOUT
using TINK.View.MasterDetail;
using TINK.View.MasterDetail;
#endif
using TINK.ViewModel;
using TINK.Model;
@ -33,6 +33,10 @@ using TINK.View.MasterDetail;
{
private BikesAtStationPageViewModel m_oViewModel;
/// <summary> Initialization status to ensure initialization logic is not called multiple times. </summary>
private bool isInitializationStarted = false;
#if TRYNOTBACKSTYLE
public BikesAtStationPage()
{
@ -62,6 +66,10 @@ using TINK.View.MasterDetail;
/// </summary>
protected async override void OnAppearing()
{
// Don't repeat the initialization if it has been completed already.
if (isInitializationStarted) return;
isInitializationStarted = true;
if (m_oViewModel != null)
{
#if BACKSTYLE
@ -72,6 +80,7 @@ using TINK.View.MasterDetail;
// No need to create view model, set binding context an items source if already done.
// If done twice tap events are fired multiple times (when hiding page using home button).
await m_oViewModel.OnAppearing();
isInitializationStarted = false;
return;
}
@ -105,6 +114,7 @@ using TINK.View.MasterDetail;
{
Log.ForContext<BikesAtStationPage>().Error("Displaying bikes at station page failed. {Exception}", exception);
await DisplayAlert("Fehler", $"Seite Räder an Station kann nicht angezeigt werden. ${exception.Message}", "OK");
isInitializationStarted = false;
return;
}
@ -119,6 +129,7 @@ using TINK.View.MasterDetail;
BikesAtStationListView.ItemsSource = m_oViewModel;
await m_oViewModel.OnAppearing();
isInitializationStarted = false;
}
/// <summary>
@ -167,7 +178,7 @@ using TINK.View.MasterDetail;
/// <param name="cancel">Text of button.</param>
/// <returns>True if user pressed accept.</returns>
public new async Task<bool> DisplayAlert(string title, string message, string accept, string cancel)
=> await App.Current.MainPage.DisplayAlert(title, message, accept, cancel);
=> await App.Current.MainPage.DisplayAlert(title, message, accept, cancel);
/// <summary> Displays detailed alert message.</summary>
/// <param name="title">Title of message.</param>
@ -233,5 +244,5 @@ using TINK.View.MasterDetail;
/// <returns>User feedback.</returns>
public async Task<IUserFeedback> DisplayUserFeedbackPopup(string co2Saving = null) => await Navigation.ShowPopupAsync<FeedbackPopup.Result>(new FeedbackPopup(co2Saving));
#endif
}
}
}
}

View file

@ -152,6 +152,7 @@ namespace TINK.View.Map
catch (Exception exception)
{
Log.ForContext<MapPage>().Error("Constructing map page view model failed. {Exception}", exception);
isInitializationStarted = false;
return;
}
@ -166,6 +167,7 @@ namespace TINK.View.Map
catch (Exception exception)
{
Log.ForContext<MapPage>().Error("Setting binding/ navigaton on map page failed. {Exception}", exception);
isInitializationStarted = false;
return;
}
@ -187,6 +189,7 @@ namespace TINK.View.Map
{
// Continue because styling is not essential.
Log.ForContext<MapPage>().Error("Invoking OnAppearing of base failed. {Exception}", exception);
isInitializationStarted = false;
return;
}
@ -205,10 +208,13 @@ namespace TINK.View.Map
{
Log.ForContext<MapPage>().Verbose("Invoking OnAppearing on map page view model.");
await MapPageViewModel.OnAppearing();
isInitializationStarted = false;
}
catch (Exception exception)
{
Log.ForContext<MapPage>().Error("Invoking OnAppearing on map page view model failed. {Exception}", exception);
isInitializationStarted = false;
return;
}
}

View file

@ -11,6 +11,7 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.MyBikes
{
using Serilog;
using TINK.Model;
using TINK.Model.Device;
using TINK.ViewModel.MyBikes;
using Xamarin.CommunityToolkit.Extensions;
@ -39,13 +40,14 @@ namespace TINK.View.MyBikes
{
// Don't repeat the initialization if it has been completed already.
if (isInitializationStarted) return;
isInitializationStarted = true;
isInitializationStarted = true;
if (m_oViewModel != null)
{
// No need to create view model, set binding context an items source if already done.
// If done twice tap events are fired multiple times (when hiding page using home button).
await m_oViewModel.OnAppearing();
isInitializationStarted = false;
return;
}
@ -79,8 +81,8 @@ namespace TINK.View.MyBikes
{
Log.ForContext<MyBikesPage>().Error("Displaying bikes at station page failed. {Exception}", exception);
await DisplayAlert("Fehler", $"Seite Räder an Station kann nicht angezeigt werden. ${exception.Message}", "OK");
isInitializationStarted = false;
return;
}
InitializeComponent();
@ -89,6 +91,7 @@ namespace TINK.View.MyBikes
MyBikesListView.ItemsSource = m_oViewModel;
await m_oViewModel.OnAppearing();
isInitializationStarted = false;
}
/// <summary>