diff --git a/.editorconfig b/.editorconfig
index 3e013bb..cf3a7e8 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -4,21 +4,13 @@
root = true
# All files
[*]
-indent_style = space
-
-# XML project files
-[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
-indent_size = 2
-
-# XML config files
-[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
-indent_size = 2
-
-# Code files
-[*.{cs,csx,vb,vbx}]
-indent_size = 4
+indent_style = tab
+tab_width = 4
insert_final_newline = true
-charset = utf-8-bom
+trim_trailing_whitespace = true
+charset = utf-8
+end_of_line = crlf
+
###############################
# .NET Coding Conventions #
###############################
@@ -139,4 +131,4 @@ csharp_style_expression_bodied_local_functions = false:silent
###############################
[*.vb]
# Modifier preferences
-visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion
\ No newline at end of file
+visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion
diff --git a/LastenradBayern/TINK.Android/MainActivity.cs b/LastenradBayern/TINK.Android/MainActivity.cs
index 033c3dd..1eea213 100644
--- a/LastenradBayern/TINK.Android/MainActivity.cs
+++ b/LastenradBayern/TINK.Android/MainActivity.cs
@@ -13,96 +13,96 @@ using Xamarin.Forms.Platform.Android.AppLinks;
namespace TINK.Droid
{
- [Activity(Label = "LastenradBayern", Icon = "@drawable/sharee", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
+ [Activity(Label = "LastenradBayern", Icon = "@drawable/sharee", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
- [IntentFilter(new[] { Intent.ActionView },
- Categories = new[] { Intent.ActionView, Intent.CategoryBrowsable, Intent.CategoryDefault },
- DataScheme = "https",
- DataHost = "sharee.bike",
- DataPathPrefix = "/lastenrad",
- AutoVerify = true)]
+ [IntentFilter(new[] { Intent.ActionView },
+ Categories = new[] { Intent.ActionView, Intent.CategoryBrowsable, Intent.CategoryDefault },
+ DataScheme = "https",
+ DataHost = "sharee.bike",
+ DataPathPrefix = "/lastenrad",
+ AutoVerify = true)]
- [IntentFilter(new[] { Intent.ActionView },
- Categories = new[] { Intent.ActionView, Intent.CategoryBrowsable, Intent.CategoryDefault },
- DataScheme = "http",
- DataHost = "sharee.bike",
- DataPathPrefix = "/lastenrad",
- AutoVerify = true)]
+ [IntentFilter(new[] { Intent.ActionView },
+ Categories = new[] { Intent.ActionView, Intent.CategoryBrowsable, Intent.CategoryDefault },
+ DataScheme = "http",
+ DataHost = "sharee.bike",
+ DataPathPrefix = "/lastenrad",
+ AutoVerify = true)]
- public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
- {
- private void initFontScale()
- {
- Configuration configuration = Resources.Configuration;
- configuration.FontScale = (float)1;
- //0.85 small, 1 standard, 1.15 big,1.3 more bigger ,1.45 supper big
- DisplayMetrics metrics = new DisplayMetrics();
- WindowManager.DefaultDisplay.GetMetrics(metrics);
- metrics.ScaledDensity = configuration.FontScale * metrics.Density;
- BaseContext.Resources.UpdateConfiguration(configuration, metrics);
- }
- protected override void OnCreate(Bundle bundle)
- {
- initFontScale();
+ public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
+ {
+ private void initFontScale()
+ {
+ Configuration configuration = Resources.Configuration;
+ configuration.FontScale = (float)1;
+ //0.85 small, 1 standard, 1.15 big,1.3 more bigger ,1.45 supper big
+ DisplayMetrics metrics = new DisplayMetrics();
+ WindowManager.DefaultDisplay.GetMetrics(metrics);
+ metrics.ScaledDensity = configuration.FontScale * metrics.Density;
+ BaseContext.Resources.UpdateConfiguration(configuration, metrics);
+ }
+ protected override void OnCreate(Bundle bundle)
+ {
+ initFontScale();
- TabLayoutResource = Resource.Layout.Tabbar;
- ToolbarResource = Resource.Layout.Toolbar;
+ TabLayoutResource = Resource.Layout.Tabbar;
+ ToolbarResource = Resource.Layout.Toolbar;
- base.OnCreate(bundle);
+ base.OnCreate(bundle);
- global::Xamarin.Forms.Forms.Init(this, bundle);
+ global::Xamarin.Forms.Forms.Init(this, bundle);
- FirebaseApp.InitializeApp(this);
- AndroidAppLinks.Init(this);
+ FirebaseApp.InitializeApp(this);
+ AndroidAppLinks.Init(this);
- // Initialize xamarin.essentials, see https://docs.microsoft.com/en-us/xamarin/essentials/get-started?tabs=macos%2Candroid.
- Xamarin.Essentials.Platform.Init(this, bundle);
+ // Initialize xamarin.essentials, see https://docs.microsoft.com/en-us/xamarin/essentials/get-started?tabs=macos%2Candroid.
+ Xamarin.Essentials.Platform.Init(this, bundle);
- // Required for initialization of Maps, see https://developer.xamarin.com/guides/xamarin-forms/user-interface/map/
- Xamarin.FormsGoogleMaps.Init(this, bundle);
+ // Required for initialization of Maps, see https://developer.xamarin.com/guides/xamarin-forms/user-interface/map/
+ Xamarin.FormsGoogleMaps.Init(this, bundle);
- // Required for initialization of binding package, see https://github.com/nuitsjp/Xamarin.Forms.GoogleMaps.Bindings.
- Xamarin.FormsGoogleMapsBindings.Init();
+ // Required for initialization of binding package, see https://github.com/nuitsjp/Xamarin.Forms.GoogleMaps.Bindings.
+ Xamarin.FormsGoogleMapsBindings.Init();
- // Get version name of app.
- Context context = ApplicationContext;
- new Model.Device.AppInfo(context.PackageManager.GetPackageInfo(context.PackageName, 0).VersionName);
+ // Get version name of app.
+ Context context = ApplicationContext;
+ new Model.Device.AppInfo(context.PackageManager.GetPackageInfo(context.PackageName, 0).VersionName);
- Xamarin.Forms.Forms.ViewInitialized += (object sender, Xamarin.Forms.ViewInitializedEventArgs e) =>
- {
- if (!string.IsNullOrWhiteSpace(e.View.AutomationId))
- {
- e.NativeView.ContentDescription = e.View.AutomationId;
- }
- };
+ Xamarin.Forms.Forms.ViewInitialized += (object sender, Xamarin.Forms.ViewInitializedEventArgs e) =>
+ {
+ if (!string.IsNullOrWhiteSpace(e.View.AutomationId))
+ {
+ e.NativeView.ContentDescription = e.View.AutomationId;
+ }
+ };
- LoadApplication(new App());
- }
+ LoadApplication(new App());
+ }
- ///
- /// Handles opening the dialog to request for permissions.
- ///
- public override void OnRequestPermissionsResult(int requestCode, string[] permissions, Android.Content.PM.Permission[] grantResults)
- {
- if (App.PermissionsService.GetType() == typeof(TINK.Services.Permissions.Essentials.Permissions))
- {
- Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
- }
- else if (App.PermissionsService.GetType() == typeof(TINK.Services.Permissions.Plugin.Permissions))
- {
- // Bug in 3.0.244 and earlier versions of sharee.bike app: Call of PermissionsImplementation.Current.OnRequestedPermission result was missing.
- // see https://dev.azure.com/TeilRad/sharee.bike%20Buchungsplattform/_workitems/edit/136 for further details.
- PermissionsImplementation.Current.OnRequestPermissionsResult(requestCode, permissions, grantResults);
- }
+ ///
+ /// Handles opening the dialog to request for permissions.
+ ///
+ public override void OnRequestPermissionsResult(int requestCode, string[] permissions, Android.Content.PM.Permission[] grantResults)
+ {
+ if (App.PermissionsService.GetType() == typeof(TINK.Services.Permissions.Essentials.Permissions))
+ {
+ Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
+ }
+ else if (App.PermissionsService.GetType() == typeof(TINK.Services.Permissions.Plugin.Permissions))
+ {
+ // Bug in 3.0.244 and earlier versions of sharee.bike app: Call of PermissionsImplementation.Current.OnRequestedPermission result was missing.
+ // see https://dev.azure.com/TeilRad/sharee.bike%20Buchungsplattform/_workitems/edit/136 for further details.
+ PermissionsImplementation.Current.OnRequestPermissionsResult(requestCode, permissions, grantResults);
+ }
- base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
- }
+ base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
+ }
- [Export("TapStation")]
- public void TapStation(string stationNr)
- {
- BackdoorMethodHelpers.DoTapPage(stationNr);
- }
- }
+ [Export("TapStation")]
+ public void TapStation(string stationNr)
+ {
+ BackdoorMethodHelpers.DoTapPage(stationNr);
+ }
+ }
}
diff --git a/LastenradBayern/TINK.Android/Model/Device/AppInfo.cs b/LastenradBayern/TINK.Android/Model/Device/AppInfo.cs
index 58b23f0..8febfc6 100644
--- a/LastenradBayern/TINK.Android/Model/Device/AppInfo.cs
+++ b/LastenradBayern/TINK.Android/Model/Device/AppInfo.cs
@@ -6,40 +6,40 @@ using Xamarin.Forms;
[assembly: Dependency(typeof(AppInfo))]
namespace TINK.Droid.Model.Device
{
- /// Holds information about the TINK- app.
- public class AppInfo : IAppInfo
- {
- /// Holds the the version of the app.
- private static Version m_oVersion = null;
+ /// Holds information about the TINK- app.
+ public class AppInfo : IAppInfo
+ {
+ /// Holds the the version of the app.
+ private static Version m_oVersion = null;
- /// Constructs a app info object.
- public AppInfo()
- {
- }
+ /// Constructs a app info object.
+ public AppInfo()
+ {
+ }
- /// Constructs a app info object for initialization.
- /// Version to initializ object with.
- internal AppInfo(string p_strVersionText)
- {
- if (m_oVersion != null)
- {
- // Set version only once.
- return;
- }
+ /// Constructs a app info object for initialization.
+ /// Version to initializ object with.
+ internal AppInfo(string p_strVersionText)
+ {
+ if (m_oVersion != null)
+ {
+ // Set version only once.
+ return;
+ }
- if (!Version.TryParse(p_strVersionText, out Version l_oVersion))
- {
- m_oVersion = new Version(0, 8);
- }
+ if (!Version.TryParse(p_strVersionText, out Version l_oVersion))
+ {
+ m_oVersion = new Version(0, 8);
+ }
- m_oVersion = l_oVersion;
- }
+ m_oVersion = l_oVersion;
+ }
- /// Get the version of the app.
- public Version Version => m_oVersion ?? new Version(0, 9);
+ /// Get the version of the app.
+ public Version Version => m_oVersion ?? new Version(0, 9);
- /// Gets the URL to the app store.
- /// The store URL.
- public string StoreUrl => $"https://play.google.com/store/apps/details?id={Android.App.Application.Context.PackageName}";
- }
+ /// Gets the URL to the app store.
+ /// The store URL.
+ public string StoreUrl => $"https://play.google.com/store/apps/details?id={Android.App.Application.Context.PackageName}";
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK.Android/Model/Device/Device.cs b/LastenradBayern/TINK.Android/Model/Device/Device.cs
index d01840b..d4c162b 100644
--- a/LastenradBayern/TINK.Android/Model/Device/Device.cs
+++ b/LastenradBayern/TINK.Android/Model/Device/Device.cs
@@ -5,19 +5,19 @@ using Xamarin.Forms;
[assembly: Dependency(typeof(TINK.Droid.Model.Device.Device))]
namespace TINK.Droid.Model.Device
{
- public class Device : ISmartDevice
- {
- public string Manufacturer => DeviceInfo.Manufacturer;
+ public class Device : ISmartDevice
+ {
+ public string Manufacturer => DeviceInfo.Manufacturer;
- public string Model => DeviceInfo.Model;
+ public string Model => DeviceInfo.Model;
- public DevicePlatform Platform => DeviceInfo.Platform;
+ public DevicePlatform Platform => DeviceInfo.Platform;
- public string VersionText => DeviceInfo.VersionString;
+ public string VersionText => DeviceInfo.VersionString;
- /// Gets unitque device identifier.
- /// Gets the identifies specifying device.
- public string Identifier
- => Android.Provider.Settings.Secure.GetString(Android.App.Application.Context.ContentResolver, Android.Provider.Settings.Secure.AndroidId);
- }
+ /// Gets unitque device identifier.
+ /// Gets the identifies specifying device.
+ public string Identifier
+ => Android.Provider.Settings.Secure.GetString(Android.App.Application.Context.ContentResolver, Android.Provider.Settings.Secure.AndroidId);
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK.Android/Model/Device/ExternalBrowseService.cs b/LastenradBayern/TINK.Android/Model/Device/ExternalBrowseService.cs
index a971c11..15bb1e6 100644
--- a/LastenradBayern/TINK.Android/Model/Device/ExternalBrowseService.cs
+++ b/LastenradBayern/TINK.Android/Model/Device/ExternalBrowseService.cs
@@ -6,18 +6,18 @@ using Xamarin.Forms;
[assembly: Dependency(typeof(ExternalBrowseService))]
namespace TINK.Droid.Model.Device
{
- public class ExternalBrowseService : IExternalBrowserService
- {
- /// Opens an external browser.
- /// Url to open.
- public void OpenUrl(string p_strUrl)
- {
- var uri = Android.Net.Uri.Parse(p_strUrl);
- var intent = new Intent(Intent.ActionView, uri);
+ public class ExternalBrowseService : IExternalBrowserService
+ {
+ /// Opens an external browser.
+ /// Url to open.
+ public void OpenUrl(string p_strUrl)
+ {
+ var uri = Android.Net.Uri.Parse(p_strUrl);
+ var intent = new Intent(Intent.ActionView, uri);
- intent.AddFlags(ActivityFlags.NewTask);
+ intent.AddFlags(ActivityFlags.NewTask);
- Android.App.Application.Context.StartActivity(intent);
- }
- }
+ Android.App.Application.Context.StartActivity(intent);
+ }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK.Android/Model/Device/Gps.cs b/LastenradBayern/TINK.Android/Model/Device/Gps.cs
index dfa055f..9087413 100644
--- a/LastenradBayern/TINK.Android/Model/Device/Gps.cs
+++ b/LastenradBayern/TINK.Android/Model/Device/Gps.cs
@@ -16,15 +16,15 @@ using Xamarin.Forms;
[assembly: Dependency(typeof(TINK.Droid.Model.Device.Gps))]
namespace TINK.Droid.Model.Device
{
- public class Gps : IGeolodationDependent
- {
- public bool IsGeolcationEnabled
- {
- get
- {
- LocationManager locationManager = (LocationManager)Android.App.Application.Context.GetSystemService(Context.LocationService);
- return locationManager.IsProviderEnabled(LocationManager.GpsProvider);
- }
- }
- }
+ public class Gps : IGeolodationDependent
+ {
+ public bool IsGeolcationEnabled
+ {
+ get
+ {
+ LocationManager locationManager = (LocationManager)Android.App.Application.Context.GetSystemService(Context.LocationService);
+ return locationManager.IsProviderEnabled(LocationManager.GpsProvider);
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK.Android/Model/Device/SpecialFolder.cs b/LastenradBayern/TINK.Android/Model/Device/SpecialFolder.cs
index 3ca8eae..d07b4cb 100644
--- a/LastenradBayern/TINK.Android/Model/Device/SpecialFolder.cs
+++ b/LastenradBayern/TINK.Android/Model/Device/SpecialFolder.cs
@@ -6,44 +6,44 @@ using Xamarin.Forms;
[assembly: Dependency(typeof(TINK.Droid.Model.Device.SpecialFolder))]
namespace TINK.Droid.Model.Device
{
- public class SpecialFolder : ISpecialFolder
- {
- /// Get the folder name of external folder to write to.
- /// Name of the external folder.
- public string GetExternalFilesDir()
- {
- string baseFolderPath = string.Empty;
- try
- {
- var context = Android.App.Application.Context;
- Java.IO.File[] dirs = context.GetExternalFilesDirs(null);
+ public class SpecialFolder : ISpecialFolder
+ {
+ /// Get the folder name of external folder to write to.
+ /// Name of the external folder.
+ public string GetExternalFilesDir()
+ {
+ string baseFolderPath = string.Empty;
+ try
+ {
+ var context = Android.App.Application.Context;
+ Java.IO.File[] dirs = context.GetExternalFilesDirs(null);
- foreach (Java.IO.File folder in dirs)
- {
- bool IsRemovable = Android.OS.Environment.InvokeIsExternalStorageRemovable(folder);
- bool IsEmulated = Android.OS.Environment.InvokeIsExternalStorageEmulated(folder);
+ foreach (Java.IO.File folder in dirs)
+ {
+ bool IsRemovable = Android.OS.Environment.InvokeIsExternalStorageRemovable(folder);
+ bool IsEmulated = Android.OS.Environment.InvokeIsExternalStorageEmulated(folder);
- if (IsRemovable
- && !IsEmulated)
- {
- baseFolderPath = folder.Path;
- }
- }
- }
+ if (IsRemovable
+ && !IsEmulated)
+ {
+ baseFolderPath = folder.Path;
+ }
+ }
+ }
- catch (Exception l_oException)
- {
- Log.Error("Getting external files directory failed. {@l_oException}", l_oException);
- }
+ catch (Exception l_oException)
+ {
+ Log.Error("Getting external files directory failed. {@l_oException}", l_oException);
+ }
- return baseFolderPath;
- }
+ return baseFolderPath;
+ }
- /// Gets the folder name of the personal data folder dir on internal storage.
- /// Directory name.
- public string GetInternalPersonalDir()
- {
- return Environment.GetFolderPath(Environment.SpecialFolder.Personal);
- }
- }
+ /// Gets the folder name of the personal data folder dir on internal storage.
+ /// Directory name.
+ public string GetInternalPersonalDir()
+ {
+ return Environment.GetFolderPath(Environment.SpecialFolder.Personal);
+ }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK.Android/Model/Device/WebView.cs b/LastenradBayern/TINK.Android/Model/Device/WebView.cs
index dacf5dd..409c1c9 100644
--- a/LastenradBayern/TINK.Android/Model/Device/WebView.cs
+++ b/LastenradBayern/TINK.Android/Model/Device/WebView.cs
@@ -4,13 +4,13 @@ using TINK.Model.Device;
[assembly: Xamarin.Forms.Dependency(typeof(TINK.Droid.Model.Device.WebView))]
namespace TINK.Droid.Model.Device
{
- public class WebView : IWebView
- {
- /// Clears the cookie cache for all web views.
- public void ClearCookies()
- {
- var cookieManager = CookieManager.Instance;
- cookieManager.RemoveAllCookie();
- }
- }
+ public class WebView : IWebView
+ {
+ /// Clears the cookie cache for all web views.
+ public void ClearCookies()
+ {
+ var cookieManager = CookieManager.Instance;
+ cookieManager.RemoveAllCookie();
+ }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK.Android/Properties/AndroidManifest.xml b/LastenradBayern/TINK.Android/Properties/AndroidManifest.xml
index d8a024c..3a74495 100644
--- a/LastenradBayern/TINK.Android/Properties/AndroidManifest.xml
+++ b/LastenradBayern/TINK.Android/Properties/AndroidManifest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/LastenradBayern/TINK.iOS/AppDelegate.cs b/LastenradBayern/TINK.iOS/AppDelegate.cs
index 03eaae8..6e4119a 100644
--- a/LastenradBayern/TINK.iOS/AppDelegate.cs
+++ b/LastenradBayern/TINK.iOS/AppDelegate.cs
@@ -4,45 +4,45 @@ using Xamarin.Forms;
namespace TINK.iOS
{
- // The UIApplicationDelegate for the application. This class is responsible for launching the
- // User Interface of the application, as well as listening (and optionally responding) to
- // application events from iOS.
- [Register("AppDelegate")]
- public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
- {
- //
- // This method is invoked when the application has loaded and is ready to run. In this
- // method you should instantiate the window, load the UI into it and then make the window
- // visible.
- //
- // You have 17 seconds to return from this method, or iOS will terminate your application.
- //
- public override bool FinishedLaunching(UIApplication app, NSDictionary options)
- {
- global::Xamarin.Forms.Forms.Init();
+ // The UIApplicationDelegate for the application. This class is responsible for launching the
+ // User Interface of the application, as well as listening (and optionally responding) to
+ // application events from iOS.
+ [Register("AppDelegate")]
+ public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
+ {
+ //
+ // This method is invoked when the application has loaded and is ready to run. In this
+ // method you should instantiate the window, load the UI into it and then make the window
+ // visible.
+ //
+ // You have 17 seconds to return from this method, or iOS will terminate your application.
+ //
+ public override bool FinishedLaunching(UIApplication app, NSDictionary options)
+ {
+ global::Xamarin.Forms.Forms.Init();
- //Color of Icons in Navigation bar (e.g. burger menu and back arrow)
- //UINavigationBar.Appearance.TintColor = Color.White.ToUIColor();
+ //Color of Icons in Navigation bar (e.g. burger menu and back arrow)
+ //UINavigationBar.Appearance.TintColor = Color.White.ToUIColor();
- new iOS.Device.AppInfo(NSBundle.MainBundle.InfoDictionary[new NSString("CFBundleShortVersionString")]?.ToString() ?? string.Empty);
+ new iOS.Device.AppInfo(NSBundle.MainBundle.InfoDictionary[new NSString("CFBundleShortVersionString")]?.ToString() ?? string.Empty);
- Forms.ViewInitialized += (object sender, ViewInitializedEventArgs e) =>
- {
- // http://developer.xamarin.com/recipes/testcloud/set-accessibilityidentifier-ios/
- if (null != e.View.AutomationId)
- {
- e.NativeView.AccessibilityIdentifier = e.View.AutomationId;
- }
- };
- LoadApplication(new TINK.App());
+ Forms.ViewInitialized += (object sender, ViewInitializedEventArgs e) =>
+ {
+ // http://developer.xamarin.com/recipes/testcloud/set-accessibilityidentifier-ios/
+ if (null != e.View.AutomationId)
+ {
+ e.NativeView.AccessibilityIdentifier = e.View.AutomationId;
+ }
+ };
+ LoadApplication(new TINK.App());
- // Required for initialization of Maps, see https://developer.xamarin.com/guides/xamarin-forms/user-interface/map/
- Xamarin.FormsGoogleMaps.Init("000000000000000000000000000000000000000");
+ // Required for initialization of Maps, see https://developer.xamarin.com/guides/xamarin-forms/user-interface/map/
+ Xamarin.FormsGoogleMaps.Init("000000000000000000000000000000000000000");
- // Required for initialization of binding package, see https://github.com/nuitsjp/Xamarin.Forms.GoogleMaps.Bindings.
- Xamarin.FormsGoogleMapsBindings.Init();
+ // Required for initialization of binding package, see https://github.com/nuitsjp/Xamarin.Forms.GoogleMaps.Bindings.
+ Xamarin.FormsGoogleMapsBindings.Init();
- return base.FinishedLaunching(app, options);
- }
- }
+ return base.FinishedLaunching(app, options);
+ }
+ }
}
diff --git a/LastenradBayern/TINK.iOS/Device/AppInfo.cs b/LastenradBayern/TINK.iOS/Device/AppInfo.cs
index 22cec2a..8c62628 100644
--- a/LastenradBayern/TINK.iOS/Device/AppInfo.cs
+++ b/LastenradBayern/TINK.iOS/Device/AppInfo.cs
@@ -7,41 +7,41 @@ using Xamarin.Forms;
[assembly: Dependency(typeof(AppInfo))]
namespace TINK.iOS.Device
{
- /// Holds information about the TINK- app.
- public class AppInfo : IAppInfo
- {
- /// Holds the the version of the app.
- private static Version m_oVersion = null;
+ /// Holds information about the TINK- app.
+ public class AppInfo : IAppInfo
+ {
+ /// Holds the the version of the app.
+ private static Version m_oVersion = null;
- /// Constructs a app info object.
- public AppInfo()
- {
- }
+ /// Constructs a app info object.
+ public AppInfo()
+ {
+ }
- /// Constructs a app info object for initialization.
- /// Version to initializ object with.
- internal AppInfo(string p_strVersionText)
- {
- if (m_oVersion != null)
- {
- // Set version only once.
- return;
- }
+ /// Constructs a app info object for initialization.
+ /// Version to initializ object with.
+ internal AppInfo(string p_strVersionText)
+ {
+ if (m_oVersion != null)
+ {
+ // Set version only once.
+ return;
+ }
- if (!Version.TryParse(p_strVersionText, out Version l_oVersion))
- {
- m_oVersion = new Version(0, 8);
- }
+ if (!Version.TryParse(p_strVersionText, out Version l_oVersion))
+ {
+ m_oVersion = new Version(0, 8);
+ }
- m_oVersion = l_oVersion;
- }
+ m_oVersion = l_oVersion;
+ }
- /// Get the version of the app.
- public Version Version => m_oVersion ?? new Version(0, 9);
+ /// Get the version of the app.
+ public Version Version => m_oVersion ?? new Version(0, 9);
- /// Gets the URL to the app store.
- /// TINK Url was @"http://itunes.apple.com/de/app/tink-konstanz/id1181519270?mt=8"
- /// The store URL.
- public string StoreUrl => $"https://itunes.apple.com/de/app/apple-store/{NSBundle.MainBundle.BundleIdentifier}?mt=8";
- }
+ /// Gets the URL to the app store.
+ /// TINK Url was @"http://itunes.apple.com/de/app/tink-konstanz/id1181519270?mt=8"
+ /// The store URL.
+ public string StoreUrl => $"https://itunes.apple.com/de/app/apple-store/{NSBundle.MainBundle.BundleIdentifier}?mt=8";
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK.iOS/Device/Device.cs b/LastenradBayern/TINK.iOS/Device/Device.cs
index a715f2b..9fc0b4a 100644
--- a/LastenradBayern/TINK.iOS/Device/Device.cs
+++ b/LastenradBayern/TINK.iOS/Device/Device.cs
@@ -6,30 +6,30 @@ using Xamarin.Essentials;
[assembly: Xamarin.Forms.Dependency(typeof(TINK.iOS.Device.Device))]
namespace TINK.iOS.Device
{
- public class Device : ISmartDevice
- {
- [DllImport("/System/Library/Frameworks/IOKit.framework/IOKit")]
- private static extern uint IOServiceGetMatchingService(uint masterPort, IntPtr matching);
+ public class Device : ISmartDevice
+ {
+ [DllImport("/System/Library/Frameworks/IOKit.framework/IOKit")]
+ private static extern uint IOServiceGetMatchingService(uint masterPort, IntPtr matching);
- [DllImport("/System/Library/Frameworks/IOKit.framework/IOKit")]
- private static extern IntPtr IOServiceMatching(string s);
+ [DllImport("/System/Library/Frameworks/IOKit.framework/IOKit")]
+ private static extern IntPtr IOServiceMatching(string s);
- [DllImport("/System/Library/Frameworks/IOKit.framework/IOKit")]
- private static extern IntPtr IORegistryEntryCreateCFProperty(uint entry, IntPtr key, IntPtr allocator, uint options);
+ [DllImport("/System/Library/Frameworks/IOKit.framework/IOKit")]
+ private static extern IntPtr IORegistryEntryCreateCFProperty(uint entry, IntPtr key, IntPtr allocator, uint options);
- [DllImport("/System/Library/Frameworks/IOKit.framework/IOKit")]
- private static extern int IOObjectRelease(uint o);
+ [DllImport("/System/Library/Frameworks/IOKit.framework/IOKit")]
+ private static extern int IOObjectRelease(uint o);
- public string Manufacturer => DeviceInfo.Manufacturer;
+ public string Manufacturer => DeviceInfo.Manufacturer;
- public string Model => DeviceInfo.Model;
+ public string Model => DeviceInfo.Model;
- public DevicePlatform Platform => DeviceInfo.Platform;
+ public DevicePlatform Platform => DeviceInfo.Platform;
- public string VersionText => DeviceInfo.VersionString;
- /// Gets unitque device identifier.
- /// Gets the identifies specifying device.
- public string Identifier
- => UIKit.UIDevice.CurrentDevice?.IdentifierForVendor?.AsString() ?? string.Empty;
- }
+ public string VersionText => DeviceInfo.VersionString;
+ /// Gets unitque device identifier.
+ /// Gets the identifies specifying device.
+ public string Identifier
+ => UIKit.UIDevice.CurrentDevice?.IdentifierForVendor?.AsString() ?? string.Empty;
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK.iOS/Device/ExternalBrowseService.cs b/LastenradBayern/TINK.iOS/Device/ExternalBrowseService.cs
index c9a7998..b0ac186 100644
--- a/LastenradBayern/TINK.iOS/Device/ExternalBrowseService.cs
+++ b/LastenradBayern/TINK.iOS/Device/ExternalBrowseService.cs
@@ -7,17 +7,17 @@ using Xamarin.Forms;
[assembly: Dependency(typeof(ExternalBrowseService))]
namespace TINK.iOS.Device
{
- public class ExternalBrowseService : IExternalBrowserService
- {
- /// Opens an external browser.
- /// Url to open.
- public void OpenUrl(string p_strUrl)
- {
- var l_oUrl = NSUrl.FromString(p_strUrl);
- if (l_oUrl == null)
- return;
+ public class ExternalBrowseService : IExternalBrowserService
+ {
+ /// Opens an external browser.
+ /// Url to open.
+ public void OpenUrl(string p_strUrl)
+ {
+ var l_oUrl = NSUrl.FromString(p_strUrl);
+ if (l_oUrl == null)
+ return;
- UIApplication.SharedApplication.OpenUrl(l_oUrl);
- }
- }
+ UIApplication.SharedApplication.OpenUrl(l_oUrl);
+ }
+ }
}
diff --git a/LastenradBayern/TINK.iOS/Device/Gps.cs b/LastenradBayern/TINK.iOS/Device/Gps.cs
index 6728593..21c425b 100644
--- a/LastenradBayern/TINK.iOS/Device/Gps.cs
+++ b/LastenradBayern/TINK.iOS/Device/Gps.cs
@@ -3,8 +3,8 @@
[assembly: Xamarin.Forms.Dependency(typeof(TINK.iOS.Device.Gps))]
namespace TINK.iOS.Device
{
- public class Gps : IGeolodationDependent
- {
- public bool IsGeolcationEnabled => true;
- }
+ public class Gps : IGeolodationDependent
+ {
+ public bool IsGeolcationEnabled => true;
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK.iOS/Device/SpecialFolder.cs b/LastenradBayern/TINK.iOS/Device/SpecialFolder.cs
index 9434b04..5230371 100644
--- a/LastenradBayern/TINK.iOS/Device/SpecialFolder.cs
+++ b/LastenradBayern/TINK.iOS/Device/SpecialFolder.cs
@@ -5,23 +5,23 @@ using Xamarin.Forms;
[assembly: Dependency(typeof(TINK.iOS.Device.SpecialFolder))]
namespace TINK.iOS.Device
{
- public class SpecialFolder : ISpecialFolder
- {
- ///
- /// Get the folder name of external folder to write to.
- ///
- ///
- public string GetExternalFilesDir()
- {
- return Environment.GetFolderPath(Environment.SpecialFolder.Personal);
- }
+ public class SpecialFolder : ISpecialFolder
+ {
+ ///
+ /// Get the folder name of external folder to write to.
+ ///
+ ///
+ public string GetExternalFilesDir()
+ {
+ return Environment.GetFolderPath(Environment.SpecialFolder.Personal);
+ }
- /// Gets the folder name of the personal data folder dir on internal storage.
- /// Directory name.
- public string GetInternalPersonalDir()
- {
- return Environment.GetFolderPath(Environment.SpecialFolder.Personal);
- }
+ /// Gets the folder name of the personal data folder dir on internal storage.
+ /// Directory name.
+ public string GetInternalPersonalDir()
+ {
+ return Environment.GetFolderPath(Environment.SpecialFolder.Personal);
+ }
- }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK.iOS/Device/WebView.cs b/LastenradBayern/TINK.iOS/Device/WebView.cs
index 5a5a5cb..f490266 100644
--- a/LastenradBayern/TINK.iOS/Device/WebView.cs
+++ b/LastenradBayern/TINK.iOS/Device/WebView.cs
@@ -5,14 +5,14 @@ using TINK.Model.Device;
[assembly: Xamarin.Forms.Dependency(typeof(TINK.iOS.Device.WebView))]
namespace TINK.iOS.Device
{
- public class WebView : IWebView
- {
- /// Clears the cookie cache for all web views.
- public void ClearCookies()
- {
- NSHttpCookieStorage CookieStorage = NSHttpCookieStorage.SharedStorage;
- foreach (var cookie in CookieStorage.Cookies)
- CookieStorage.DeleteCookie(cookie);
- }
- }
+ public class WebView : IWebView
+ {
+ /// Clears the cookie cache for all web views.
+ public void ClearCookies()
+ {
+ NSHttpCookieStorage CookieStorage = NSHttpCookieStorage.SharedStorage;
+ foreach (var cookie in CookieStorage.Cookies)
+ CookieStorage.DeleteCookie(cookie);
+ }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK.iOS/Device/iOSCipher.cs b/LastenradBayern/TINK.iOS/Device/iOSCipher.cs
index 4dc6464..fa4a22e 100644
--- a/LastenradBayern/TINK.iOS/Device/iOSCipher.cs
+++ b/LastenradBayern/TINK.iOS/Device/iOSCipher.cs
@@ -5,24 +5,24 @@ using Xamarin.Forms;
[assembly: Dependency(typeof(TINK.iOS.Device.IOSCipher))]
namespace TINK.iOS.Device
{
- public class IOSCipher : ICipher
- {
- /// Encrypt data.
- /// Key to encrypt data.
- /// Data to entrycpt.
- ///
- public byte[] Encrypt(byte[] key, byte[] clear)
- {
- throw new NotSupportedException();
- }
+ public class IOSCipher : ICipher
+ {
+ /// Encrypt data.
+ /// Key to encrypt data.
+ /// Data to entrycpt.
+ ///
+ public byte[] Encrypt(byte[] key, byte[] clear)
+ {
+ throw new NotSupportedException();
+ }
- /// Decrypt data.
- /// Key to decrypt data with.
- /// Encrpyted data to decrypt.
- /// Decrypted data.
- public byte[] Decrypt(byte[] key, byte[] encrypted)
- {
- throw new NotSupportedException();
- }
- }
+ /// Decrypt data.
+ /// Key to decrypt data with.
+ /// Encrpyted data to decrypt.
+ /// Decrypted data.
+ public byte[] Decrypt(byte[] key, byte[] encrypted)
+ {
+ throw new NotSupportedException();
+ }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK.iOS/Info.plist b/LastenradBayern/TINK.iOS/Info.plist
index ba26e6a..1df5dc7 100644
--- a/LastenradBayern/TINK.iOS/Info.plist
+++ b/LastenradBayern/TINK.iOS/Info.plist
@@ -1,4 +1,4 @@
-
+
@@ -6,8 +6,8 @@
bluetooth-peripheral
- UIUserInterfaceStyle
- Light
+ UIUserInterfaceStyle
+ Light
UIDeviceFamily
1
@@ -47,7 +47,7 @@
NSLocationAlwaysAndWhenInUseUsageDescription
Location access is needed to show map at current position and pass position to server when returning bikes.
MinimumOSVersion
- 9.0
+ 13.0
NSLocationWhenInUseUsageDescription
Location access is needed to show map at current position and pass position to server when returning bikes.
CFBundleIdentifier
@@ -55,8 +55,8 @@
CFBundleDisplayName
LastenradBayern
CFBundleVersion
- 337
+ 338
CFBundleShortVersionString
- 3.0.337
+ 3.0.338
diff --git a/LastenradBayern/TINK.iOS/LastenradBayern.iOS.csproj b/LastenradBayern/TINK.iOS/LastenradBayern.iOS.csproj
index 7a335e8..3d6a35d 100644
--- a/LastenradBayern/TINK.iOS/LastenradBayern.iOS.csproj
+++ b/LastenradBayern/TINK.iOS/LastenradBayern.iOS.csproj
@@ -24,7 +24,7 @@
prompt
4
false
- i386, x86_64
+ x86_64
None
true
VS: com.TeilRad.LastenradBayern Development
@@ -37,8 +37,8 @@
__IOS__;__MOBILE__;__UNIFIED__
prompt
4
- None
- i386, x86_64
+ SdkOnly
+ x86_64
false
VS: com.TeilRad.LastenradBayern Development
Apple Development: Oliver Hauff (8SZ7J9P24J)
@@ -52,11 +52,11 @@
prompt
4
false
- ARMv7, ARM64
+ ARM64
Apple Development: Oliver Hauff (8SZ7J9P24J)
true
Entitlements.plist
- None
+ SdkOnly
-all
VS: com.TeilRad.LastenradBayern Development
@@ -67,7 +67,7 @@
__IOS__;__MOBILE__;__UNIFIED__
prompt
4
- ARMv7, ARM64
+ ARM64
false
Apple Development: Oliver Hauff (8SZ7J9P24J)
Entitlements.plist
@@ -77,6 +77,7 @@
SdkOnly
+ 15.5
none
@@ -202,10 +203,10 @@
1.7.3
- 3.3.0
+ 5.0.0
-
+
0.7.124
diff --git a/LastenradBayern/TINK.iOS/Main.cs b/LastenradBayern/TINK.iOS/Main.cs
index c766ee2..7a40150 100644
--- a/LastenradBayern/TINK.iOS/Main.cs
+++ b/LastenradBayern/TINK.iOS/Main.cs
@@ -2,14 +2,14 @@
namespace TINK.iOS
{
- public class Application
- {
- // This is the main entry point of the application.
- static void Main(string[] args)
- {
- // if you want to use a different Application Delegate class from "AppDelegate"
- // you can specify it here.
- UIApplication.Main(args, null, "AppDelegate");
- }
- }
+ public class Application
+ {
+ // This is the main entry point of the application.
+ static void Main(string[] args)
+ {
+ // if you want to use a different Application Delegate class from "AppDelegate"
+ // you can specify it here.
+ UIApplication.Main(args, null, "AppDelegate");
+ }
+ }
}
diff --git a/LastenradBayern/TINK/App.xaml.cs b/LastenradBayern/TINK/App.xaml.cs
index 4e05571..b5d306d 100644
--- a/LastenradBayern/TINK/App.xaml.cs
+++ b/LastenradBayern/TINK/App.xaml.cs
@@ -30,166 +30,166 @@ using Arendi.BleLibrary.Local;
[assembly: XamlCompilation(XamlCompilationOptions.Compile)]
namespace TINK
{
- public partial class App : Application
- {
- /// Title of the attachment file.
- private const string ATTACHMENTTITLE = "Diagnostics.txt";
+ public partial class App : Application
+ {
+ /// Title of the attachment file.
+ private const string ATTACHMENTTITLE = "Diagnostics.txt";
- /// Model root.
- private static TinkApp m_oModelRoot;
+ /// Model root.
+ private static TinkApp m_oModelRoot;
- ///
- /// Gets the model root.
- ///
- public static TinkApp ModelRoot
- {
- get
- {
- if (m_oModelRoot != null)
- {
- // Root model already exists, nothing to do.
- return m_oModelRoot;
- }
+ ///
+ /// Gets the model root.
+ ///
+ public static TinkApp ModelRoot
+ {
+ get
+ {
+ if (m_oModelRoot != null)
+ {
+ // Root model already exists, nothing to do.
+ return m_oModelRoot;
+ }
- // Get folder where to read settings from
- var specialFolders = DependencyService.Get();
- var internalPersonalDir = specialFolders.GetInternalPersonalDir();
+ // Get folder where to read settings from
+ var specialFolders = DependencyService.Get();
+ var internalPersonalDir = specialFolders.GetInternalPersonalDir();
- // Delete attachtment from previous session.
- DeleteAttachment(internalPersonalDir);
+ // Delete attachtment from previous session.
+ DeleteAttachment(internalPersonalDir);
- // Setup logger using default settings.
- TinkApp.SetupLogging(
- new LoggingLevelSwitch(Model.Settings.Settings.DEFAULTLOGGINLEVEL),
- internalPersonalDir);
+ // Setup logger using default settings.
+ TinkApp.SetupLogging(
+ new LoggingLevelSwitch(Model.Settings.Settings.DEFAULTLOGGINLEVEL),
+ internalPersonalDir);
- // Subscribe to any unhandled/ unobserved exceptions.
- AppDomain.CurrentDomain.UnhandledException += (sender, unobservedTaskExceptionEventArgs) => { Log.Fatal("Unobserved task exception: {Exception}", unobservedTaskExceptionEventArgs.ExceptionObject); };
- TaskScheduler.UnobservedTaskException += (sender, unhandledExceptionEventArgs) => { Log.Fatal("Unhandled exception: {Exception}", unhandledExceptionEventArgs.Exception); };
+ // Subscribe to any unhandled/ unobserved exceptions.
+ AppDomain.CurrentDomain.UnhandledException += (sender, unobservedTaskExceptionEventArgs) => { Log.Fatal("Unobserved task exception: {Exception}", unobservedTaskExceptionEventArgs.ExceptionObject); };
+ TaskScheduler.UnobservedTaskException += (sender, unhandledExceptionEventArgs) => { Log.Fatal("Unhandled exception: {Exception}", unhandledExceptionEventArgs.Exception); };
- // Restore last model state from json- file.
- Dictionary settingsJSON = new Dictionary();
- try
- {
- settingsJSON = JsonSettingsDictionary.Deserialize(internalPersonalDir);
- }
- catch (Exception exception)
- {
- Log.Error("Reading application settings from file failed.", exception);
- }
+ // Restore last model state from json- file.
+ Dictionary settingsJSON = new Dictionary();
+ try
+ {
+ settingsJSON = JsonSettingsDictionary.Deserialize(internalPersonalDir);
+ }
+ catch (Exception exception)
+ {
+ Log.Error("Reading application settings from file failed.", exception);
+ }
- Model.Settings.Settings settings;
- try
- {
- settings = new Model.Settings.Settings(
- null, // Turn off filtering for LastenradBayern- context
- null, // Turn off filtering for LastenradBayern- context
- JsonSettingsDictionary.GetCopriHostUri(settingsJSON),
- JsonSettingsDictionary.GetPollingParameters(settingsJSON),
- JsonSettingsDictionary.GetMinimumLoggingLevel(settingsJSON),
- JsonSettingsDictionary.GetIsReportLevelVerbose(settingsJSON),
- JsonSettingsDictionary.GetExpiresAfter(settingsJSON),
- JsonSettingsDictionary.GetActiveLockService(settingsJSON),
- JsonSettingsDictionary.GetConnectTimeout(settingsJSON),
- JsonSettingsDictionary.GetActiveGeolocationService(settingsJSON),
- JsonSettingsDictionary.GetCenterMapToCurrentLocation(settingsJSON),
- Xamarin.Forms.GoogleMaps.MapSpan.FromCenterAndRadius(new Xamarin.Forms.GoogleMaps.Position(49.30881083492271, 11.358449625922889), Xamarin.Forms.GoogleMaps.Distance.FromKilometers(2.9)),
- JsonSettingsDictionary.GetLogToExternalFolder(settingsJSON),
- JsonSettingsDictionary.GetIsSiteCachingOn(settingsJSON),
- JsonSettingsDictionary.GetActiveTheme(settingsJSON) ?? typeof(Themes.LastenradBayern).Name);
- }
- catch (Exception exception)
- {
- Log.Error("Deserializing application settings from dictionary failed.", exception);
- settings = new Model.Settings.Settings();
- }
+ Model.Settings.Settings settings;
+ try
+ {
+ settings = new Model.Settings.Settings(
+ null, // Turn off filtering for LastenradBayern- context
+ null, // Turn off filtering for LastenradBayern- context
+ JsonSettingsDictionary.GetCopriHostUri(settingsJSON),
+ JsonSettingsDictionary.GetPollingParameters(settingsJSON),
+ JsonSettingsDictionary.GetMinimumLoggingLevel(settingsJSON),
+ JsonSettingsDictionary.GetIsReportLevelVerbose(settingsJSON),
+ JsonSettingsDictionary.GetExpiresAfter(settingsJSON),
+ JsonSettingsDictionary.GetActiveLockService(settingsJSON),
+ JsonSettingsDictionary.GetConnectTimeout(settingsJSON),
+ JsonSettingsDictionary.GetActiveGeolocationService(settingsJSON),
+ JsonSettingsDictionary.GetCenterMapToCurrentLocation(settingsJSON),
+ Xamarin.Forms.GoogleMaps.MapSpan.FromCenterAndRadius(new Xamarin.Forms.GoogleMaps.Position(49.30881083492271, 11.358449625922889), Xamarin.Forms.GoogleMaps.Distance.FromKilometers(2.9)),
+ JsonSettingsDictionary.GetLogToExternalFolder(settingsJSON),
+ JsonSettingsDictionary.GetIsSiteCachingOn(settingsJSON),
+ JsonSettingsDictionary.GetActiveTheme(settingsJSON) ?? typeof(Themes.LastenradBayern).Name);
+ }
+ catch (Exception exception)
+ {
+ Log.Error("Deserializing application settings from dictionary failed.", exception);
+ settings = new Model.Settings.Settings();
+ }
- if (settings.MinimumLogEventLevel != Model.Settings.Settings.DEFAULTLOGGINLEVEL
- || settings.LogToExternalFolder)
- {
- // Eigher
- // - logging is not set to default value or
- // - logging is performed to external folder.
- // Need to reconfigure.
- Log.CloseAndFlush(); // Close before modifying logger configuration. Otherwise a sharing vialation occurs.
+ if (settings.MinimumLogEventLevel != Model.Settings.Settings.DEFAULTLOGGINLEVEL
+ || settings.LogToExternalFolder)
+ {
+ // Eigher
+ // - logging is not set to default value or
+ // - logging is performed to external folder.
+ // Need to reconfigure.
+ Log.CloseAndFlush(); // Close before modifying logger configuration. Otherwise a sharing vialation occurs.
- TinkApp.SetupLogging(
- new LoggingLevelSwitch(settings.MinimumLogEventLevel),
- !settings.LogToExternalFolder
- ? internalPersonalDir
- : specialFolders.GetExternalFilesDir());
- }
+ TinkApp.SetupLogging(
+ new LoggingLevelSwitch(settings.MinimumLogEventLevel),
+ !settings.LogToExternalFolder
+ ? internalPersonalDir
+ : specialFolders.GetExternalFilesDir());
+ }
- // Get auth cookie
- Log.Debug("Get auth cookie.");
- IStore store = null;
+ // Get auth cookie
+ Log.Debug("Get auth cookie.");
+ IStore store = null;
- var lastVersion = JsonSettingsDictionary.GetAppVersion(settingsJSON);
- if (new Version(3, 0, 290) <= lastVersion)
- {
- // App versions newer than 3.0.173 stored geolocation service in configuration.
- // Version 3.0.290: Geolocation service "GeolocationService" is no more supported.
- // For this reasons a swich of geolocation service is forced when loading configurations from ealier versions.
- LocationServicesContainer.SetActive(settings.ActiveGeolocationService);
- }
+ var lastVersion = JsonSettingsDictionary.GetAppVersion(settingsJSON);
+ if (new Version(3, 0, 290) <= lastVersion)
+ {
+ // App versions newer than 3.0.173 stored geolocation service in configuration.
+ // Version 3.0.290: Geolocation service "GeolocationService" is no more supported.
+ // For this reasons a swich of geolocation service is forced when loading configurations from ealier versions.
+ LocationServicesContainer.SetActive(settings.ActiveGeolocationService);
+ }
- store = new Store();
+ store = new Store();
- Barrel.ApplicationId = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name;
+ Barrel.ApplicationId = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name;
- var context = SynchronizationContext.Current;
+ var context = SynchronizationContext.Current;
- var appInfoService = DependencyService.Get();
+ var appInfoService = DependencyService.Get();
- const string MERCHANTID = "0000000000";
+ const string MERCHANTID = "0000000000";
- // Create new app instnace.
- Log.Debug("Constructing main model...");
- m_oModelRoot = new TinkApp(
- settings,
- store, // Manages user account
- isConnectedFunc: () => CrossConnectivity.Current.IsConnected,
- connectorFactory: (isConnected, activeUri, sessionCookie, mail, expiresAfter) => ConnectorFactory.Create(
- isConnected,
- activeUri,
- new Repository.AppContextInfo(MERCHANTID, AppFlavor.LastenradBayern.GetDisplayName().Replace(" ", ""), appInfoService.Version),
- CultureInfo.CurrentUICulture.TwoLetterISOLanguageName,
- sessionCookie,
- mail,
- expiresAfter),
- merchantId: MERCHANTID,
- bluetoothService: BluetoothService, /* locksService */
- locationPermissionsService: PermissionsService,
- locationServicesContainer: LocationServicesContainer,
- locksService: null,
- device: DependencyService.Get(),
- specialFolder: specialFolders,
- cipher: new Cipher(),
- new TINK.Services.ThemeNS.Theme(Application.Current.Resources.MergedDictionaries),
- arendiCentral:
+ // Create new app instnace.
+ Log.Debug("Constructing main model...");
+ m_oModelRoot = new TinkApp(
+ settings,
+ store, // Manages user account
+ isConnectedFunc: () => CrossConnectivity.Current.IsConnected,
+ connectorFactory: (isConnected, activeUri, sessionCookie, mail, expiresAfter) => ConnectorFactory.Create(
+ isConnected,
+ activeUri,
+ new Repository.AppContextInfo(MERCHANTID, AppFlavor.LastenradBayern.GetDisplayName().Replace(" ", ""), appInfoService.Version),
+ CultureInfo.CurrentUICulture.TwoLetterISOLanguageName,
+ sessionCookie,
+ mail,
+ expiresAfter),
+ merchantId: MERCHANTID,
+ bluetoothService: BluetoothService, /* locksService */
+ locationPermissionsService: PermissionsService,
+ locationServicesContainer: LocationServicesContainer,
+ locksService: null,
+ device: DependencyService.Get(),
+ specialFolder: specialFolders,
+ cipher: new Cipher(),
+ new TINK.Services.ThemeNS.Theme(Application.Current.Resources.MergedDictionaries),
+ arendiCentral:
#if ARENDI
DependencyService.Get(),
#else
- null,
+ null,
#endif
- postAction: (d, obj) => context.Post(d, obj),
- currentVersion: appInfoService.Version,
- lastVersion: lastVersion,
- whatsNewShownInVersion: JsonSettingsDictionary.GetWhatsNew(settingsJSON) ?? settingsJSON.GetAppVersion(),
- appFlavor: AppFlavor.LastenradBayern);
+ postAction: (d, obj) => context.Post(d, obj),
+ currentVersion: appInfoService.Version,
+ lastVersion: lastVersion,
+ whatsNewShownInVersion: JsonSettingsDictionary.GetWhatsNew(settingsJSON) ?? settingsJSON.GetAppVersion(),
+ flavor: AppFlavor.LastenradBayern);
- Log.Debug("Main model successfully constructed.");
- return m_oModelRoot;
- }
- }
+ Log.Debug("Main model successfully constructed.");
+ return m_oModelRoot;
+ }
+ }
- ///
- /// Entry point of application.
- ///
- public App()
- {
- InitializeComponent();
+ ///
+ /// Entry point of application.
+ ///
+ public App()
+ {
+ InitializeComponent();
#if USEFLYOUT
// Use flyout page.
@@ -197,147 +197,147 @@ namespace TINK
? new View.WhatsNew.WhatsNewPage(() => MainPage = new View.Root.RootPage()) // Show whats new info.
: (Page)new View.Root.RootPage(); // Just start sharee- app
#else
- // Use shell.
- MainPage = ModelRoot.WhatsNew.IsShowRequired
- ? new View.WhatsNew.WhatsNewPage(() => MainPage = new View.RootShell.AppShell()) // Show whats new info.
- : (Page)new View.RootShell.AppShell(); // Just start sharee- app
+ // Use shell.
+ MainPage = ModelRoot.WhatsNew.IsShowRequired
+ ? new View.WhatsNew.WhatsNewPage(() => MainPage = new View.RootShell.AppShell()) // Show whats new info.
+ : (Page)new View.RootShell.AppShell(); // Just start sharee- app
#endif
- }
+ }
- /// Concatenates all log files to a single one.
- /// Full file name of attachment.
- public static string CreateAttachment()
- {
- var sessionLogFiles = Log.Logger.GetLogFiles().ToArray();
+ /// Concatenates all log files to a single one.
+ /// Full file name of attachment.
+ public static string CreateAttachment()
+ {
+ var sessionLogFiles = Log.Logger.GetLogFiles().ToArray();
- if (sessionLogFiles.Length < 1)
- {
- // Either
- // - there is no logging file
- // - an error occurred getting list of log files.
- return string.Empty;
- }
+ if (sessionLogFiles.Length < 1)
+ {
+ // Either
+ // - there is no logging file
+ // - an error occurred getting list of log files.
+ return string.Empty;
+ }
- var fullLogFileName = System.IO.Path.Combine(ModelRoot.LogFileParentFolder, ATTACHMENTTITLE);
+ var fullLogFileName = System.IO.Path.Combine(ModelRoot.LogFileParentFolder, ATTACHMENTTITLE);
- // Stop logging to avoid file access exception.
- Log.CloseAndFlush();
+ // Stop logging to avoid file access exception.
+ Log.CloseAndFlush();
- System.IO.File.WriteAllLines(
- fullLogFileName,
- sessionLogFiles.SelectMany(name =>
- (new List { $"{{\"SessionFileName\":\"{name}\"}}" })
- .Concat(System.IO.File.ReadLines(name).ToArray())));
+ System.IO.File.WriteAllLines(
+ fullLogFileName,
+ sessionLogFiles.SelectMany(name =>
+ (new List { $"{{\"SessionFileName\":\"{name}\"}}" })
+ .Concat(System.IO.File.ReadLines(name).ToArray())));
- // Resume logging
- TinkApp.SetupLogging(
- ModelRoot.Level,
- ModelRoot.LogFileParentFolder);
+ // Resume logging
+ TinkApp.SetupLogging(
+ ModelRoot.Level,
+ ModelRoot.LogFileParentFolder);
- return fullLogFileName;
- }
+ return fullLogFileName;
+ }
- /// Deletes an attachment if there is one.
- /// Folder to delete, is null folder is queried from model.
- private static void DeleteAttachment(string folder = null)
- {
- var attachment = System.IO.Path.Combine(folder ?? ModelRoot.LogFileParentFolder, ATTACHMENTTITLE);
- if (!System.IO.File.Exists(attachment))
- {
- // No attachment found.
- return;
- }
+ /// Deletes an attachment if there is one.
+ /// Folder to delete, is null folder is queried from model.
+ private static void DeleteAttachment(string folder = null)
+ {
+ var attachment = System.IO.Path.Combine(folder ?? ModelRoot.LogFileParentFolder, ATTACHMENTTITLE);
+ if (!System.IO.File.Exists(attachment))
+ {
+ // No attachment found.
+ return;
+ }
- System.IO.File.Delete(attachment);
- }
+ System.IO.File.Delete(attachment);
+ }
- protected override void OnSleep()
- {
- // Handle when your app sleeps
- Log.CloseAndFlush();
- }
+ protected override void OnSleep()
+ {
+ // Handle when your app sleeps
+ Log.CloseAndFlush();
+ }
- protected override void OnResume()
- {
- DeleteAttachment();
+ protected override void OnResume()
+ {
+ DeleteAttachment();
- TinkApp.SetupLogging(
- ModelRoot.Level,
- ModelRoot.LogFileParentFolder);
- }
+ TinkApp.SetupLogging(
+ ModelRoot.Level,
+ ModelRoot.LogFileParentFolder);
+ }
- /// The URI for the request.
- /// Overriden to respond when the user initiates an app link request.
- protected override void OnAppLinkRequestReceived(Uri uri)
- {
- base.OnAppLinkRequestReceived(uri);
- if (uri.Host.ToLower() == "sharee.bike")
- {
- // Input e.g. sharee.bike/sharee?lat=49.921&long=32.51
- Array segments = Array.ConvertAll(uri.Segments, segment => segment.Replace("/", "")).Skip(1).ToArray();
- if (uri.Query.Length > 0)
- {
- Dictionary queryDict = uri.Query
- .Substring(1)
- .Split("&")
- .Select(query => query.Split('='))
- .ToDictionary(query => query.FirstOrDefault(), query => query.Skip(1).FirstOrDefault());
- }
- // segments == ["sharee"]
- // queryDict == [{["lat", "49.921"]}], {["long", "32.51"]}]
- // => Navigate and pass params depending on linkinput
- // If no custom navigation is configured, the app just opens as if the user opened it
- }
- }
+ /// The URI for the request.
+ /// Overriden to respond when the user initiates an app link request.
+ protected override void OnAppLinkRequestReceived(Uri uri)
+ {
+ base.OnAppLinkRequestReceived(uri);
+ if (uri.Host.ToLower() == "sharee.bike")
+ {
+ // Input e.g. sharee.bike/sharee?lat=49.921&long=32.51
+ Array segments = Array.ConvertAll(uri.Segments, segment => segment.Replace("/", "")).Skip(1).ToArray();
+ if (uri.Query.Length > 0)
+ {
+ Dictionary queryDict = uri.Query
+ .Substring(1)
+ .Split("&")
+ .Select(query => query.Split('='))
+ .ToDictionary(query => query.FirstOrDefault(), query => query.Skip(1).FirstOrDefault());
+ }
+ // segments == ["sharee"]
+ // queryDict == [{["lat", "49.921"]}], {["long", "32.51"]}]
+ // => Navigate and pass params depending on linkinput
+ // If no custom navigation is configured, the app just opens as if the user opened it
+ }
+ }
- /// Gets the current logging level.
- ///
- private static LogEventLevel GetCurrentLogEventLevel()
- {
- foreach (LogEventLevel level in Enum.GetValues(typeof(LogEventLevel)))
- {
- if (Log.IsEnabled(level))
- return level;
- }
+ /// Gets the current logging level.
+ ///
+ private static LogEventLevel GetCurrentLogEventLevel()
+ {
+ foreach (LogEventLevel level in Enum.GetValues(typeof(LogEventLevel)))
+ {
+ if (Log.IsEnabled(level))
+ return level;
+ }
- return LogEventLevel.Error;
- }
+ return LogEventLevel.Error;
+ }
- ///
- /// Holds the permission service instance.
- ///
- private static ILocationPermission _PermissionsService = null;
+ ///
+ /// Holds the permission service instance.
+ ///
+ private static ILocationPermission _PermissionsService = null;
- ///
- /// Service to manage permissions (location) of the app.
- ///
- public static ILocationPermission PermissionsService
- {
- get
- {
- if (_PermissionsService != null)
- return _PermissionsService;
+ ///
+ /// Service to manage permissions (location) of the app.
+ ///
+ public static ILocationPermission PermissionsService
+ {
+ get
+ {
+ if (_PermissionsService != null)
+ return _PermissionsService;
- _PermissionsService = new TINK.Services.Permissions.Essentials.Permissions();
- return _PermissionsService;
- }
- }
+ _PermissionsService = new TINK.Services.Permissions.Essentials.Permissions();
+ return _PermissionsService;
+ }
+ }
- /// Service to manage bluetooth stack.
- public static Plugin.BLE.Abstractions.Contracts.IBluetoothLE BluetoothService => Plugin.BLE.CrossBluetoothLE.Current;
+ /// Service to manage bluetooth stack.
+ public static Plugin.BLE.Abstractions.Contracts.IBluetoothLE BluetoothService => Plugin.BLE.CrossBluetoothLE.Current;
- ///
- /// Service container to manage geolocation services.
- ///
- public static IServicesContainer LocationServicesContainer { get; }
- = new ServicesContainerMutableT(
- new HashSet {
- new LastKnownGeolocationService(DependencyService.Get()),
- new SimulatedGeolocationService(DependencyService.Get()),
- new GeolocationAccuracyMediumService(DependencyService.Get()),
- new GeolocationAccuracyHighService(DependencyService.Get()),
- new GeolocationAccuracyBestService(DependencyService.Get())},
- Model.Settings.Settings.DefaultLocationService.FullName);
- }
+ ///
+ /// Service container to manage geolocation services.
+ ///
+ public static IServicesContainer LocationServicesContainer { get; }
+ = new ServicesContainerMutableT(
+ new HashSet {
+ new LastKnownGeolocationService(DependencyService.Get()),
+ new SimulatedGeolocationService(DependencyService.Get()),
+ new GeolocationAccuracyMediumService(DependencyService.Get()),
+ new GeolocationAccuracyHighService(DependencyService.Get()),
+ new GeolocationAccuracyBestService(DependencyService.Get())},
+ Model.Settings.Settings.DefaultLocationService.FullName);
+ }
}
diff --git a/LastenradBayern/TINK/BackdoorMethodHelpers.cs b/LastenradBayern/TINK/BackdoorMethodHelpers.cs
index 068f5ac..f8dd015 100644
--- a/LastenradBayern/TINK/BackdoorMethodHelpers.cs
+++ b/LastenradBayern/TINK/BackdoorMethodHelpers.cs
@@ -5,34 +5,34 @@ using Xamarin.Forms;
namespace TINK
{
- public static class BackdoorMethodHelpers
- {
- public static void DoTapPage(string stationId)
- {
- Serilog.Log.Information($"Request via backdoor to tap station {stationId}.");
- var currentPage = GetCurrentPage();
- var mapPageViewModel = (currentPage as MapPage)?.BindingContext as MapPageViewModel;
- if (mapPageViewModel == null)
- {
- Serilog.Log.Error($"Request via backdoor to tap station {stationId} aborted because current page is not of expected type {typeof(MapPage).Name}. Type detected is {currentPage.GetType().Name}.");
- return;
- }
+ public static class BackdoorMethodHelpers
+ {
+ public static void DoTapPage(string stationId)
+ {
+ Serilog.Log.Information($"Request via backdoor to tap station {stationId}.");
+ var currentPage = GetCurrentPage();
+ var mapPageViewModel = (currentPage as MapPage)?.BindingContext as MapPageViewModel;
+ if (mapPageViewModel == null)
+ {
+ Serilog.Log.Error($"Request via backdoor to tap station {stationId} aborted because current page is not of expected type {typeof(MapPage).Name}. Type detected is {currentPage.GetType().Name}.");
+ return;
+ }
- Serilog.Log.Information($"Invoking member to tap.");
- mapPageViewModel?.OnStationClicked(stationId);
- }
+ Serilog.Log.Information($"Invoking member to tap.");
+ mapPageViewModel?.OnStationClicked(stationId);
+ }
- /// Gets the current page assumed that app is master detail page.
- ///
- static Page GetCurrentPage()
- {
+ /// Gets the current page assumed that app is master detail page.
+ ///
+ static Page GetCurrentPage()
+ {
#if USEFLYOUT
return (Application.Current.MainPage as FlyoutPage)?.Detail.Navigation.NavigationStack.LastOrDefault();
#else
- return Shell.Current.CurrentPage;
+ return Shell.Current.CurrentPage;
#endif
- }
+ }
- }
+ }
}
diff --git a/LastenradBayern/TINK/Model/Device/SpecialFolder.cs b/LastenradBayern/TINK/Model/Device/SpecialFolder.cs
index 811664e..3a90f3f 100644
--- a/LastenradBayern/TINK/Model/Device/SpecialFolder.cs
+++ b/LastenradBayern/TINK/Model/Device/SpecialFolder.cs
@@ -3,22 +3,22 @@ using Xamarin.Forms;
namespace TINK.Model.Device
{
- public class SpecialFolder : ISpecialFolder
- {
- ///
- /// Get the folder name of external folder to write to.
- ///
- ///
- public string GetExternalFilesDir()
- {
- return DependencyService.Get().GetExternalFilesDir();
- }
+ public class SpecialFolder : ISpecialFolder
+ {
+ ///
+ /// Get the folder name of external folder to write to.
+ ///
+ ///
+ public string GetExternalFilesDir()
+ {
+ return DependencyService.Get().GetExternalFilesDir();
+ }
- /// Gets the folder name of the personal data folder dir on internal storage.
- /// Directory name.
- public string GetInternalPersonalDir()
- {
- return DependencyService.Get().GetInternalPersonalDir();
- }
- }
+ /// Gets the folder name of the personal data folder dir on internal storage.
+ /// Directory name.
+ public string GetInternalPersonalDir()
+ {
+ return DependencyService.Get().GetInternalPersonalDir();
+ }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK/View/Account/AccountPage.xaml.cs b/LastenradBayern/TINK/View/Account/AccountPage.xaml.cs
index 4216b3e..d470451 100644
--- a/LastenradBayern/TINK/View/Account/AccountPage.xaml.cs
+++ b/LastenradBayern/TINK/View/Account/AccountPage.xaml.cs
@@ -12,80 +12,80 @@ using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
namespace TINK.View.Account
{
- [XamlCompilation(XamlCompilationOptions.Compile)]
+ [XamlCompilation(XamlCompilationOptions.Compile)]
#if USEFLYOUT
public partial class AccountPage : ContentPage, IViewService, IDetailPage
#else
- public partial class AccountPage : ContentPage, IViewService
+ public partial class AccountPage : ContentPage, IViewService
#endif
- {
- /// Refernce to view model.
- AccountPageViewModel m_oViewModel = null;
+ {
+ /// Refernce to view model.
+ AccountPageViewModel m_oViewModel = null;
- /// Constructs a account page.
- public AccountPage()
- {
- InitializeComponent();
+ /// Constructs a account page.
+ public AccountPage()
+ {
+ InitializeComponent();
- var l_oModel = App.ModelRoot;
+ var l_oModel = App.ModelRoot;
- m_oViewModel = new AccountPageViewModel(
- l_oModel,
- (url) => DependencyService.Get().OpenUrl(url),
- this);
+ m_oViewModel = new AccountPageViewModel(
+ l_oModel,
+ (url) => DependencyService.Get().OpenUrl(url),
+ this);
- BindingContext = m_oViewModel;
- }
+ BindingContext = m_oViewModel;
+ }
- /// Displays alert message.
- /// Title of message.
- /// Message to display.
- /// Type of buttons.
- public new async Task DisplayAlert(string title, string message, string cancel)
- => await App.Current.MainPage.DisplayAlert(title, message, cancel);
+ /// Displays alert message.
+ /// Title of message.
+ /// Message to display.
+ /// Type of buttons.
+ public new async Task DisplayAlert(string title, string message, string cancel)
+ => await App.Current.MainPage.DisplayAlert(title, message, cancel);
- /// Displays alert message.
- /// Title of message.
- /// Message to display.
- /// Detailed error description.
- /// Type of buttons.
- public async Task DisplayAdvancedAlert(
- string title,
- string message,
- string details,
- string cancel)
- => await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel);
+ /// Displays alert message.
+ /// Title of message.
+ /// Message to display.
+ /// Detailed error description.
+ /// Type of buttons.
+ public async Task DisplayAdvancedAlert(
+ string title,
+ string message,
+ string details,
+ string cancel)
+ => await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel);
- /// Displays alert message.
- /// Title of message.
- /// Message to display.
- /// Text of accept button.
- /// Text of button.
- /// True if user pressed accept.
- public new async Task DisplayAlert(string title, string message, string accept, string cancel)
- => await App.Current.MainPage.DisplayAlert(title, message, accept, cancel);
+ /// Displays alert message.
+ /// Title of message.
+ /// Message to display.
+ /// Text of accept button.
+ /// Text of button.
+ /// True if user pressed accept.
+ public new async Task DisplayAlert(string title, string message, string accept, string cancel)
+ => await App.Current.MainPage.DisplayAlert(title, message, accept, cancel);
- /// Displays detailed alert message.
- /// Title of message.
- /// Message to display.
- /// Detailed error description.
- /// Text of accept button.
- /// Text of cancel button.
- /// True if user pressed accept.
- public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel)
- => await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel);
+ /// Displays detailed alert message.
+ /// Title of message.
+ /// Message to display.
+ /// Detailed error description.
+ /// Text of accept button.
+ /// Text of cancel button.
+ /// True if user pressed accept.
+ public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel)
+ => await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel);
- ///
- /// Displays an action sheet.
- ///
- /// Title of message.
- /// Message to display.
- /// Text of button.
- ///
- /// Buttons holding options to select.
- /// Text selected
- public new async Task DisplayActionSheet(String title, String cancel, String destruction, params String[] p_oButtons)
- => await base.DisplayActionSheet(title, cancel, destruction, p_oButtons);
+ ///
+ /// Displays an action sheet.
+ ///
+ /// Title of message.
+ /// Message to display.
+ /// Text of button.
+ ///
+ /// Buttons holding options to select.
+ /// Text selected
+ public new async Task DisplayActionSheet(String title, String cancel, String destruction, params String[] p_oButtons)
+ => await base.DisplayActionSheet(title, cancel, destruction, p_oButtons);
#if USEFLYOUT
///
@@ -95,19 +95,19 @@ namespace TINK.View.Account
public void ShowPage(ViewTypes p_oType, string title = null)
=> m_oNavigation.ShowPage(p_oType.GetViewType(), title);
#else
- /// Shows a page.
- /// Route of the page to show.
- public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route);
+ /// Shows a page.
+ /// Route of the page to show.
+ public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route);
#endif
- /// Pushes a page onto the modal stack.
- /// Page to display.
- public Task PushModalAsync(ViewTypes typeOfPage)
- => Navigation.PushModalAsync((Page)Activator.CreateInstance(typeOfPage.GetViewType()));
+ /// Pushes a page onto the modal stack.
+ /// Page to display.
+ public Task PushModalAsync(ViewTypes typeOfPage)
+ => Navigation.PushModalAsync((Page)Activator.CreateInstance(typeOfPage.GetViewType()));
- /// Pops a page from the modal stack.
- public Task PopModalAsync()
- => throw new NotSupportedException();
+ /// Pops a page from the modal stack.
+ public Task PopModalAsync()
+ => throw new NotSupportedException();
#if USEFLYOUT
@@ -123,34 +123,34 @@ namespace TINK.View.Account
}
#endif
- ///
- /// Invoked when page is shown.
- /// Starts update process.
- ///
- protected async override void OnAppearing()
- => await m_oViewModel.OnAppearing();
- ///
- /// Invoked when pages is closed/ hidden.
- /// Stops update process.
- ///
- protected async override void OnDisappearing()
- {
- if (m_oViewModel == null)
- {
- // View model might be null.
- return;
- }
- await m_oViewModel.OnDisappearing();
- }
+ ///
+ /// Invoked when page is shown.
+ /// Starts update process.
+ ///
+ protected async override void OnAppearing()
+ => await m_oViewModel.OnAppearing();
+ ///
+ /// Invoked when pages is closed/ hidden.
+ /// Stops update process.
+ ///
+ protected async override void OnDisappearing()
+ {
+ if (m_oViewModel == null)
+ {
+ // View model might be null.
+ return;
+ }
+ await m_oViewModel.OnDisappearing();
+ }
- /// Pushes a page onto the stack.
- /// Page to display.
- public async Task PushAsync(ViewTypes p_oTypeOfPage)
- => await Navigation.PushAsync((Page)Activator.CreateInstance(p_oTypeOfPage.GetViewType()));
+ /// Pushes a page onto the stack.
+ /// Page to display.
+ public async Task PushAsync(ViewTypes p_oTypeOfPage)
+ => await Navigation.PushAsync((Page)Activator.CreateInstance(p_oTypeOfPage.GetViewType()));
#if USCSHARP9
public Task DisplayUserFeedbackPopup() => throw new NotSupportedException();
#else
- public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => throw new NotSupportedException();
+ public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => throw new NotSupportedException();
#endif
- }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK/View/Bike/BCBike.xaml.cs b/LastenradBayern/TINK/View/Bike/BCBike.xaml.cs
index 99225d0..b3d8cf4 100644
--- a/LastenradBayern/TINK/View/Bike/BCBike.xaml.cs
+++ b/LastenradBayern/TINK/View/Bike/BCBike.xaml.cs
@@ -9,12 +9,12 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.Bike
{
- [XamlCompilation(XamlCompilationOptions.Compile)]
- public partial class BCBike : ViewCell
- {
- public BCBike()
- {
- InitializeComponent();
- }
- }
+ [XamlCompilation(XamlCompilationOptions.Compile)]
+ public partial class BCBike : ViewCell
+ {
+ public BCBike()
+ {
+ InitializeComponent();
+ }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK/View/Bike/BikeViewCellTemplateSelector.cs b/LastenradBayern/TINK/View/Bike/BikeViewCellTemplateSelector.cs
index f77e9f5..215d21d 100644
--- a/LastenradBayern/TINK/View/Bike/BikeViewCellTemplateSelector.cs
+++ b/LastenradBayern/TINK/View/Bike/BikeViewCellTemplateSelector.cs
@@ -2,24 +2,24 @@
namespace TINK.View.Bike
{
- ///
- /// Selects different templates for different bike types (BordComputer bikes, iLockIt bikes).
- ///
- public class BikeViewCellTemplateSelector : DataTemplateSelector
- {
- DataTemplate bCBike;
- DataTemplate iLockIBike;
+ ///
+ /// Selects different templates for different bike types (BordComputer bikes, iLockIt bikes).
+ ///
+ public class BikeViewCellTemplateSelector : DataTemplateSelector
+ {
+ DataTemplate bCBike;
+ DataTemplate iLockIBike;
- public BikeViewCellTemplateSelector()
- {
- bCBike = new DataTemplate(typeof(BCBike));
- iLockIBike = new DataTemplate(typeof(ILockItBike));
- }
+ public BikeViewCellTemplateSelector()
+ {
+ bCBike = new DataTemplate(typeof(BCBike));
+ iLockIBike = new DataTemplate(typeof(ILockItBike));
+ }
- protected override DataTemplate OnSelectTemplate(object item, BindableObject container)
- => item is TINK.ViewModel.Bikes.Bike.BluetoothLock.BikeViewModel ||
- item is TINK.ViewModel.Bikes.Bike.CopriLock.BikeViewModel
- ? iLockIBike
- : bCBike;
- }
+ protected override DataTemplate OnSelectTemplate(object item, BindableObject container)
+ => item is TINK.ViewModel.Bikes.Bike.BluetoothLock.BikeViewModel ||
+ item is TINK.ViewModel.Bikes.Bike.CopriLock.BikeViewModel
+ ? iLockIBike
+ : bCBike;
+ }
}
diff --git a/LastenradBayern/TINK/View/Bike/ILockItBike.xaml.cs b/LastenradBayern/TINK/View/Bike/ILockItBike.xaml.cs
index bdd09dd..ff2a14f 100644
--- a/LastenradBayern/TINK/View/Bike/ILockItBike.xaml.cs
+++ b/LastenradBayern/TINK/View/Bike/ILockItBike.xaml.cs
@@ -9,36 +9,36 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.Bike
{
- [XamlCompilation(XamlCompilationOptions.Compile)]
- public partial class ILockItBike : ViewCell
- {
- public ILockItBike()
- {
- InitializeComponent();
- }
+ [XamlCompilation(XamlCompilationOptions.Compile)]
+ public partial class ILockItBike : ViewCell
+ {
+ public ILockItBike()
+ {
+ InitializeComponent();
+ }
- protected override void OnBindingContextChanged()
- {
- base.OnBindingContextChanged();
+ protected override void OnBindingContextChanged()
+ {
+ base.OnBindingContextChanged();
- if (Device.RuntimePlatform != Device.iOS)
- // Update of size is only required for iOS.
- return;
+ if (Device.RuntimePlatform != Device.iOS)
+ // Update of size is only required for iOS.
+ return;
- var viewModel = BindingContext as TINK.ViewModel.Bikes.Bike.BluetoothLock.BikeViewModel;
- if (viewModel == null)
- return;
+ var viewModel = BindingContext as TINK.ViewModel.Bikes.Bike.BluetoothLock.BikeViewModel;
+ if (viewModel == null)
+ return;
- viewModel.PropertyChanged += (sender, e) =>
- {
- if (e.PropertyName == nameof(TINK.ViewModel.Bikes.Bike.BC.RequestHandler.Base.IsButtonVisible)
- || e.PropertyName == nameof(TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler.Base.IsLockitButtonVisible))
- {
- // Force update of view cell on iOS.
- // https://hausource.visualstudio.com/TINK/_workitems/edit/132
- ForceUpdateSize();
- }
- };
- }
- }
+ viewModel.PropertyChanged += (sender, e) =>
+ {
+ if (e.PropertyName == nameof(TINK.ViewModel.Bikes.Bike.BC.RequestHandler.Base.IsButtonVisible)
+ || e.PropertyName == nameof(TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler.Base.IsLockitButtonVisible))
+ {
+ // Force update of view cell on iOS.
+ // https://hausource.visualstudio.com/TINK/_workitems/edit/132
+ ForceUpdateSize();
+ }
+ };
+ }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK/View/BikesAtStation/BikesAtStationPage.xaml.cs b/LastenradBayern/TINK/View/BikesAtStation/BikesAtStationPage.xaml.cs
index 9312d9f..5cf8817 100644
--- a/LastenradBayern/TINK/View/BikesAtStation/BikesAtStationPage.xaml.cs
+++ b/LastenradBayern/TINK/View/BikesAtStation/BikesAtStationPage.xaml.cs
@@ -5,38 +5,38 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.BikesAtStation
{
- using System;
- using System.Linq;
- using System.Threading;
- using System.Threading.Tasks;
- using TINK.Model.Device;
+ using System;
+ using System.Linq;
+ using System.Threading;
+ using System.Threading.Tasks;
+ using TINK.Model.Device;
#if USEFLYOUT
using TINK.View.MasterDetail;
#endif
- using TINK.ViewModel;
- using TINK.Model;
- using TINK.Services.BluetoothLock.Tdo;
- using System.Collections.Generic;
- using Serilog;
- using TINK.Services.BluetoothLock;
- using Plugin.BLE;
- using TINK.ViewModel.BikesAtStation;
- using TINK.ViewModel.Bikes;
- using Xamarin.CommunityToolkit.Extensions;
- using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
+ using TINK.ViewModel;
+ using TINK.Model;
+ using TINK.Services.BluetoothLock.Tdo;
+ using System.Collections.Generic;
+ using Serilog;
+ using TINK.Services.BluetoothLock;
+ using Plugin.BLE;
+ using TINK.ViewModel.BikesAtStation;
+ using TINK.ViewModel.Bikes;
+ using Xamarin.CommunityToolkit.Extensions;
+ using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
- [XamlCompilation(XamlCompilationOptions.Compile)]
+ [XamlCompilation(XamlCompilationOptions.Compile)]
#if USEFLYOUT
public partial class BikesAtStationPage : ContentPage, IViewService, IDetailPage
#else
- public partial class BikesAtStationPage : ContentPage, IViewService
+ public partial class BikesAtStationPage : ContentPage, IViewService
#endif
- {
+ {
- private BikesAtStationPageViewModel m_oViewModel;
+ private BikesAtStationPageViewModel m_oViewModel;
- /// Initialization status to ensure initialization logic is not called multiple times.
- private bool isInitializationStarted = false;
+ /// Initialization status to ensure initialization logic is not called multiple times.
+ private bool isInitializationStarted = false;
#if TRYNOTBACKSTYLE
public BikesAtStationPage()
{
@@ -55,140 +55,140 @@ namespace TINK.View.BikesAtStation
}
#else
- public BikesAtStationPage()
- {
- }
+ public BikesAtStationPage()
+ {
+ }
#endif
- ///
- /// Invoked when page is shown.
- /// Starts update process.
- ///
- protected async override void OnAppearing()
- {
- // Don't repeat the initialization if it has been completed already.
- if (isInitializationStarted) return;
- isInitializationStarted = true;
+ ///
+ /// Invoked when page is shown.
+ /// Starts update process.
+ ///
+ 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 (m_oViewModel != null)
+ {
#if BACKSTYLE
// Hide master- detail menu to force user to navigate using back button.
m_oNavigation.IsGestureEnabled = false;
#endif
- // 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;
- }
+ // 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;
+ }
- try
- {
- var model = App.ModelRoot;
+ try
+ {
+ var model = App.ModelRoot;
- // Backup synchronization context when called from GUI-thread.
- var synchronizationContext = SynchronizationContext.Current;
+ // Backup synchronization context when called from GUI-thread.
+ var synchronizationContext = SynchronizationContext.Current;
- m_oViewModel = new BikesAtStationPageViewModel(
- model.ActiveUser,
- App.PermissionsService,
- App.BluetoothService,
- Device.RuntimePlatform,
- model.SelectedStation,
- () => model.GetIsConnected(),
- (isConnected) => model.GetConnector(isConnected),
- App.LocationServicesContainer.Active,
- model.LocksServices.Active,
- model.Polling,
- (url) => DependencyService.Get().OpenUrl(url),
- (d, obj) => synchronizationContext.Post(d, obj),
- model.SmartDevice,
- this)
- {
- IsReportLevelVerbose = model.IsReportLevelVerbose
- };
- }
- catch (Exception exception)
- {
- Log.ForContext().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;
- }
+ m_oViewModel = new BikesAtStationPageViewModel(
+ model.ActiveUser,
+ App.PermissionsService,
+ App.BluetoothService,
+ Device.RuntimePlatform,
+ model.SelectedStation,
+ () => model.GetIsConnected(),
+ (isConnected) => model.GetConnector(isConnected),
+ App.LocationServicesContainer.Active,
+ model.LocksServices.Active,
+ model.Polling,
+ (url) => DependencyService.Get().OpenUrl(url),
+ (d, obj) => synchronizationContext.Post(d, obj),
+ model.SmartDevice,
+ this)
+ {
+ IsReportLevelVerbose = model.IsReportLevelVerbose
+ };
+ }
+ catch (Exception exception)
+ {
+ Log.ForContext().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();
+ InitializeComponent();
#if BACKSTYLE
// Hide master- detail menu to force user to navigate using back button.
m_oNavigation.IsGestureEnabled = false;
#endif
- BindingContext = m_oViewModel;
- BikesAtStationListView.ItemsSource = m_oViewModel;
+ BindingContext = m_oViewModel;
+ BikesAtStationListView.ItemsSource = m_oViewModel;
- await m_oViewModel.OnAppearing();
- isInitializationStarted = false;
- }
+ await m_oViewModel.OnAppearing();
+ isInitializationStarted = false;
+ }
- ///
- /// Invoked when pages is closed/ hidden.
- /// Stops update process.
- ///
- protected async override void OnDisappearing()
- {
- if (m_oViewModel != null)
- {
- // View model might be null.
- await m_oViewModel?.OnDisappearing();
- }
+ ///
+ /// Invoked when pages is closed/ hidden.
+ /// Stops update process.
+ ///
+ protected async override void OnDisappearing()
+ {
+ if (m_oViewModel != null)
+ {
+ // View model might be null.
+ await m_oViewModel?.OnDisappearing();
+ }
#if BACKSTYLE
if (m_oNavigation!= null)
m_oNavigation.IsGestureEnabled = true; // Enables master- detail menu navigation again when page is unloaded.
#endif
- }
+ }
- /// Displays alert message.
- /// Title of message.
- /// Message to display.
- /// Type of buttons.
- public new async Task DisplayAlert(string title, string message, string cancel)
- => await App.Current.MainPage.DisplayAlert(title, message, cancel);
+ /// Displays alert message.
+ /// Title of message.
+ /// Message to display.
+ /// Type of buttons.
+ public new async Task DisplayAlert(string title, string message, string cancel)
+ => await App.Current.MainPage.DisplayAlert(title, message, cancel);
- /// Displays alert message.
- /// Title of message.
- /// Message to display.
- /// Detailed error description.
- /// Type of buttons.
- public async Task DisplayAdvancedAlert(
- string title,
- string message,
- string details,
- string cancel)
- => await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel);
+ /// Displays alert message.
+ /// Title of message.
+ /// Message to display.
+ /// Detailed error description.
+ /// Type of buttons.
+ public async Task DisplayAdvancedAlert(
+ string title,
+ string message,
+ string details,
+ string cancel)
+ => await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel);
- ///
- /// Displays alert message.
- ///
- /// Title of message.
- /// Message to display.
- /// Text of accept button.
- /// Text of button.
- /// True if user pressed accept.
- public new async Task DisplayAlert(string title, string message, string accept, string cancel)
- => await App.Current.MainPage.DisplayAlert(title, message, accept, cancel);
+ ///
+ /// Displays alert message.
+ ///
+ /// Title of message.
+ /// Message to display.
+ /// Text of accept button.
+ /// Text of button.
+ /// True if user pressed accept.
+ public new async Task DisplayAlert(string title, string message, string accept, string cancel)
+ => await App.Current.MainPage.DisplayAlert(title, message, accept, cancel);
- /// Displays detailed alert message.
- /// Title of message.
- /// Message to display.
- /// Detailed error description.
- /// Text of accept button.
- /// Text of cancel button.
- /// True if user pressed accept.
- public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel)
- => await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel);
+ /// Displays detailed alert message.
+ /// Title of message.
+ /// Message to display.
+ /// Detailed error description.
+ /// Text of accept button.
+ /// Text of cancel button.
+ /// True if user pressed accept.
+ public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel)
+ => await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel);
#if USEFLYOUT
@@ -198,27 +198,27 @@ namespace TINK.View.BikesAtStation
public void ShowPage(ViewTypes p_oType, string title = null)
=> m_oNavigation.ShowPage(p_oType.GetViewType(), title);
#else
- /// Shows a page.
- /// Route of the page to show.
- public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route);
+ /// Shows a page.
+ /// Route of the page to show.
+ public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route);
#endif
- /// Pushes a page onto the modal stack.
- /// Page to display.
- public async Task PushModalAsync(ViewTypes typeOfPage)
- => await Navigation.PushModalAsync((Page)Activator.CreateInstance(typeOfPage.GetViewType()));
+ /// Pushes a page onto the modal stack.
+ /// Page to display.
+ public async Task PushModalAsync(ViewTypes typeOfPage)
+ => await Navigation.PushModalAsync((Page)Activator.CreateInstance(typeOfPage.GetViewType()));
- /// Pops a page from the modal stack.
- public Task PopModalAsync()
- {
- throw new NotSupportedException();
- }
+ /// Pops a page from the modal stack.
+ public Task PopModalAsync()
+ {
+ throw new NotSupportedException();
+ }
- public Task PushAsync(ViewTypes p_oTypeOfPage)
- {
- throw new NotImplementedException();
- }
+ public Task PushAsync(ViewTypes p_oTypeOfPage)
+ {
+ throw new NotImplementedException();
+ }
#if USEFLYOUT
///
@@ -239,10 +239,10 @@ namespace TINK.View.BikesAtStation
#if USCSHARP9
public async Task DisplayUserFeedbackPopup() => await Navigation.ShowPopupAsync(new FeedbackPopup());
#else
- /// Displays user feedback popup.
- /// Co2 saving information.
- /// User feedback.
- public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => await Navigation.ShowPopupAsync(new FeedbackPopup(battery, co2Saving));
+ /// Displays user feedback popup.
+ /// Co2 saving information.
+ /// User feedback.
+ public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => await Navigation.ShowPopupAsync(new FeedbackPopup(battery, co2Saving));
#endif
- }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK/View/BoolInverterConverter.cs b/LastenradBayern/TINK/View/BoolInverterConverter.cs
index bbd7296..9fc95cd 100644
--- a/LastenradBayern/TINK/View/BoolInverterConverter.cs
+++ b/LastenradBayern/TINK/View/BoolInverterConverter.cs
@@ -4,16 +4,16 @@ using Xamarin.Forms;
namespace TINK.View
{
- /// Inverts a bool.
- public class BoolInverterConverter : IValueConverter
- {
- /// Inverts a bool.
- /// Bool to invert.
- /// Inverted bool.
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- => value is bool flag && !flag;
+ /// Inverts a bool.
+ public class BoolInverterConverter : IValueConverter
+ {
+ /// Inverts a bool.
+ /// Bool to invert.
+ /// Inverted bool.
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ => value is bool flag && !flag;
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- => value is bool flag && !flag;
- }
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ => value is bool flag && !flag;
+ }
}
diff --git a/LastenradBayern/TINK/View/Contact/ContactPage.xaml b/LastenradBayern/TINK/View/Contact/ContactPage.xaml
index 04f6a90..eca477a 100644
--- a/LastenradBayern/TINK/View/Contact/ContactPage.xaml
+++ b/LastenradBayern/TINK/View/Contact/ContactPage.xaml
@@ -50,7 +50,7 @@
IsVisible="{Binding MailAddressText, Converter={StaticResource StringNotNullOrEmpty_Converter}}"
Text="{Binding MailAddressText}"
IsEnabled="{Binding IsSendMailAvailable}"
- Command="{Binding OnMailRequest}"/>
+ Command="{Binding OnMailToOperatorRequest}"/>
- private ContactPageViewModel ViewModel { get; set; }
+ {
+ /// View model to notify view model if page appears.
+ private ContactPageViewModel ViewModel { get; set; }
- public ContactPage()
- {
- InitializeComponent();
+ public ContactPage()
+ {
+ InitializeComponent();
- ViewModel = new ContactPageViewModel(App.ModelRoot.Uris.ActiveUri,
- AppInfo.Name,
- () => App.CreateAttachment(),
- () => DependencyService.Get().OpenUrl(DependencyService.Get().StoreUrl),
- this);
+ ViewModel = new ContactPageViewModel(
+ App.ModelRoot.Flavor.GetDisplayName(),
+ () => App.CreateAttachment(),
+ () => DependencyService.Get().OpenUrl(DependencyService.Get().StoreUrl),
+ this);
- ContactPageView.BindingContext = ViewModel;
- }
+ ContactPageView.BindingContext = ViewModel;
+ }
- /// Invoked when page is shown.
- protected async override void OnAppearing()
- {
- try
- {
- Log.ForContext().Verbose("OnAppearing...");
+ /// Invoked when page is shown.
+ protected async override void OnAppearing()
+ {
+ try
+ {
+ Log.ForContext().Verbose("OnAppearing...");
- await ViewModel.OnAppearing(App.ModelRoot.SelectedStation);
- }
- catch (Exception exception)
- {
- Log.ForContext().Error("Invoking OnAppearing on view model failed. {Exception}", exception);
- return;
- }
- }
+ await ViewModel.OnAppearing(App.ModelRoot.SelectedStation);
+ }
+ catch (Exception exception)
+ {
+ Log.ForContext().Error("Invoking OnAppearing on view model failed. {Exception}", exception);
+ return;
+ }
+ }
- /// Displays alert message.
- /// Title of message.
- /// Message to display.
- /// Detailed error description.
- /// Type of buttons.
- public async Task DisplayAdvancedAlert(
- string title,
- string message,
- string details,
- string cancel)
- => await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel);
+ /// Displays alert message.
+ /// Title of message.
+ /// Message to display.
+ /// Detailed error description.
+ /// Type of buttons.
+ public async Task DisplayAdvancedAlert(
+ string title,
+ string message,
+ string details,
+ string cancel)
+ => await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel);
- /// Displays detailed alert message.
- /// Title of message.
- /// Message to display.
- /// Detailed error description.
- /// Text of accept button.
- /// Text of cancel button.
- /// True if user pressed accept.
- public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel)
- => await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel);
+ /// Displays detailed alert message.
+ /// Title of message.
+ /// Message to display.
+ /// Detailed error description.
+ /// Text of accept button.
+ /// Text of cancel button.
+ /// True if user pressed accept.
+ public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel)
+ => await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel);
#if USEFLYOUT
public void ShowPage(ViewTypes p_oType, string title = null)
=> NavigationMasterDetail.ShowPage(p_oType.GetViewType(), title);
#else
- /// Shows a page.
- /// Route of the page to show.
- public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route);
+ /// Shows a page.
+ /// Route of the page to show.
+ public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route);
#endif
- /// Pushes a page onto the modal stack.
- /// Page to display.
- public Task PushModalAsync(ViewTypes p_oTypeOfPage)
- {
- throw new NotSupportedException();
- }
+ /// Pushes a page onto the modal stack.
+ /// Page to display.
+ public Task PushModalAsync(ViewTypes p_oTypeOfPage)
+ {
+ throw new NotSupportedException();
+ }
- /// Pops a page from the modal stack.
- public Task PopModalAsync()
- {
- throw new NotSupportedException();
- }
+ /// Pops a page from the modal stack.
+ public Task PopModalAsync()
+ {
+ throw new NotSupportedException();
+ }
- /// Pushes a page onto the stack.
- /// Page to display.
- public async Task PushAsync(ViewTypes typeOfPage)
- {
+ /// Pushes a page onto the stack.
+ /// Page to display.
+ public async Task PushAsync(ViewTypes typeOfPage)
+ {
#if USEFLYOUT
var page = Activator.CreateInstance(typeOfPage.GetViewType()) as IDetailPage;
#else
- var page = Activator.CreateInstance(typeOfPage.GetViewType());
+ var page = Activator.CreateInstance(typeOfPage.GetViewType());
#endif
- if (page == null)
- {
- return;
- }
+ if (page == null)
+ {
+ return;
+ }
#if USEFLYOUT
page.NavigationMasterDetail = NavigationMasterDetail;
#endif
- await Navigation.PushAsync((Page)page);
- }
+ await Navigation.PushAsync((Page)page);
+ }
#if USCSHARP9
public Task DisplayUserFeedbackPopup() => throw new NotSupportedException();
#else
- public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => throw new NotSupportedException();
+ public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => throw new NotSupportedException();
#endif
#if USEFLYOUT
@@ -129,5 +130,5 @@ namespace TINK.View.Contact
///
public INavigationMasterDetail NavigationMasterDetail { set; private get; }
#endif
- }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK/View/Contact/SelectStationPage.xaml.cs b/LastenradBayern/TINK/View/Contact/SelectStationPage.xaml.cs
index 08f0319..c9a7d51 100644
--- a/LastenradBayern/TINK/View/Contact/SelectStationPage.xaml.cs
+++ b/LastenradBayern/TINK/View/Contact/SelectStationPage.xaml.cs
@@ -8,67 +8,67 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.Contact
{
- using Serilog;
- using TINK.Model;
- using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
- using TINK.ViewModel.Contact;
+ using Serilog;
+ using TINK.Model;
+ using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
+ using TINK.ViewModel.Contact;
- [XamlCompilation(XamlCompilationOptions.Compile)]
+ [XamlCompilation(XamlCompilationOptions.Compile)]
#if USEFLYOUT
public partial class SelectStationPage : ContentPage, IViewService, IDetailPage
#else
- public partial class SelectStationPage : ContentPage, IViewService
+ public partial class SelectStationPage : ContentPage, IViewService
#endif
- {
- /// View model to notify about whether page appears or hides.
- private SelectStationPageViewModel SelectStationPageViewModel { get; set; }
+ {
+ /// View model to notify about whether page appears or hides.
+ private SelectStationPageViewModel SelectStationPageViewModel { get; set; }
- public SelectStationPage()
- {
- InitializeComponent();
- }
+ public SelectStationPage()
+ {
+ InitializeComponent();
+ }
- ///
- /// Displays alert message.
- ///
- /// Title of message.
- /// Message to display.
- /// Type of buttons.
- public new async Task DisplayAlert(string title, string message, string cancel)
- => await App.Current.MainPage.DisplayAlert(title, message, cancel);
+ ///
+ /// Displays alert message.
+ ///
+ /// Title of message.
+ /// Message to display.
+ /// Type of buttons.
+ public new async Task DisplayAlert(string title, string message, string cancel)
+ => await App.Current.MainPage.DisplayAlert(title, message, cancel);
- /// Displays alert message.
- /// Title of message.
- /// Message to display.
- /// Detailed error description.
- /// Type of buttons.
- public async Task DisplayAdvancedAlert(
- string title,
- string message,
- string details,
- string cancel)
- => await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel);
+ /// Displays alert message.
+ /// Title of message.
+ /// Message to display.
+ /// Detailed error description.
+ /// Type of buttons.
+ public async Task DisplayAdvancedAlert(
+ string title,
+ string message,
+ string details,
+ string cancel)
+ => await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel);
- /// Displays detailed alert message.
- /// Title of message.
- /// Message to display.
- /// Detailed error description.
- /// Text of accept button.
- /// Text of cancel button.
- /// True if user pressed accept.
- public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel)
- => await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel);
+ /// Displays detailed alert message.
+ /// Title of message.
+ /// Message to display.
+ /// Detailed error description.
+ /// Text of accept button.
+ /// Text of cancel button.
+ /// True if user pressed accept.
+ public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel)
+ => await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel);
- ///
- /// Displays alert message.
- ///
- /// Title of message.
- /// Message to display.
- /// Text of accept button.
- /// Text of button.
- /// True if user pressed accept.
- public new async Task DisplayAlert(string title, string message, string accept, string cancel)
- => await App.Current.MainPage.DisplayAlert(title, message, accept, cancel);
+ ///
+ /// Displays alert message.
+ ///
+ /// Title of message.
+ /// Message to display.
+ /// Text of accept button.
+ /// Text of button.
+ /// True if user pressed accept.
+ public new async Task DisplayAlert(string title, string message, string accept, string cancel)
+ => await App.Current.MainPage.DisplayAlert(title, message, accept, cancel);
#if USEFLYOUT
///
@@ -78,45 +78,45 @@ namespace TINK.View.Contact
public void ShowPage(ViewTypes type, string title = null)
=> NavigationMasterDetail.ShowPage(type.GetViewType(), title);
#else
- /// Shows a page.
- /// Route of the page to show.
- public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route);
+ /// Shows a page.
+ /// Route of the page to show.
+ public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route);
#endif
- /// Pushes a page onto the modal stack.
- /// Type of page to display.
- public async Task PushModalAsync(ViewTypes typeOfPage)
- => await Navigation.PushModalAsync((Page)Activator.CreateInstance(typeOfPage.GetViewType()));
+ /// Pushes a page onto the modal stack.
+ /// Type of page to display.
+ public async Task PushModalAsync(ViewTypes typeOfPage)
+ => await Navigation.PushModalAsync((Page)Activator.CreateInstance(typeOfPage.GetViewType()));
- /// Pops a page from the modal stack.
- public async Task PopModalAsync()
- => await Navigation.PopModalAsync();
+ /// Pops a page from the modal stack.
+ public async Task PopModalAsync()
+ => await Navigation.PopModalAsync();
- /// Pushes a page onto the stack.
- /// Page to display.
- public async Task PushAsync(ViewTypes typeOfPage)
- {
+ /// Pushes a page onto the stack.
+ /// Page to display.
+ public async Task PushAsync(ViewTypes typeOfPage)
+ {
#if USEFLYOUT
var page = Activator.CreateInstance(typeOfPage.GetViewType()) as IDetailPage;
#else
- var page = Activator.CreateInstance(typeOfPage.GetViewType());
+ var page = Activator.CreateInstance(typeOfPage.GetViewType());
#endif
- if (page == null)
- {
- return;
- }
+ if (page == null)
+ {
+ return;
+ }
#if USEFLYOUT
page.NavigationMasterDetail = NavigationMasterDetail;
#endif
- await Navigation.PushAsync((Page)page);
- }
+ await Navigation.PushAsync((Page)page);
+ }
#if USCSHARP9
public Task DisplayUserFeedbackPopup() => throw new NotSupportedException();
#else
- public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => throw new NotSupportedException();
+ public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => throw new NotSupportedException();
#endif
#if USEFLYOUT
@@ -124,86 +124,86 @@ namespace TINK.View.Contact
public INavigationMasterDetail NavigationMasterDetail { private get; set; }
#endif
- ///
- /// Invoked when page is shown.
- /// Starts update process.
- ///
- protected async override void OnAppearing()
- {
- // Pass reference to member Navigation to show bikes at station x dialog.
- try
- {
- Log.ForContext().Verbose("Constructing select station view model.");
+ ///
+ /// Invoked when page is shown.
+ /// Starts update process.
+ ///
+ protected async override void OnAppearing()
+ {
+ // Pass reference to member Navigation to show bikes at station x dialog.
+ try
+ {
+ Log.ForContext().Verbose("Constructing select station view model.");
#if TRYNOTBACKSTYLE
SelectStationPageViewModel = new SelectStationPageViewModel();
#else
- SelectStationPageViewModel = new SelectStationPageViewModel(
- App.ModelRoot,
- App.PermissionsService,
- App.BluetoothService,
- App.LocationServicesContainer.Active,
- (mapspan) => MyMap.MoveToRegion(mapspan),
- this,
- Navigation);
+ SelectStationPageViewModel = new SelectStationPageViewModel(
+ App.ModelRoot,
+ App.PermissionsService,
+ App.BluetoothService,
+ App.LocationServicesContainer.Active,
+ (mapspan) => MyMap.MoveToRegion(mapspan),
+ this,
+ Navigation);
#endif
- }
- catch (Exception exception)
- {
+ }
+ catch (Exception exception)
+ {
- Log.ForContext().Error("Constructing select station view model failed. {Exception}", exception);
- return;
- }
+ Log.ForContext().Error("Constructing select station view model failed. {Exception}", exception);
+ return;
+ }
- try
- {
- BindingContext = SelectStationPageViewModel;
+ try
+ {
+ BindingContext = SelectStationPageViewModel;
#if USEFLYOUT
SelectStationPageViewModel.NavigationMasterDetail = NavigationMasterDetail;
#endif
- }
- catch (Exception exception)
- {
- Log.ForContext().Error("Setting binding/ navigaton on select station failed. {Exception}", exception);
- return;
- }
+ }
+ catch (Exception exception)
+ {
+ Log.ForContext().Error("Setting binding/ navigaton on select station failed. {Exception}", exception);
+ return;
+ }
- try
- {
- base.OnAppearing();
- }
- catch (Exception exception)
- {
- // Continue because styling is not essential.
- Log.ForContext().Error("Invoking OnAppearing of base failed. {Exception}", exception);
- return;
- }
+ try
+ {
+ base.OnAppearing();
+ }
+ catch (Exception exception)
+ {
+ // Continue because styling is not essential.
+ Log.ForContext().Error("Invoking OnAppearing of base failed. {Exception}", exception);
+ return;
+ }
- try
- {
- // Pre move and scanle maps to avoid initial display of map in Rome.
- Log.ForContext().Verbose("Moving and scaling map.");
- SelectStationPageViewModel.MoveAndScale(
- (mapSpan) => MyMap.MoveToRegion(mapSpan),
- App.ModelRoot.Uris.ActiveUri);
- }
- catch (Exception exception)
- {
- // Continue because a map not beeing moved/ scaled is no reason for aborting startup.
- Log.ForContext().Error("Moving and scaling map failed. {Exception}", exception);
- }
+ try
+ {
+ // Pre move and scanle maps to avoid initial display of map in Rome.
+ Log.ForContext().Verbose("Moving and scaling map.");
+ SelectStationPageViewModel.MoveAndScale(
+ (mapSpan) => MyMap.MoveToRegion(mapSpan),
+ App.ModelRoot.Uris.ActiveUri);
+ }
+ catch (Exception exception)
+ {
+ // Continue because a map not beeing moved/ scaled is no reason for aborting startup.
+ Log.ForContext().Error("Moving and scaling map failed. {Exception}", exception);
+ }
- try
- {
- Log.ForContext().Verbose("Invoking OnAppearing on select station view model.");
- await SelectStationPageViewModel.OnAppearing();
- }
- catch (Exception exception)
- {
- Log.ForContext().Error("Invoking OnAppearing on select station view model failed. {Exception}", exception);
- return;
- }
- }
- }
+ try
+ {
+ Log.ForContext().Verbose("Invoking OnAppearing on select station view model.");
+ await SelectStationPageViewModel.OnAppearing();
+ }
+ catch (Exception exception)
+ {
+ Log.ForContext().Error("Invoking OnAppearing on select station view model failed. {Exception}", exception);
+ return;
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK/View/CopriWebView/ManageAccountPage.xaml.cs b/LastenradBayern/TINK/View/CopriWebView/ManageAccountPage.xaml.cs
index 7469312..68feb69 100644
--- a/LastenradBayern/TINK/View/CopriWebView/ManageAccountPage.xaml.cs
+++ b/LastenradBayern/TINK/View/CopriWebView/ManageAccountPage.xaml.cs
@@ -7,53 +7,53 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.CopriWebView
{
- [XamlCompilation(XamlCompilationOptions.Compile)]
- public partial class ManageAccountPage : ContentPage
- {
- public ManageAccountPage()
- {
- InitializeComponent();
+ [XamlCompilation(XamlCompilationOptions.Compile)]
+ public partial class ManageAccountPage : ContentPage
+ {
+ public ManageAccountPage()
+ {
+ InitializeComponent();
- ManageAccount.Navigating += (sender, ev) =>
- {
- if (!ev.Url.ToUpper().EndsWith(".PDF"))
- {
- // Stay inside web view except for downloading pdf- files.
- this.IsEnabled = false;
- ActivityIndicatorLoading.IsVisible = true;
- ActivityIndicatorLoading.IsRunning = true;
- return;
- }
+ ManageAccount.Navigating += (sender, ev) =>
+ {
+ if (!ev.Url.ToUpper().EndsWith(".PDF"))
+ {
+ // Stay inside web view except for downloading pdf- files.
+ this.IsEnabled = false;
+ ActivityIndicatorLoading.IsVisible = true;
+ ActivityIndicatorLoading.IsRunning = true;
+ return;
+ }
- DependencyService.Get().OpenUrl(ev.Url);
- };
+ DependencyService.Get().OpenUrl(ev.Url);
+ };
- ManageAccount.Navigated += (sender, ev) =>
- {
- if (ev.Result == WebNavigationResult.Success)
- {
- this.IsEnabled = true;
- ActivityIndicatorLoading.IsVisible = false;
- ActivityIndicatorLoading.IsRunning = false;
- return;
- }
+ ManageAccount.Navigated += (sender, ev) =>
+ {
+ if (ev.Result == WebNavigationResult.Success)
+ {
+ this.IsEnabled = true;
+ ActivityIndicatorLoading.IsVisible = false;
+ ActivityIndicatorLoading.IsRunning = false;
+ return;
+ }
- Log.ForContext().Error("Navigation did not succeed.{@Event}{@Sender}", ev, sender);
- ManageAccount.Source = new HtmlWebViewSource
- {
- Html = "Kann persönliche Daten nicht anzeigen/ verwalten!
Verbindung mit Internet ok?"
- };
+ Log.ForContext().Error("Navigation did not succeed.{@Event}{@Sender}", ev, sender);
+ ManageAccount.Source = new HtmlWebViewSource
+ {
+ Html = "Kann persönliche Daten nicht anzeigen/ verwalten!
Verbindung mit Internet ok?"
+ };
- this.IsEnabled = true;
- ActivityIndicatorLoading.IsVisible = false;
- ActivityIndicatorLoading.IsRunning = false;
- };
+ this.IsEnabled = true;
+ ActivityIndicatorLoading.IsVisible = false;
+ ActivityIndicatorLoading.IsRunning = false;
+ };
- ManageAccount.BindingContext = new ManageAccountViewModel(
- App.ModelRoot.ActiveUser.SessionCookie,
- Model.TinkApp.MerchantId,
- CultureInfo.CurrentUICulture.TwoLetterISOLanguageName,
- App.ModelRoot.NextActiveUri.Host);
- }
- }
+ ManageAccount.BindingContext = new ManageAccountViewModel(
+ App.ModelRoot.ActiveUser.SessionCookie,
+ Model.TinkApp.MerchantId,
+ CultureInfo.CurrentUICulture.TwoLetterISOLanguageName,
+ App.ModelRoot.NextActiveUri.Host);
+ }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK/View/CopriWebView/PasswordForgottenPage.xaml.cs b/LastenradBayern/TINK/View/CopriWebView/PasswordForgottenPage.xaml.cs
index 666b74c..c906c33 100644
--- a/LastenradBayern/TINK/View/CopriWebView/PasswordForgottenPage.xaml.cs
+++ b/LastenradBayern/TINK/View/CopriWebView/PasswordForgottenPage.xaml.cs
@@ -7,45 +7,45 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.CopriWebView
{
- [XamlCompilation(XamlCompilationOptions.Compile)]
- public partial class PasswordForgottenPage : ContentPage
- {
- public PasswordForgottenPage()
- {
- InitializeComponent();
+ [XamlCompilation(XamlCompilationOptions.Compile)]
+ public partial class PasswordForgottenPage : ContentPage
+ {
+ public PasswordForgottenPage()
+ {
+ InitializeComponent();
- PasswordForgottenWebView.Navigating += (sender, ev) =>
- {
- this.IsEnabled = false;
- ActivityIndicatorLoading.IsVisible = true;
- ActivityIndicatorLoading.IsRunning = true;
- };
+ PasswordForgottenWebView.Navigating += (sender, ev) =>
+ {
+ this.IsEnabled = false;
+ ActivityIndicatorLoading.IsVisible = true;
+ ActivityIndicatorLoading.IsRunning = true;
+ };
- PasswordForgottenWebView.Navigated += (sender, ev) =>
- {
- if (ev.Result == WebNavigationResult.Success)
- {
- this.IsEnabled = true;
- ActivityIndicatorLoading.IsVisible = false;
- ActivityIndicatorLoading.IsRunning = false;
- return;
- }
+ PasswordForgottenWebView.Navigated += (sender, ev) =>
+ {
+ if (ev.Result == WebNavigationResult.Success)
+ {
+ this.IsEnabled = true;
+ ActivityIndicatorLoading.IsVisible = false;
+ ActivityIndicatorLoading.IsRunning = false;
+ return;
+ }
- Log.ForContext().Error("Navigation did not succeed. {@Event}", ev);
- PasswordForgottenWebView.Source = new HtmlWebViewSource
- {
- Html = "Kann Passwort vergessen Seite nicht anzeigen!
Verbindung mit Internet ok?"
- };
+ Log.ForContext().Error("Navigation did not succeed. {@Event}", ev);
+ PasswordForgottenWebView.Source = new HtmlWebViewSource
+ {
+ Html = "Kann Passwort vergessen Seite nicht anzeigen!
Verbindung mit Internet ok?"
+ };
- this.IsEnabled = true;
- ActivityIndicatorLoading.IsVisible = false;
- ActivityIndicatorLoading.IsRunning = false;
- };
+ this.IsEnabled = true;
+ ActivityIndicatorLoading.IsVisible = false;
+ ActivityIndicatorLoading.IsRunning = false;
+ };
- PasswordForgottenWebView.BindingContext = new PasswordForgottonViewModel(
- Model.TinkApp.MerchantId,
- CultureInfo.CurrentUICulture.TwoLetterISOLanguageName,
- App.ModelRoot.NextActiveUri.Host);
- }
- }
+ PasswordForgottenWebView.BindingContext = new PasswordForgottonViewModel(
+ Model.TinkApp.MerchantId,
+ CultureInfo.CurrentUICulture.TwoLetterISOLanguageName,
+ App.ModelRoot.NextActiveUri.Host);
+ }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK/View/CopriWebView/RegisterPage.xaml.cs b/LastenradBayern/TINK/View/CopriWebView/RegisterPage.xaml.cs
index 6d5fd7b..e69cd6b 100644
--- a/LastenradBayern/TINK/View/CopriWebView/RegisterPage.xaml.cs
+++ b/LastenradBayern/TINK/View/CopriWebView/RegisterPage.xaml.cs
@@ -8,48 +8,48 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.CopriWebView
{
- [XamlCompilation(XamlCompilationOptions.Compile)]
- public partial class RegisterPage : ContentPage
- {
- public RegisterPage()
- {
- DependencyService.Get().ClearCookies();
+ [XamlCompilation(XamlCompilationOptions.Compile)]
+ public partial class RegisterPage : ContentPage
+ {
+ public RegisterPage()
+ {
+ DependencyService.Get().ClearCookies();
- InitializeComponent();
+ InitializeComponent();
- RegisterView.Navigating += (sender, ev) =>
- {
- this.IsEnabled = false;
- ActivityIndicatorLoading.IsVisible = true;
- ActivityIndicatorLoading.IsRunning = true;
- };
+ RegisterView.Navigating += (sender, ev) =>
+ {
+ this.IsEnabled = false;
+ ActivityIndicatorLoading.IsVisible = true;
+ ActivityIndicatorLoading.IsRunning = true;
+ };
- RegisterView.Navigated += (sender, ev) =>
- {
- if (ev.Result == WebNavigationResult.Success)
- {
- this.IsEnabled = true;
- ActivityIndicatorLoading.IsVisible = false;
- ActivityIndicatorLoading.IsRunning = false;
- return;
- }
+ RegisterView.Navigated += (sender, ev) =>
+ {
+ if (ev.Result == WebNavigationResult.Success)
+ {
+ this.IsEnabled = true;
+ ActivityIndicatorLoading.IsVisible = false;
+ ActivityIndicatorLoading.IsRunning = false;
+ return;
+ }
- Log.ForContext().Error("Navigation did not succeed. {@Event}", ev);
- RegisterView.Source = new HtmlWebViewSource
- {
- Html = "Kann Anmeldeseite nicht anzeigen!
Verbindung mit Internet ok?"
- };
+ Log.ForContext().Error("Navigation did not succeed. {@Event}", ev);
+ RegisterView.Source = new HtmlWebViewSource
+ {
+ Html = "Kann Anmeldeseite nicht anzeigen!
Verbindung mit Internet ok?"
+ };
- this.IsEnabled = true;
- ActivityIndicatorLoading.IsVisible = false;
- ActivityIndicatorLoading.IsRunning = false;
- };
+ this.IsEnabled = true;
+ ActivityIndicatorLoading.IsVisible = false;
+ ActivityIndicatorLoading.IsRunning = false;
+ };
- RegisterView.BindingContext = new RegisterPageViewModel(
- Model.TinkApp.MerchantId,
- CultureInfo.CurrentUICulture.TwoLetterISOLanguageName,
- App.ModelRoot.NextActiveUri.Host);
+ RegisterView.BindingContext = new RegisterPageViewModel(
+ Model.TinkApp.MerchantId,
+ CultureInfo.CurrentUICulture.TwoLetterISOLanguageName,
+ App.ModelRoot.NextActiveUri.Host);
- }
- }
+ }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK/View/FeedbackPopup.xaml b/LastenradBayern/TINK/View/FeedbackPopup.xaml
index d83d3b7..b1c903b 100644
--- a/LastenradBayern/TINK/View/FeedbackPopup.xaml
+++ b/LastenradBayern/TINK/View/FeedbackPopup.xaml
@@ -10,105 +10,75 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
+
-
+
-
-
-
+
+
+
+ x:Name="Co2SavingFrame">
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
-
-
+
-
-
-
+
-
-
-
-
-
+
+
+
+
-
-
+
+
-
+
\ No newline at end of file
diff --git a/LastenradBayern/TINK/View/FeedbackPopup.xaml.cs b/LastenradBayern/TINK/View/FeedbackPopup.xaml.cs
index 4ae1f98..2c73611 100644
--- a/LastenradBayern/TINK/View/FeedbackPopup.xaml.cs
+++ b/LastenradBayern/TINK/View/FeedbackPopup.xaml.cs
@@ -5,86 +5,86 @@ using Xamarin.Forms.Xaml;
namespace TINK.View
{
- [XamlCompilation(XamlCompilationOptions.Compile)]
- public partial class FeedbackPopup : Popup
- {
- /// Constructs user feedback popup.
- /// Object holding info about battery. For some batteries charging level might need to be updated by user.
- /// Co2 saving information.
- public FeedbackPopup(
- IBattery battery = null,
- string co2Saving = null)
- {
- InitializeComponent();
- if (string.IsNullOrEmpty(co2Saving))
- Co2SavingFrame.IsVisible = false;
- else
- Co2SavingLabel.Text = co2Saving;
+ [XamlCompilation(XamlCompilationOptions.Compile)]
+ public partial class FeedbackPopup : Popup
+ {
+ /// Constructs user feedback popup.
+ /// Object holding info about battery. For some batteries charging level might need to be updated by user.
+ /// Co2 saving information.
+ public FeedbackPopup(
+ IBattery battery = null,
+ string co2Saving = null)
+ {
+ InitializeComponent();
+ if (string.IsNullOrEmpty(co2Saving))
+ Co2SavingFrame.IsVisible = false;
+ else
+ Co2SavingLabel.Text = co2Saving;
- if (battery == null
- || (battery.IsBackendAccessible.HasValue && battery.IsBackendAccessible.Value))
- {
- // Either
- // - bike has no engine or
- // - backend can access battery level information
- // No need to ask user for input.
- return;
- }
+ if (battery == null
+ || (battery.IsBackendAccessible.HasValue && battery.IsBackendAccessible.Value))
+ {
+ // Either
+ // - bike has no engine or
+ // - backend can access battery level information
+ // No need to ask user for input.
+ return;
+ }
- BarLevelInputView.IsVisible = battery?.MaxChargeBars != null;
- BarLevelInputView.Current = battery?.CurrentChargeBars?.ToString() ?? string.Empty;
- BarLevelInputView.Maximum = battery?.MaxChargeBars != null ? battery?.MaxChargeBars.ToString() : String.Empty;
+ BarLevelInputView.IsVisible = battery?.MaxChargeBars != null;
+ BarLevelInputView.Current = battery?.CurrentChargeBars?.ToString() ?? string.Empty;
+ BarLevelInputView.Maximum = battery?.MaxChargeBars != null ? battery?.MaxChargeBars.ToString() : String.Empty;
- }
+ }
- protected override FeedbackPopup.Result GetLightDismissResult()
- {
- return new Result
- {
- CurrentChargeBars = int.TryParse(BarLevelInputView.Current, out int current) ? (int?)current : null,
- IsBikeBroken = brockenCheckBox.IsChecked,
- Message = feedbackMessage.Text
- };
- }
+ protected override FeedbackPopup.Result GetLightDismissResult()
+ {
+ return new Result
+ {
+ CurrentChargeBars = int.TryParse(BarLevelInputView.Current, out int current) ? (int?)current : null,
+ IsBikeBroken = brockenCheckBox.IsChecked,
+ Message = feedbackMessage.Text
+ };
+ }
- private void OnOkClicked(object sender, EventArgs eventArgs)
- {
- var result = new Result
- {
- CurrentChargeBars = int.TryParse(BarLevelInputView.Current, out int current) ? (int?)current : null,
- IsBikeBroken = brockenCheckBox.IsChecked,
- Message = feedbackMessage.Text
- };
+ private void OnOkClicked(object sender, EventArgs eventArgs)
+ {
+ var result = new Result
+ {
+ CurrentChargeBars = int.TryParse(BarLevelInputView.Current, out int current) ? (int?)current : null,
+ IsBikeBroken = brockenCheckBox.IsChecked,
+ Message = feedbackMessage.Text
+ };
- Dismiss(result);
- }
+ Dismiss(result);
+ }
- ///
- /// Feedback given by user when returning bike.
- ///
+ ///
+ /// Feedback given by user when returning bike.
+ ///
#if USCSHARP9
public class Result : IViewService.IUserFeedback
#else
- public new class Result : IUserFeedback
+ public new class Result : IUserFeedback
#endif
- {
- ///
- /// Holds the current chargeing level of the battery entered by user in bars, null if unkonwn.
- ///
- public int? CurrentChargeBars { get; set; }
+ {
+ ///
+ /// Holds the current chargeing level of the battery entered by user in bars, null if unkonwn.
+ ///
+ public int? CurrentChargeBars { get; set; }
- ///
- /// Holds whether bike is broken or not.
- ///
- public bool IsBikeBroken { get; set; }
+ ///
+ /// Holds whether bike is broken or not.
+ ///
+ public bool IsBikeBroken { get; set; }
- ///
- /// Holds either
- /// - general feedback
- /// - error description of broken bike
- /// or both.
- ///
- public string Message { get; set; }
- }
- }
+ ///
+ /// Holds either
+ /// - general feedback
+ /// - error description of broken bike
+ /// or both.
+ ///
+ public string Message { get; set; }
+ }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK/View/FeesAndBikes/FeesAndBikesPage.xaml.cs b/LastenradBayern/TINK/View/FeesAndBikes/FeesAndBikesPage.xaml.cs
index 7379ff7..b2e564f 100644
--- a/LastenradBayern/TINK/View/FeesAndBikes/FeesAndBikesPage.xaml.cs
+++ b/LastenradBayern/TINK/View/FeesAndBikes/FeesAndBikesPage.xaml.cs
@@ -5,34 +5,34 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.Contact
{
- [XamlCompilation(XamlCompilationOptions.Compile)]
- public partial class FeesAndBikesPage : TabbedPage
- {
- public FeesAndBikesPageViewModel ViewModel { get; }
+ [XamlCompilation(XamlCompilationOptions.Compile)]
+ public partial class FeesAndBikesPage : TabbedPage
+ {
+ public FeesAndBikesPageViewModel ViewModel { get; }
- public FeesAndBikesPage()
- {
- InitializeComponent();
+ public FeesAndBikesPage()
+ {
+ InitializeComponent();
- ViewModel = new FeesAndBikesPageViewModel(
- App.ModelRoot.NextActiveUri.Host,
- App.ModelRoot.ResourceUrls.FeesResourcePath,
- App.ModelRoot.ResourceUrls.BikesResourcePath,
- App.ModelRoot.IsSiteCachingOn);
+ ViewModel = new FeesAndBikesPageViewModel(
+ App.ModelRoot.NextActiveUri.Host,
+ App.ModelRoot.ResourceUrls.FeesResourcePath,
+ App.ModelRoot.ResourceUrls.BikesResourcePath,
+ App.ModelRoot.IsSiteCachingOn);
- BindingContext = ViewModel;
+ BindingContext = ViewModel;
- /// Info about renting.
- InfoRentBikeWebView.Navigating += ViewModelHelper.OnNavigating;
+ /// Info about renting.
+ InfoRentBikeWebView.Navigating += ViewModelHelper.OnNavigating;
- /// Info about types of bikes.
- InfoTypesOfBikesWebView.Navigating += ViewModelHelper.OnNavigating;
- }
+ /// Info about types of bikes.
+ InfoTypesOfBikesWebView.Navigating += ViewModelHelper.OnNavigating;
+ }
- /// Called when page is shown.
- protected override void OnAppearing()
- {
- ViewModel.OnAppearing();
- }
- }
+ /// Called when page is shown.
+ protected override void OnAppearing()
+ {
+ ViewModel.OnAppearing();
+ }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK/View/FindBike/FindBikePage.xaml.cs b/LastenradBayern/TINK/View/FindBike/FindBikePage.xaml.cs
index 8d3c226..f6aa134 100644
--- a/LastenradBayern/TINK/View/FindBike/FindBikePage.xaml.cs
+++ b/LastenradBayern/TINK/View/FindBike/FindBikePage.xaml.cs
@@ -12,141 +12,141 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.FindBike
{
- [XamlCompilation(XamlCompilationOptions.Compile)]
- public partial class FindBikePage : ContentPage, IViewService
- {
- /// Refernce to view model.
- FindBikePageViewModel m_oViewModel = null;
+ [XamlCompilation(XamlCompilationOptions.Compile)]
+ public partial class FindBikePage : ContentPage, IViewService
+ {
+ /// Refernce to view model.
+ FindBikePageViewModel m_oViewModel = null;
- public FindBikePage() { }
+ public FindBikePage() { }
- ///
- /// Invoked when page is shown.
- /// Starts update process.
- ///
- protected async override void OnAppearing()
- {
- 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();
- return;
- }
+ ///
+ /// Invoked when page is shown.
+ /// Starts update process.
+ ///
+ protected async override void OnAppearing()
+ {
+ 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();
+ return;
+ }
- try
- {
- var model = App.ModelRoot;
+ try
+ {
+ var model = App.ModelRoot;
- // Backup synchronization context when called from GUI-thread.
- var synchronizationContext = SynchronizationContext.Current;
+ // Backup synchronization context when called from GUI-thread.
+ var synchronizationContext = SynchronizationContext.Current;
- m_oViewModel = new FindBikePageViewModel(
- model.ActiveUser,
- App.PermissionsService,
- App.BluetoothService,
- Device.RuntimePlatform,
- () => model.GetIsConnected(),
- (isConnected) => model.GetConnector(isConnected),
- App.LocationServicesContainer.Active,
- model.LocksServices.Active,
- model.Stations,
- model.Polling,
- (d, obj) => synchronizationContext.Post(d, obj),
- model.SmartDevice,
- this,
- (url) => DependencyService.Get().OpenUrl(url))
- {
- IsReportLevelVerbose = model.IsReportLevelVerbose
- };
- }
- catch (Exception exception)
- {
- Log.ForContext().Error("Displaying bikes at station page failed. {Exception}", exception);
- await DisplayAlert("Fehler", $"Seite Fahrrad Wählen kann nicht angezeigt werden. ${exception.Message}", "OK");
- return;
+ m_oViewModel = new FindBikePageViewModel(
+ model.ActiveUser,
+ App.PermissionsService,
+ App.BluetoothService,
+ Device.RuntimePlatform,
+ () => model.GetIsConnected(),
+ (isConnected) => model.GetConnector(isConnected),
+ App.LocationServicesContainer.Active,
+ model.LocksServices.Active,
+ model.Stations,
+ model.Polling,
+ (d, obj) => synchronizationContext.Post(d, obj),
+ model.SmartDevice,
+ this,
+ (url) => DependencyService.Get().OpenUrl(url))
+ {
+ IsReportLevelVerbose = model.IsReportLevelVerbose
+ };
+ }
+ catch (Exception exception)
+ {
+ Log.ForContext().Error("Displaying bikes at station page failed. {Exception}", exception);
+ await DisplayAlert("Fehler", $"Seite Fahrrad Wählen kann nicht angezeigt werden. ${exception.Message}", "OK");
+ return;
- }
+ }
- InitializeComponent();
+ InitializeComponent();
- BindingContext = m_oViewModel;
- FindBikeListView.ItemsSource = m_oViewModel;
+ BindingContext = m_oViewModel;
+ FindBikeListView.ItemsSource = m_oViewModel;
- await m_oViewModel.OnAppearing();
- }
+ await m_oViewModel.OnAppearing();
+ }
- ///
- /// Displays alert message.
- ///
- /// Title of message.
- /// Message to display.
- /// Type of buttons.
- public new async Task DisplayAlert(string p_strTitle, string p_strMessage, string p_strCancel)
- => await App.Current.MainPage.DisplayAlert(p_strTitle, p_strMessage, p_strCancel);
+ ///
+ /// Displays alert message.
+ ///
+ /// Title of message.
+ /// Message to display.
+ /// Type of buttons.
+ public new async Task DisplayAlert(string p_strTitle, string p_strMessage, string p_strCancel)
+ => await App.Current.MainPage.DisplayAlert(p_strTitle, p_strMessage, p_strCancel);
- /// Displays alert message.
- /// Title of message.
- /// Message to display.
- /// Detailed error description.
- /// Type of buttons.
- public async Task DisplayAdvancedAlert(
- string title,
- string message,
- string details,
- string cancel)
- => await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel);
+ /// Displays alert message.
+ /// Title of message.
+ /// Message to display.
+ /// Detailed error description.
+ /// Type of buttons.
+ public async Task DisplayAdvancedAlert(
+ string title,
+ string message,
+ string details,
+ string cancel)
+ => await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel);
- /// Displays detailed alert message.
- /// Title of message.
- /// Message to display.
- /// Detailed error description.
- /// Text of accept button.
- /// Text of cancel button.
- /// True if user pressed accept.
- public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel)
- => await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel);
+ /// Displays detailed alert message.
+ /// Title of message.
+ /// Message to display.
+ /// Detailed error description.
+ /// Text of accept button.
+ /// Text of cancel button.
+ /// True if user pressed accept.
+ public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel)
+ => await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel);
- ///
- /// Displays alert message.
- ///
- /// Title of message.
- /// Message to display.
- /// Text of accept button.
- /// Text of button.
- /// True if user pressed accept.
- public new async Task DisplayAlert(string p_strTitle, string p_strMessage, string p_strAccept, string p_strCancel)
- => await App.Current.MainPage.DisplayAlert(p_strTitle, p_strMessage, p_strAccept, p_strCancel);
+ ///
+ /// Displays alert message.
+ ///
+ /// Title of message.
+ /// Message to display.
+ /// Text of accept button.
+ /// Text of button.
+ /// True if user pressed accept.
+ public new async Task DisplayAlert(string p_strTitle, string p_strMessage, string p_strAccept, string p_strCancel)
+ => await App.Current.MainPage.DisplayAlert(p_strTitle, p_strMessage, p_strAccept, p_strCancel);
#if USEFLYOUT
public void ShowPage(ViewTypes p_oType, string p_strTitle = null)
=> throw new NotImplementedException();
#else
- /// Shows a page.
- /// Route of the page to show.
- public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route);
+ /// Shows a page.
+ /// Route of the page to show.
+ public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route);
#endif
- /// Pushes a page onto the modal stack.
- /// Page to display.
- public async Task PushModalAsync(ViewTypes typeOfPage)
- => await Navigation.PushModalAsync((Page)Activator.CreateInstance(typeOfPage.GetViewType()));
+ /// Pushes a page onto the modal stack.
+ /// Page to display.
+ public async Task PushModalAsync(ViewTypes typeOfPage)
+ => await Navigation.PushModalAsync((Page)Activator.CreateInstance(typeOfPage.GetViewType()));
- /// Pops a page from the modal stack.
- public Task PopModalAsync() => throw new NotSupportedException();
+ /// Pops a page from the modal stack.
+ public Task PopModalAsync() => throw new NotSupportedException();
- /// Pushes a page onto the stack.
- /// Page to display.
- public Task PushAsync(ViewTypes p_oTypeOfPage) => throw new NotSupportedException();
+ /// Pushes a page onto the stack.
+ /// Page to display.
+ public Task PushAsync(ViewTypes p_oTypeOfPage) => throw new NotSupportedException();
#if USCSHARP9
public async Task DisplayUserFeedbackPopup() => await Navigation.ShowPopupAsync(new FeedbackPopup());
#else
- /// Displays user feedback popup.
- /// Co2 saving information.
- /// User feedback.
- public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => await Navigation.ShowPopupAsync(new FeedbackPopup(battery, co2Saving));
+ /// Displays user feedback popup.
+ /// Co2 saving information.
+ /// User feedback.
+ public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => await Navigation.ShowPopupAsync(new FeedbackPopup(battery, co2Saving));
#endif
- }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK/View/Info/BikeInfo/BikeInfoCarouselPage.xaml.cs b/LastenradBayern/TINK/View/Info/BikeInfo/BikeInfoCarouselPage.xaml.cs
index 8aa6c88..49a938b 100644
--- a/LastenradBayern/TINK/View/Info/BikeInfo/BikeInfoCarouselPage.xaml.cs
+++ b/LastenradBayern/TINK/View/Info/BikeInfo/BikeInfoCarouselPage.xaml.cs
@@ -11,65 +11,65 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.Info.BikeInfo
{
- [XamlCompilation(XamlCompilationOptions.Compile)]
+ [XamlCompilation(XamlCompilationOptions.Compile)]
#if USEFLYOUT
public partial class BikeInfoCarouselPage : CarouselPage, IViewService, IDetailPage
#else
- public partial class BikeInfoCarouselPage : CarouselPage, IViewService
+ public partial class BikeInfoCarouselPage : CarouselPage, IViewService
#endif
- {
- public BikeInfoCarouselPage()
- {
- InitializeComponent();
+ {
+ public BikeInfoCarouselPage()
+ {
+ InitializeComponent();
- ItemsSource = new BikeInfoViewModel(
- resourceName => ImageSource.FromResource($"{ViewModelResourceHelper.RessourcePrefix}Images.{resourceName}"),
- this).CarouselItems;
- }
+ ItemsSource = new BikeInfoViewModel(
+ resourceName => ImageSource.FromResource($"{ViewModelResourceHelper.RessourcePrefix}Images.{resourceName}"),
+ this).CarouselItems;
+ }
- ///
- /// Displays alert message.
- ///
- /// Title of message.
- /// Message to display.
- /// Type of buttons.
- public new async Task DisplayAlert(string p_strTitle, string p_strMessage, string p_strCancel)
- => await App.Current.MainPage.DisplayAlert(p_strTitle, p_strMessage, p_strCancel);
+ ///
+ /// Displays alert message.
+ ///
+ /// Title of message.
+ /// Message to display.
+ /// Type of buttons.
+ public new async Task DisplayAlert(string p_strTitle, string p_strMessage, string p_strCancel)
+ => await App.Current.MainPage.DisplayAlert(p_strTitle, p_strMessage, p_strCancel);
- /// Displays alert message.
- /// Title of message.
- /// Message to display.
- /// Detailed error description.
- /// Type of buttons.
- public async Task DisplayAdvancedAlert(
- string title,
- string message,
- string details,
- string cancel)
- => await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel);
+ /// Displays alert message.
+ /// Title of message.
+ /// Message to display.
+ /// Detailed error description.
+ /// Type of buttons.
+ public async Task DisplayAdvancedAlert(
+ string title,
+ string message,
+ string details,
+ string cancel)
+ => await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel);
- /// Displays detailed alert message.
- /// Title of message.
- /// Message to display.
- /// Detailed error description.
- /// Text of accept button.
- /// Text of cancel button.
- /// True if user pressed accept.
- public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel)
- => await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel);
+ /// Displays detailed alert message.
+ /// Title of message.
+ /// Message to display.
+ /// Detailed error description.
+ /// Text of accept button.
+ /// Text of cancel button.
+ /// True if user pressed accept.
+ public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel)
+ => await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel);
- ///
- /// Displays alert message.
- ///
- /// Title of message.
- /// Message to display.
- /// Text of accept button.
- /// Text of button.
- /// True if user pressed accept.
- public new async Task DisplayAlert(string p_strTitle, string p_strMessage, string p_strAccept, string p_strCancel)
- {
- return await App.Current.MainPage.DisplayAlert(p_strTitle, p_strMessage, p_strAccept, p_strCancel);
- }
+ ///
+ /// Displays alert message.
+ ///
+ /// Title of message.
+ /// Message to display.
+ /// Text of accept button.
+ /// Text of button.
+ /// True if user pressed accept.
+ public new async Task DisplayAlert(string p_strTitle, string p_strMessage, string p_strAccept, string p_strCancel)
+ {
+ return await App.Current.MainPage.DisplayAlert(p_strTitle, p_strMessage, p_strAccept, p_strCancel);
+ }
#if USEFLYOUT
///
@@ -79,31 +79,31 @@ namespace TINK.View.Info.BikeInfo
public void ShowPage(ViewTypes p_oType, string p_strTitle = null)
=> m_oNavigation.ShowPage(p_oType.GetViewType(), p_strTitle);
#else
- /// Shows a page.
- /// Route of the page to show.
- public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route);
+ /// Shows a page.
+ /// Route of the page to show.
+ public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route);
#endif
- /// Pushes a page onto the modal stack.
- /// Page to display.
- public Task PushModalAsync(ViewTypes p_oTypeOfPage)
- {
- throw new NotSupportedException();
- }
+ /// Pushes a page onto the modal stack.
+ /// Page to display.
+ public Task PushModalAsync(ViewTypes p_oTypeOfPage)
+ {
+ throw new NotSupportedException();
+ }
- /// Pops a page from the modal stack.
- public Task PopModalAsync()
- {
- throw new NotSupportedException();
- }
+ /// Pops a page from the modal stack.
+ public Task PopModalAsync()
+ {
+ throw new NotSupportedException();
+ }
- /// Pushes a page onto the stack.
- /// Page to display.
- public Task PushAsync(ViewTypes p_oTypeOfPage)
- {
- throw new NotImplementedException();
- }
+ /// Pushes a page onto the stack.
+ /// Page to display.
+ public Task PushAsync(ViewTypes p_oTypeOfPage)
+ {
+ throw new NotImplementedException();
+ }
#if USEFLYOUT
///
@@ -123,7 +123,7 @@ namespace TINK.View.Info.BikeInfo
#if USCSHARP9
public Task DisplayUserFeedbackPopup() => throw new NotSupportedException();
#else
- public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => throw new NotSupportedException();
+ public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => throw new NotSupportedException();
#endif
- }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK/View/Info/InfoTabbedPage.xaml.cs b/LastenradBayern/TINK/View/Info/InfoTabbedPage.xaml.cs
index e4ca437..17f0bba 100644
--- a/LastenradBayern/TINK/View/Info/InfoTabbedPage.xaml.cs
+++ b/LastenradBayern/TINK/View/Info/InfoTabbedPage.xaml.cs
@@ -6,36 +6,36 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.Info
{
- [XamlCompilation(XamlCompilationOptions.Compile)]
- public partial class InfoPage : TabbedPage
- {
- public InfoPageViewModel ViewModel { get; }
+ [XamlCompilation(XamlCompilationOptions.Compile)]
+ public partial class InfoPage : TabbedPage
+ {
+ public InfoPageViewModel ViewModel { get; }
- public InfoPage()
- {
- InitializeComponent();
+ public InfoPage()
+ {
+ InitializeComponent();
- ViewModel = new InfoPageViewModel(
- App.ModelRoot.NextActiveUri.Host,
- App.ModelRoot.ResourceUrls.AgbResourcePath,
- App.ModelRoot.ResourceUrls.PrivacyResourcePath,
- App.ModelRoot.ResourceUrls.ImpressResourcePath,
- App.ModelRoot.IsSiteCachingOn,
- CultureInfo.CurrentUICulture.TwoLetterISOLanguageName,
- resourceName => ViewModelResourceHelper.GetSource(resourceName));
- TabbedInfoPage.BindingContext = ViewModel;
+ ViewModel = new InfoPageViewModel(
+ App.ModelRoot.NextActiveUri.Host,
+ App.ModelRoot.ResourceUrls.AgbResourcePath,
+ App.ModelRoot.ResourceUrls.PrivacyResourcePath,
+ App.ModelRoot.ResourceUrls.ImpressResourcePath,
+ App.ModelRoot.IsSiteCachingOn,
+ CultureInfo.CurrentUICulture.TwoLetterISOLanguageName,
+ resourceName => ViewModelResourceHelper.GetSource(resourceName));
+ TabbedInfoPage.BindingContext = ViewModel;
- InfoLicenses.Navigating += ViewModelHelper.OnNavigating;
- InfoDatenschutz.Navigating += ViewModelHelper.OnNavigating;
- InfoABG.Navigating += ViewModelHelper.OnNavigating;
+ InfoLicenses.Navigating += ViewModelHelper.OnNavigating;
+ InfoDatenschutz.Navigating += ViewModelHelper.OnNavigating;
+ InfoABG.Navigating += ViewModelHelper.OnNavigating;
- InfoImpressum.Navigating += ViewModelHelper.OnNavigating;
- }
+ InfoImpressum.Navigating += ViewModelHelper.OnNavigating;
+ }
- /// Called when page is shown.
- protected override void OnAppearing()
- {
- ViewModel.OnAppearing();
- }
- }
+ /// Called when page is shown.
+ protected override void OnAppearing()
+ {
+ ViewModel.OnAppearing();
+ }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK/View/ListViewAttachedBehavior.cs b/LastenradBayern/TINK/View/ListViewAttachedBehavior.cs
index 0b13485..ec0cc89 100644
--- a/LastenradBayern/TINK/View/ListViewAttachedBehavior.cs
+++ b/LastenradBayern/TINK/View/ListViewAttachedBehavior.cs
@@ -3,33 +3,33 @@ using Xamarin.Forms;
namespace TINK.View
{
- public static class ListViewAttachedBehavior
- {
- public static readonly BindableProperty CommandProperty =
- BindableProperty.CreateAttached(
- "Command",
- typeof(ICommand),
- typeof(ListViewAttachedBehavior),
- null,
- propertyChanged: OnCommandChanged);
+ public static class ListViewAttachedBehavior
+ {
+ public static readonly BindableProperty CommandProperty =
+ BindableProperty.CreateAttached(
+ "Command",
+ typeof(ICommand),
+ typeof(ListViewAttachedBehavior),
+ null,
+ propertyChanged: OnCommandChanged);
- static void OnCommandChanged(BindableObject view, object oldValue, object newValue)
- {
- var entry = view as ListView;
- if (entry == null)
- return;
+ static void OnCommandChanged(BindableObject view, object oldValue, object newValue)
+ {
+ var entry = view as ListView;
+ if (entry == null)
+ return;
- entry.ItemTapped += (sender, e) =>
- {
- var command = (newValue as ICommand);
- if (command == null)
- return;
+ entry.ItemTapped += (sender, e) =>
+ {
+ var command = (newValue as ICommand);
+ if (command == null)
+ return;
- if (command.CanExecute(e.Item))
- {
- command.Execute(e.Item);
- }
- };
- }
- }
+ if (command.CanExecute(e.Item))
+ {
+ command.Execute(e.Item);
+ }
+ };
+ }
+ }
}
diff --git a/LastenradBayern/TINK/View/Login/LoginPage.xaml.cs b/LastenradBayern/TINK/View/Login/LoginPage.xaml.cs
index 03e860c..b1e85fb 100644
--- a/LastenradBayern/TINK/View/Login/LoginPage.xaml.cs
+++ b/LastenradBayern/TINK/View/Login/LoginPage.xaml.cs
@@ -11,60 +11,60 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.Login
{
- [XamlCompilation(XamlCompilationOptions.Compile)]
+ [XamlCompilation(XamlCompilationOptions.Compile)]
#if USEFLYOUT
public partial class LoginPage : ContentPage, IViewService, IDetailPage
#else
- public partial class LoginPage : ContentPage, IViewService
+ public partial class LoginPage : ContentPage, IViewService
#endif
- {
- public LoginPage()
- {
- InitializeComponent();
+ {
+ public LoginPage()
+ {
+ InitializeComponent();
- var l_oModel = App.ModelRoot;
+ var l_oModel = App.ModelRoot;
#if !BACKSTYLE
- var l_oViewModel = new LoginPageViewModel(
- l_oModel,
- (url) => DependencyService.Get().OpenUrl(url),
- this);
+ var l_oViewModel = new LoginPageViewModel(
+ l_oModel,
+ (url) => DependencyService.Get().OpenUrl(url),
+ this);
- LoginPageView.BindingContext = l_oViewModel;
+ LoginPageView.BindingContext = l_oViewModel;
#else
LoginPageView.BindingContext = new LoginPageViewModel(l_oModel.ActiveUser, this, Navigation);
#endif
- }
+ }
- ///
- /// Displays alert message.
- ///
- /// Title of message.
- /// Message to display.
- /// Type of buttons.
- public new async Task DisplayAlert(string p_strTitle, string p_strMessage, string p_strCancel)
- => await App.Current.MainPage.DisplayAlert(p_strTitle, p_strMessage, p_strCancel);
+ ///
+ /// Displays alert message.
+ ///
+ /// Title of message.
+ /// Message to display.
+ /// Type of buttons.
+ public new async Task DisplayAlert(string p_strTitle, string p_strMessage, string p_strCancel)
+ => await App.Current.MainPage.DisplayAlert(p_strTitle, p_strMessage, p_strCancel);
- /// Displays alert message.
- /// Title of message.
- /// Message to display.
- /// Detailed error description.
- /// Type of buttons.
- public async Task DisplayAdvancedAlert(
- string title,
- string message,
- string details,
- string cancel)
- => await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel);
+ /// Displays alert message.
+ /// Title of message.
+ /// Message to display.
+ /// Detailed error description.
+ /// Type of buttons.
+ public async Task DisplayAdvancedAlert(
+ string title,
+ string message,
+ string details,
+ string cancel)
+ => await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel);
- /// Displays detailed alert message.
- /// Title of message.
- /// Message to display.
- /// Detailed error description.
- /// Text of accept button.
- /// Text of cancel button.
- /// True if user pressed accept.
- public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel)
- => await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel);
+ /// Displays detailed alert message.
+ /// Title of message.
+ /// Message to display.
+ /// Detailed error description.
+ /// Text of accept button.
+ /// Text of cancel button.
+ /// True if user pressed accept.
+ public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel)
+ => await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel);
#if USEFLYOUT
///
@@ -74,30 +74,30 @@ namespace TINK.View.Login
public void ShowPage(ViewTypes p_oType, string p_strTitle = null)
=> m_oNavigation.ShowPage(p_oType.GetViewType(), p_strTitle);
#else
- /// Shows a page.
- /// Route of the page to show.
- public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route);
+ /// Shows a page.
+ /// Route of the page to show.
+ public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route);
#endif
- /// Pushes a page onto the modal stack.
- /// Page to display.
- public async Task PushModalAsync(ViewTypes typeOfPage)
- => await Navigation.PushModalAsync((Page)Activator.CreateInstance(typeOfPage.GetViewType()));
+ /// Pushes a page onto the modal stack.
+ /// Page to display.
+ public async Task PushModalAsync(ViewTypes typeOfPage)
+ => await Navigation.PushModalAsync((Page)Activator.CreateInstance(typeOfPage.GetViewType()));
- /// Pops a page from the modal stack.
- public Task PopModalAsync()
- {
- throw new NotSupportedException();
- }
+ /// Pops a page from the modal stack.
+ public Task PopModalAsync()
+ {
+ throw new NotSupportedException();
+ }
- /// Pushes a page onto the stack.
- /// Page to display.
- public async Task PushAsync(ViewTypes p_oTypeOfPage)
- {
- await Navigation.PushAsync((Page)Activator.CreateInstance(p_oTypeOfPage.GetViewType()));
- }
+ /// Pushes a page onto the stack.
+ /// Page to display.
+ public async Task PushAsync(ViewTypes p_oTypeOfPage)
+ {
+ await Navigation.PushAsync((Page)Activator.CreateInstance(p_oTypeOfPage.GetViewType()));
+ }
#if USEFLYOUT
///
@@ -117,7 +117,7 @@ namespace TINK.View.Login
#if USCSHARP9
public Task DisplayUserFeedbackPopup() => throw new NotSupportedException();
#else
- public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => throw new NotSupportedException();
+ public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => throw new NotSupportedException();
#endif
- }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK/View/Map/MapPage.xaml.cs b/LastenradBayern/TINK/View/Map/MapPage.xaml.cs
index e512d74..5f147bf 100644
--- a/LastenradBayern/TINK/View/Map/MapPage.xaml.cs
+++ b/LastenradBayern/TINK/View/Map/MapPage.xaml.cs
@@ -8,72 +8,72 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.Map
{
- using Serilog;
- using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
- using TINK.ViewModel.Map;
+ using Serilog;
+ using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
+ using TINK.ViewModel.Map;
- [XamlCompilation(XamlCompilationOptions.Compile)]
+ [XamlCompilation(XamlCompilationOptions.Compile)]
#if USEFLYOUT
public partial class MapPage : ContentPage, IViewService, IDetailPage
#else
- public partial class MapPage : ContentPage, IViewService
+ public partial class MapPage : ContentPage, IViewService
#endif
- {
- /// View model to notify about whether page appears or hides.
- private MapPageViewModel MapPageViewModel { get; set; }
+ {
+ /// View model to notify about whether page appears or hides.
+ private MapPageViewModel MapPageViewModel { get; set; }
- /// Initialization status to ensure initialization logic is not called multiple times.
- private bool isInitializationStarted = false;
+ /// Initialization status to ensure initialization logic is not called multiple times.
+ private bool isInitializationStarted = false;
- ///
- /// Constructs map page instance.
- ///
- public MapPage()
- {
- InitializeComponent();
- }
+ ///
+ /// Constructs map page instance.
+ ///
+ public MapPage()
+ {
+ InitializeComponent();
+ }
- ///
- /// Displays alert message.
- ///
- /// Title of message.
- /// Message to display.
- /// Type of buttons.
- public new async Task DisplayAlert(string title, string message, string cancel)
- => await App.Current.MainPage.DisplayAlert(title, message, cancel);
+ ///
+ /// Displays alert message.
+ ///
+ /// Title of message.
+ /// Message to display.
+ /// Type of buttons.
+ public new async Task DisplayAlert(string title, string message, string cancel)
+ => await App.Current.MainPage.DisplayAlert(title, message, cancel);
- /// Displays alert message.
- /// Title of message.
- /// Message to display.
- /// Detailed error description.
- /// Type of buttons.
- public async Task DisplayAdvancedAlert(
- string title,
- string message,
- string details,
- string cancel)
- => await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel);
+ /// Displays alert message.
+ /// Title of message.
+ /// Message to display.
+ /// Detailed error description.
+ /// Type of buttons.
+ public async Task DisplayAdvancedAlert(
+ string title,
+ string message,
+ string details,
+ string cancel)
+ => await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel);
- /// Displays detailed alert message.
- /// Title of message.
- /// Message to display.
- /// Detailed error description.
- /// Text of accept button.
- /// Text of cancel button.
- /// True if user pressed accept.
- public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel)
- => await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel);
+ /// Displays detailed alert message.
+ /// Title of message.
+ /// Message to display.
+ /// Detailed error description.
+ /// Text of accept button.
+ /// Text of cancel button.
+ /// True if user pressed accept.
+ public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel)
+ => await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel);
- ///
- /// Displays alert message.
- ///
- /// Title of message.
- /// Message to display.
- /// Text of accept button.
- /// Text of button.
- /// True if user pressed accept.
- public new async Task DisplayAlert(string title, string message, string accept, string cancel)
- => await App.Current.MainPage.DisplayAlert(title, message, accept, cancel);
+ ///
+ /// Displays alert message.
+ ///
+ /// Title of message.
+ /// Message to display.
+ /// Text of accept button.
+ /// Text of button.
+ /// True if user pressed accept.
+ public new async Task DisplayAlert(string title, string message, string accept, string cancel)
+ => await App.Current.MainPage.DisplayAlert(title, message, accept, cancel);
#if USEFLYOUT
///
@@ -83,45 +83,45 @@ namespace TINK.View.Map
public void ShowPage(ViewTypes type, string title = null)
=> NavigationMasterDetail.ShowPage(type.GetViewType(), title);
#else
- /// Shows a page.
- /// Route of the page to show.
- public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route);
+ /// Shows a page.
+ /// Route of the page to show.
+ public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route);
#endif
- /// Pushes a page onto the modal stack.
- /// Type of page to display.
- public async Task PushModalAsync(ViewTypes typeOfPage)
- => await Navigation.PushModalAsync((Page)Activator.CreateInstance(typeOfPage.GetViewType()));
+ /// Pushes a page onto the modal stack.
+ /// Type of page to display.
+ public async Task PushModalAsync(ViewTypes typeOfPage)
+ => await Navigation.PushModalAsync((Page)Activator.CreateInstance(typeOfPage.GetViewType()));
- /// Pops a page from the modal stack.
- public async Task PopModalAsync()
- => await Navigation.PopModalAsync();
+ /// Pops a page from the modal stack.
+ public async Task PopModalAsync()
+ => await Navigation.PopModalAsync();
- /// Pushes a page onto the stack.
- /// Page to display.
- public async Task PushAsync(ViewTypes typeOfPage)
- {
+ /// Pushes a page onto the stack.
+ /// Page to display.
+ public async Task PushAsync(ViewTypes typeOfPage)
+ {
#if USEFLYOUT
var page = Activator.CreateInstance(typeOfPage.GetViewType()) as IDetailPage;
#else
- var page = Activator.CreateInstance(typeOfPage.GetViewType());
+ var page = Activator.CreateInstance(typeOfPage.GetViewType());
#endif
- if (page == null)
- {
- return;
- }
+ if (page == null)
+ {
+ return;
+ }
#if USEFLYOUT
page.NavigationMasterDetail = NavigationMasterDetail;
#endif
- await Navigation.PushAsync((Page)page);
- }
+ await Navigation.PushAsync((Page)page);
+ }
#if USCSHARP9
public Task DisplayUserFeedbackPopup() => throw new NotSupportedException();
#else
- public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => throw new NotSupportedException();
+ public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => throw new NotSupportedException();
#endif
#if USEFLYOUT
@@ -129,153 +129,153 @@ namespace TINK.View.Map
public INavigationMasterDetail NavigationMasterDetail { private get; set; }
#endif
- ///
- /// Invoked when page is shown.
- /// Starts update process.
- ///
- protected async override void OnAppearing()
- {
- // Don't repeat the initialization if it has been completed already.
- if (isInitializationStarted) return;
- isInitializationStarted = true;
+ ///
+ /// Invoked when page is shown.
+ /// Starts update process.
+ ///
+ protected async override void OnAppearing()
+ {
+ // Don't repeat the initialization if it has been completed already.
+ if (isInitializationStarted) return;
+ isInitializationStarted = true;
- // Pass reference to member Navigation to show bikes at station x dialog.
- try
- {
- Log.ForContext().Verbose("Constructing map page view model.");
+ // Pass reference to member Navigation to show bikes at station x dialog.
+ try
+ {
+ Log.ForContext().Verbose("Constructing map page view model.");
#if TRYNOTBACKSTYLE
MapPageViewModel = new MapPageViewModel();
#else
- MapPageViewModel = CreateMapPageViewModel();
+ MapPageViewModel = CreateMapPageViewModel();
#endif
- }
- catch (Exception exception)
- {
- Log.ForContext().Error("Constructing map page view model failed. {Exception}", exception);
- isInitializationStarted = false;
- return;
- }
+ }
+ catch (Exception exception)
+ {
+ Log.ForContext().Error("Constructing map page view model failed. {Exception}", exception);
+ isInitializationStarted = false;
+ return;
+ }
- try
- {
- BindingContext = MapPageViewModel;
+ try
+ {
+ BindingContext = MapPageViewModel;
#if USEFLYOUT
MapPageViewModel.NavigationMasterDetail = NavigationMasterDetail;
#endif
- }
- catch (Exception exception)
- {
- Log.ForContext().Error("Setting binding/ navigaton on map page failed. {Exception}", exception);
- isInitializationStarted = false;
- return;
- }
+ }
+ catch (Exception exception)
+ {
+ Log.ForContext().Error("Setting binding/ navigaton on map page failed. {Exception}", exception);
+ isInitializationStarted = false;
+ return;
+ }
- try
- {
- ApplyCustomiOSStyling();
- }
- catch (Exception exception)
- {
- // Continue because styling is not essential.
- Log.ForContext().Error("IOS specific styling of map page failed. {Exception}", exception);
- }
+ try
+ {
+ ApplyCustomiOSStyling();
+ }
+ catch (Exception exception)
+ {
+ // Continue because styling is not essential.
+ Log.ForContext().Error("IOS specific styling of map page failed. {Exception}", exception);
+ }
- try
- {
- base.OnAppearing();
- }
- catch (Exception exception)
- {
- // Continue because styling is not essential.
- Log.ForContext().Error("Invoking OnAppearing of base failed. {Exception}", exception);
- isInitializationStarted = false;
- return;
- }
+ try
+ {
+ base.OnAppearing();
+ }
+ catch (Exception exception)
+ {
+ // Continue because styling is not essential.
+ Log.ForContext().Error("Invoking OnAppearing of base failed. {Exception}", exception);
+ isInitializationStarted = false;
+ return;
+ }
- try
- {
- // Pre move and scanle maps to avoid initial display of map in Rome.
- PremoveAndScaleMap();
- }
- catch (Exception exception)
- {
- // Continue because a map not beeing moved/ scaled is no reason for aborting startup.
- Log.ForContext().Error("Moving and scaling map failed. {Exception}", exception);
- }
+ try
+ {
+ // Pre move and scanle maps to avoid initial display of map in Rome.
+ PremoveAndScaleMap();
+ }
+ catch (Exception exception)
+ {
+ // Continue because a map not beeing moved/ scaled is no reason for aborting startup.
+ Log.ForContext().Error("Moving and scaling map failed. {Exception}", exception);
+ }
- try
- {
- Log.ForContext().Verbose("Invoking OnAppearing on map page view model.");
- await MapPageViewModel.OnAppearing();
+ try
+ {
+ Log.ForContext().Verbose("Invoking OnAppearing on map page view model.");
+ await MapPageViewModel.OnAppearing();
- isInitializationStarted = false;
- }
- catch (Exception exception)
- {
- Log.ForContext().Error("Invoking OnAppearing on map page view model failed. {Exception}", exception);
- isInitializationStarted = false;
- return;
- }
- }
+ isInitializationStarted = false;
+ }
+ catch (Exception exception)
+ {
+ Log.ForContext().Error("Invoking OnAppearing on map page view model failed. {Exception}", exception);
+ isInitializationStarted = false;
+ return;
+ }
+ }
- ///
- /// Premoves the Map to a certain location.
- ///
- private void PremoveAndScaleMap()
- {
- Log.ForContext().Verbose("Moving and scaling map.");
- MapPageViewModel.MoveAndScale(
- (mapSpan) => MyMap.MoveToRegion(mapSpan),
- App.ModelRoot.ActiveMapSpan);
- }
+ ///
+ /// Premoves the Map to a certain location.
+ ///
+ private void PremoveAndScaleMap()
+ {
+ Log.ForContext().Verbose("Moving and scaling map.");
+ MapPageViewModel.MoveAndScale(
+ (mapSpan) => MyMap.MoveToRegion(mapSpan),
+ App.ModelRoot.ActiveMapSpan);
+ }
- ///
- /// Creates the Map Page's view model.
- ///
- private MapPageViewModel CreateMapPageViewModel()
- {
- Log.ForContext().Verbose("Constructing map page view model.");
- return new MapPageViewModel(
- App.ModelRoot,
- App.PermissionsService,
- App.BluetoothService,
- App.LocationServicesContainer.Active,
- (mapspan) => MyMap.MoveToRegion(mapspan),
- this,
- Navigation);
- }
+ ///
+ /// Creates the Map Page's view model.
+ ///
+ private MapPageViewModel CreateMapPageViewModel()
+ {
+ Log.ForContext().Verbose("Constructing map page view model.");
+ return new MapPageViewModel(
+ App.ModelRoot,
+ App.PermissionsService,
+ App.BluetoothService,
+ App.LocationServicesContainer.Active,
+ (mapspan) => MyMap.MoveToRegion(mapspan),
+ this,
+ Navigation);
+ }
- ///
- /// Applies iOS specific styling to branded Buttons.
- ///
- private void ApplyCustomiOSStyling()
- {
- if (Device.RuntimePlatform == Device.iOS)
- {
- TINKButton.BackgroundColor = Color.LightGray;
- TINKButton.BorderColor = Color.Black;
- TINKButton.Margin = new Thickness(10, 10, 10, 10);
- KonradButton.BackgroundColor = Color.LightGray;
- KonradButton.BorderColor = Color.Black;
- KonradButton.Margin = new Thickness(10, 10, 10, 10);
- }
- }
+ ///
+ /// Applies iOS specific styling to branded Buttons.
+ ///
+ private void ApplyCustomiOSStyling()
+ {
+ if (Device.RuntimePlatform == Device.iOS)
+ {
+ TINKButton.BackgroundColor = Color.LightGray;
+ TINKButton.BorderColor = Color.Black;
+ TINKButton.Margin = new Thickness(10, 10, 10, 10);
+ KonradButton.BackgroundColor = Color.LightGray;
+ KonradButton.BorderColor = Color.Black;
+ KonradButton.Margin = new Thickness(10, 10, 10, 10);
+ }
+ }
- ///
- /// Invoked when pages is closed/ hidden.
- /// Stops update process.
- ///
- protected override async void OnDisappearing()
- {
- if (MapPageViewModel != null)
- {
- // View model might be null.
- await MapPageViewModel?.OnDisappearing();
- }
+ ///
+ /// Invoked when pages is closed/ hidden.
+ /// Stops update process.
+ ///
+ protected override async void OnDisappearing()
+ {
+ if (MapPageViewModel != null)
+ {
+ // View model might be null.
+ await MapPageViewModel?.OnDisappearing();
+ }
- base.OnDisappearing();
- }
- }
+ base.OnDisappearing();
+ }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK/View/MiniSurvey/MiniSurveyPage.xaml.cs b/LastenradBayern/TINK/View/MiniSurvey/MiniSurveyPage.xaml.cs
index 921e19f..f231968 100644
--- a/LastenradBayern/TINK/View/MiniSurvey/MiniSurveyPage.xaml.cs
+++ b/LastenradBayern/TINK/View/MiniSurvey/MiniSurveyPage.xaml.cs
@@ -8,93 +8,93 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.MiniSurvey
{
- [XamlCompilation(XamlCompilationOptions.Compile)]
- public partial class MiniSurveyPage : ContentPage, IViewService
- {
- public MiniSurveyPage()
- {
- var model = App.ModelRoot;
+ [XamlCompilation(XamlCompilationOptions.Compile)]
+ public partial class MiniSurveyPage : ContentPage, IViewService
+ {
+ public MiniSurveyPage()
+ {
+ var model = App.ModelRoot;
- var vm = new MiniSurveyViewModel(
- () => model.GetIsConnected(),
- (isConnected) => model.GetConnector(isConnected),
- this);
+ var vm = new MiniSurveyViewModel(
+ () => model.GetIsConnected(),
+ (isConnected) => model.GetConnector(isConnected),
+ this);
- InitializeComponent();
+ InitializeComponent();
- BindingContext = vm;
- MiniSurveyListView.ItemsSource = vm;
- }
+ BindingContext = vm;
+ MiniSurveyListView.ItemsSource = vm;
+ }
- ///
- /// Displays alert message.
- ///
- /// Title of message.
- /// Message to display.
- /// Type of buttons.
- public new async Task DisplayAlert(string p_strTitle, string p_strMessage, string p_strCancel)
- => await App.Current.MainPage.DisplayAlert(p_strTitle, p_strMessage, p_strCancel);
+ ///
+ /// Displays alert message.
+ ///
+ /// Title of message.
+ /// Message to display.
+ /// Type of buttons.
+ public new async Task DisplayAlert(string p_strTitle, string p_strMessage, string p_strCancel)
+ => await App.Current.MainPage.DisplayAlert(p_strTitle, p_strMessage, p_strCancel);
- /// Displays alert message.
- /// Title of message.
- /// Message to display.
- /// Detailed error description.
- /// Type of buttons.
- public async Task DisplayAdvancedAlert(
- string title,
- string message,
- string details,
- string cancel)
- => await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel);
+ /// Displays alert message.
+ /// Title of message.
+ /// Message to display.
+ /// Detailed error description.
+ /// Type of buttons.
+ public async Task DisplayAdvancedAlert(
+ string title,
+ string message,
+ string details,
+ string cancel)
+ => await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel);
- /// Displays detailed alert message.
- /// Title of message.
- /// Message to display.
- /// Detailed error description.
- /// Text of accept button.
- /// Text of cancel button.
- /// True if user pressed accept.
- public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel)
- => await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel);
+ /// Displays detailed alert message.
+ /// Title of message.
+ /// Message to display.
+ /// Detailed error description.
+ /// Text of accept button.
+ /// Text of cancel button.
+ /// True if user pressed accept.
+ public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel)
+ => await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel);
- ///
- /// Displays alert message.
- ///
- /// Title of message.
- /// Message to display.
- /// Text of accept button.
- /// Text of button.
- /// True if user pressed accept.
- public new async Task DisplayAlert(string p_strTitle, string p_strMessage, string p_strAccept, string p_strCancel)
- => await App.Current.MainPage.DisplayAlert(p_strTitle, p_strMessage, p_strAccept, p_strCancel);
+ ///
+ /// Displays alert message.
+ ///
+ /// Title of message.
+ /// Message to display.
+ /// Text of accept button.
+ /// Text of button.
+ /// True if user pressed accept.
+ public new async Task DisplayAlert(string p_strTitle, string p_strMessage, string p_strAccept, string p_strCancel)
+ => await App.Current.MainPage.DisplayAlert(p_strTitle, p_strMessage, p_strAccept, p_strCancel);
#if USEFLYOUT
public void ShowPage(ViewTypes p_oType, string p_strTitle = null)
=> throw new NotImplementedException();
#else
- /// Shows a page.
- /// Route of the page to show.
- public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route);
+ /// Shows a page.
+ /// Route of the page to show.
+ public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route);
#endif
- /// Pushes a page onto the modal stack.
- /// Page to display.
- public Task PushModalAsync(ViewTypes p_oTypeOfPage) => throw new NotSupportedException();
+ /// Pushes a page onto the modal stack.
+ /// Page to display.
+ public Task PushModalAsync(ViewTypes p_oTypeOfPage) => throw new NotSupportedException();
- /// Pops a page from the modal stack.
- public Task PopModalAsync() => Navigation.PopModalAsync();
+ /// Pops a page from the modal stack.
+ public Task PopModalAsync() => Navigation.PopModalAsync();
- /// Pushes a page onto the stack.
- /// Page to display.
- public Task PushAsync(ViewTypes p_oTypeOfPage) => throw new NotSupportedException();
+ /// Pushes a page onto the stack.
+ /// Page to display.
+ public Task PushAsync(ViewTypes p_oTypeOfPage) => throw new NotSupportedException();
#if USCSHARP9
public async Task DisplayUserFeedbackPopup() => await Navigation.ShowPopupAsync(new FeedbackPopup());
#else
- /// Displays user feedback popup.
- /// Co2 saving information.
- /// User feedback.
- public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => await Navigation.ShowPopupAsync(new FeedbackPopup(battery, co2Saving));
+ /// Displays user feedback popup.
+ /// Co2 saving information.
+ /// User feedback.
+ public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => await Navigation.ShowPopupAsync(new FeedbackPopup(battery, co2Saving));
#endif
- }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK/View/MiniSurvey/Question/CheckOneViewCell.xaml.cs b/LastenradBayern/TINK/View/MiniSurvey/Question/CheckOneViewCell.xaml.cs
index d18c3dd..fd88eff 100644
--- a/LastenradBayern/TINK/View/MiniSurvey/Question/CheckOneViewCell.xaml.cs
+++ b/LastenradBayern/TINK/View/MiniSurvey/Question/CheckOneViewCell.xaml.cs
@@ -3,12 +3,12 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.MiniSurvey.Question
{
- [XamlCompilation(XamlCompilationOptions.Compile)]
- public partial class CheckOneViewCell : ViewCell
- {
- public CheckOneViewCell()
- {
- InitializeComponent();
- }
- }
+ [XamlCompilation(XamlCompilationOptions.Compile)]
+ public partial class CheckOneViewCell : ViewCell
+ {
+ public CheckOneViewCell()
+ {
+ InitializeComponent();
+ }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK/View/MiniSurvey/Question/FreeTextViewCell.xaml.cs b/LastenradBayern/TINK/View/MiniSurvey/Question/FreeTextViewCell.xaml.cs
index 2f7c71e..e1304d9 100644
--- a/LastenradBayern/TINK/View/MiniSurvey/Question/FreeTextViewCell.xaml.cs
+++ b/LastenradBayern/TINK/View/MiniSurvey/Question/FreeTextViewCell.xaml.cs
@@ -4,12 +4,12 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.MiniSurvey.Question
{
- [XamlCompilation(XamlCompilationOptions.Compile)]
- public partial class FreeTextViewCell : ViewCell
- {
- public FreeTextViewCell()
- {
- InitializeComponent();
- }
- }
+ [XamlCompilation(XamlCompilationOptions.Compile)]
+ public partial class FreeTextViewCell : ViewCell
+ {
+ public FreeTextViewCell()
+ {
+ InitializeComponent();
+ }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK/View/MiniSurvey/Question/QuestionViewCellTemplateSelector.cs b/LastenradBayern/TINK/View/MiniSurvey/Question/QuestionViewCellTemplateSelector.cs
index a5f70ff..0c6357c 100644
--- a/LastenradBayern/TINK/View/MiniSurvey/Question/QuestionViewCellTemplateSelector.cs
+++ b/LastenradBayern/TINK/View/MiniSurvey/Question/QuestionViewCellTemplateSelector.cs
@@ -2,25 +2,25 @@
namespace TINK.View.MiniSurvey.Question
{
- ///
- /// Selects different templates for different question types.
- ///
- public class QuestionViewCellTemplateSelector : DataTemplateSelector
- {
- DataTemplate checkOneViewCell;
- DataTemplate freeTextViewCell;
+ ///
+ /// Selects different templates for different question types.
+ ///
+ public class QuestionViewCellTemplateSelector : DataTemplateSelector
+ {
+ DataTemplate checkOneViewCell;
+ DataTemplate freeTextViewCell;
- public QuestionViewCellTemplateSelector()
- {
- checkOneViewCell = new DataTemplate(typeof(CheckOneViewCell));
- freeTextViewCell = new DataTemplate(typeof(FreeTextViewCell));
- }
+ public QuestionViewCellTemplateSelector()
+ {
+ checkOneViewCell = new DataTemplate(typeof(CheckOneViewCell));
+ freeTextViewCell = new DataTemplate(typeof(FreeTextViewCell));
+ }
- protected override DataTemplate OnSelectTemplate(object item, BindableObject container)
- {
- return item is ViewModel.MiniSurvey.Question.FreeTextViewModel
- ? freeTextViewCell
- : checkOneViewCell;
- }
- }
+ protected override DataTemplate OnSelectTemplate(object item, BindableObject container)
+ {
+ return item is ViewModel.MiniSurvey.Question.FreeTextViewModel
+ ? freeTextViewCell
+ : checkOneViewCell;
+ }
+ }
}
diff --git a/LastenradBayern/TINK/View/MyBikes/MyBikesPage.xaml.cs b/LastenradBayern/TINK/View/MyBikes/MyBikesPage.xaml.cs
index 071db56..903878a 100644
--- a/LastenradBayern/TINK/View/MyBikes/MyBikesPage.xaml.cs
+++ b/LastenradBayern/TINK/View/MyBikes/MyBikesPage.xaml.cs
@@ -10,177 +10,177 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.MyBikes
{
- using Serilog;
- using TINK.Model;
- using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
- using TINK.Model.Device;
- using TINK.ViewModel.MyBikes;
- using Xamarin.CommunityToolkit.Extensions;
+ using Serilog;
+ using TINK.Model;
+ using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
+ using TINK.Model.Device;
+ using TINK.ViewModel.MyBikes;
+ using Xamarin.CommunityToolkit.Extensions;
- [XamlCompilation(XamlCompilationOptions.Compile)]
- public partial class MyBikesPage : ContentPage, IViewService
- {
- /// Refernce to view model.
- MyBikesPageViewModel m_oViewModel = null;
+ [XamlCompilation(XamlCompilationOptions.Compile)]
+ public partial class MyBikesPage : ContentPage, IViewService
+ {
+ /// Refernce to view model.
+ MyBikesPageViewModel m_oViewModel = null;
- /// Initialization status to ensure initialization logic is not called multiple times.
- private bool isInitializationStarted = false;
+ /// Initialization status to ensure initialization logic is not called multiple times.
+ private bool isInitializationStarted = false;
- ///
- /// Constructs a my bikes page.
- ///
- public MyBikesPage()
- {
- }
+ ///
+ /// Constructs a my bikes page.
+ ///
+ public MyBikesPage()
+ {
+ }
- ///
- /// Invoked when page is shown.
- /// Starts update process.
- ///
- protected async override void OnAppearing()
- {
- // Don't repeat the initialization if it has been completed already.
- if (isInitializationStarted) return;
- isInitializationStarted = true;
+ ///
+ /// Invoked when page is shown.
+ /// Starts update process.
+ ///
+ 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)
- {
- // 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;
- }
+ 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;
+ }
- try
- {
- var model = App.ModelRoot;
+ try
+ {
+ var model = App.ModelRoot;
- // Backup synchronization context when called from GUI-thread.
- var synchronizationContext = SynchronizationContext.Current;
+ // Backup synchronization context when called from GUI-thread.
+ var synchronizationContext = SynchronizationContext.Current;
- m_oViewModel = new MyBikesPageViewModel(
- model.ActiveUser,
- App.PermissionsService,
- App.BluetoothService,
- Device.RuntimePlatform,
- () => model.GetIsConnected(),
- (isConnected) => model.GetConnector(isConnected),
- App.LocationServicesContainer.Active,
- model.LocksServices.Active,
- model.Stations,
- model.Polling,
- (d, obj) => synchronizationContext.Post(d, obj),
- model.SmartDevice,
- this,
- (url) => DependencyService.Get().OpenUrl(url))
- {
- IsReportLevelVerbose = model.IsReportLevelVerbose
- };
- }
- catch (Exception exception)
- {
- Log.ForContext().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;
- }
+ m_oViewModel = new MyBikesPageViewModel(
+ model.ActiveUser,
+ App.PermissionsService,
+ App.BluetoothService,
+ Device.RuntimePlatform,
+ () => model.GetIsConnected(),
+ (isConnected) => model.GetConnector(isConnected),
+ App.LocationServicesContainer.Active,
+ model.LocksServices.Active,
+ model.Stations,
+ model.Polling,
+ (d, obj) => synchronizationContext.Post(d, obj),
+ model.SmartDevice,
+ this,
+ (url) => DependencyService.Get().OpenUrl(url))
+ {
+ IsReportLevelVerbose = model.IsReportLevelVerbose
+ };
+ }
+ catch (Exception exception)
+ {
+ Log.ForContext().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();
+ InitializeComponent();
- BindingContext = m_oViewModel;
- MyBikesListView.ItemsSource = m_oViewModel;
+ BindingContext = m_oViewModel;
+ MyBikesListView.ItemsSource = m_oViewModel;
- await m_oViewModel.OnAppearing();
- isInitializationStarted = false;
- }
+ await m_oViewModel.OnAppearing();
+ isInitializationStarted = false;
+ }
- ///
- /// Invoked when pages is closed/ hidden.
- /// Stops update process.
- ///
- protected async override void OnDisappearing()
- {
- if (m_oViewModel == null)
- {
- // View model might be null (Example: Occured when page to querry for location permissions was opened)
- return;
- }
+ ///
+ /// Invoked when pages is closed/ hidden.
+ /// Stops update process.
+ ///
+ protected async override void OnDisappearing()
+ {
+ if (m_oViewModel == null)
+ {
+ // View model might be null (Example: Occured when page to querry for location permissions was opened)
+ return;
+ }
- await m_oViewModel.OnDisappearing();
- }
+ await m_oViewModel.OnDisappearing();
+ }
- ///
- /// Displays alert message.
- ///
- /// Title of message.
- /// Message to display.
- /// Type of buttons.
- public new async Task DisplayAlert(string p_strTitle, string p_strMessage, string p_strCancel)
- => await App.Current.MainPage.DisplayAlert(p_strTitle, p_strMessage, p_strCancel);
+ ///
+ /// Displays alert message.
+ ///
+ /// Title of message.
+ /// Message to display.
+ /// Type of buttons.
+ public new async Task DisplayAlert(string p_strTitle, string p_strMessage, string p_strCancel)
+ => await App.Current.MainPage.DisplayAlert(p_strTitle, p_strMessage, p_strCancel);
- /// Displays alert message.
- /// Title of message.
- /// Message to display.
- /// Detailed error description.
- /// Type of buttons.
- public async Task DisplayAdvancedAlert(
- string title,
- string message,
- string details,
- string cancel)
- => await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel);
+ /// Displays alert message.
+ /// Title of message.
+ /// Message to display.
+ /// Detailed error description.
+ /// Type of buttons.
+ public async Task DisplayAdvancedAlert(
+ string title,
+ string message,
+ string details,
+ string cancel)
+ => await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel);
- /// Displays detailed alert message.
- /// Title of message.
- /// Message to display.
- /// Detailed error description.
- /// Text of accept button.
- /// Text of cancel button.
- /// True if user pressed accept.
- public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel)
- => await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel);
+ /// Displays detailed alert message.
+ /// Title of message.
+ /// Message to display.
+ /// Detailed error description.
+ /// Text of accept button.
+ /// Text of cancel button.
+ /// True if user pressed accept.
+ public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel)
+ => await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel);
- ///
- /// Displays alert message.
- ///
- /// Title of message.
- /// Message to display.
- /// Text of accept button.
- /// Text of button.
- /// True if user pressed accept.
- public new async Task DisplayAlert(string p_strTitle, string p_strMessage, string p_strAccept, string p_strCancel)
- => await App.Current.MainPage.DisplayAlert(p_strTitle, p_strMessage, p_strAccept, p_strCancel);
+ ///
+ /// Displays alert message.
+ ///
+ /// Title of message.
+ /// Message to display.
+ /// Text of accept button.
+ /// Text of button.
+ /// True if user pressed accept.
+ public new async Task DisplayAlert(string p_strTitle, string p_strMessage, string p_strAccept, string p_strCancel)
+ => await App.Current.MainPage.DisplayAlert(p_strTitle, p_strMessage, p_strAccept, p_strCancel);
#if USEFLYOUT
public void ShowPage(ViewTypes p_oType, string p_strTitle = null)
=> throw new NotImplementedException();
#else
- /// Shows a page.
- /// Route of the page to show.
- public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route);
+ /// Shows a page.
+ /// Route of the page to show.
+ public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route);
#endif
- /// Pushes a page onto the modal stack.
- /// Page to display.
- public async Task PushModalAsync(ViewTypes typeOfPage)
- => await Navigation.PushModalAsync((Page)Activator.CreateInstance(typeOfPage.GetViewType()));
+ /// Pushes a page onto the modal stack.
+ /// Page to display.
+ public async Task PushModalAsync(ViewTypes typeOfPage)
+ => await Navigation.PushModalAsync((Page)Activator.CreateInstance(typeOfPage.GetViewType()));
- /// Pops a page from the modal stack.
- public Task PopModalAsync() => throw new NotSupportedException();
+ /// Pops a page from the modal stack.
+ public Task PopModalAsync() => throw new NotSupportedException();
- /// Pushes a page onto the stack.
- /// Page to display.
- public Task PushAsync(ViewTypes p_oTypeOfPage) => throw new NotSupportedException();
+ /// Pushes a page onto the stack.
+ /// Page to display.
+ public Task PushAsync(ViewTypes p_oTypeOfPage) => throw new NotSupportedException();
#if USCSHARP9
public async Task DisplayUserFeedbackPopup() => await Navigation.ShowPopupAsync(new FeedbackPopup());
#else
- /// Displays user feedback popup.
- /// Co2 saving information.
- /// User feedback.
- public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => await Navigation.ShowPopupAsync(new FeedbackPopup(battery, co2Saving));
+ /// Displays user feedback popup.
+ /// Co2 saving information.
+ /// User feedback.
+ public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => await Navigation.ShowPopupAsync(new FeedbackPopup(battery, co2Saving));
#endif
- }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK/View/RootFlyout/RootPage.xaml.cs b/LastenradBayern/TINK/View/RootFlyout/RootPage.xaml.cs
index f3a52bb..7a0ecd0 100644
--- a/LastenradBayern/TINK/View/RootFlyout/RootPage.xaml.cs
+++ b/LastenradBayern/TINK/View/RootFlyout/RootPage.xaml.cs
@@ -8,35 +8,35 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.Root
{
- ///
- /// Mamages creation of detail pages if a flyout page menu entry is selected.
- /// Exposes flyout page style navigation which is used by detail pages.
- ///
- ///
- /// Examples of use cases when detail pages do navigation:
- // - switch to map page after succesfully logging in/ logging out
- // - switch to login page form bikes at station page if not yet logged in
- ///
- [XamlCompilation(XamlCompilationOptions.Compile)]
+ ///
+ /// Mamages creation of detail pages if a flyout page menu entry is selected.
+ /// Exposes flyout page style navigation which is used by detail pages.
+ ///
+ ///
+ /// Examples of use cases when detail pages do navigation:
+ // - switch to map page after succesfully logging in/ logging out
+ // - switch to login page form bikes at station page if not yet logged in
+ ///
+ [XamlCompilation(XamlCompilationOptions.Compile)]
#if USEFLYOUT
public partial class RootPage : FlyoutPage, INavigationMasterDetail
#else
- public partial class RootPage : FlyoutPage
+ public partial class RootPage : FlyoutPage
#endif
- {
- public RootPage()
- {
- InitializeComponent();
- FlyoutPage.ListView.ItemSelected += OnListViewItemSelected;
+ {
+ public RootPage()
+ {
+ InitializeComponent();
+ FlyoutPage.ListView.ItemSelected += OnListViewItemSelected;
- // Any type of split behaviour conflics with map shifting functionality (assuming FlyoutPage behaves same like MasterDetailPage).
- FlyoutLayoutBehavior = FlyoutLayoutBehavior.Popover;
+ // Any type of split behaviour conflics with map shifting functionality (assuming FlyoutPage behaves same like MasterDetailPage).
+ FlyoutLayoutBehavior = FlyoutLayoutBehavior.Popover;
- var navigationPage = Detail as NavigationPage;
- if (navigationPage == null)
- {
- return;
- }
+ var navigationPage = Detail as NavigationPage;
+ if (navigationPage == null)
+ {
+ return;
+ }
#if USEFLYOUT
var detailPage = navigationPage.RootPage as IDetailPage;
@@ -47,38 +47,38 @@ namespace TINK.View.Root
detailPage.NavigationMasterDetail = this;
#endif
- }
+ }
- ///
- /// Is called if a flyout page menu entry is selected.
- /// Creates a new page.
- ///
- private void OnListViewItemSelected(object sender, SelectedItemChangedEventArgs e)
- {
- if (!(e.SelectedItem is RootPageFlyoutMenuItem item))
- {
- // Unexpected argument detected.
- return;
- }
+ ///
+ /// Is called if a flyout page menu entry is selected.
+ /// Creates a new page.
+ ///
+ private void OnListViewItemSelected(object sender, SelectedItemChangedEventArgs e)
+ {
+ if (!(e.SelectedItem is RootPageFlyoutMenuItem item))
+ {
+ // Unexpected argument detected.
+ return;
+ }
- // Set selected station to new
- App.ModelRoot.SelectedStation = new NullStation();
+ // Set selected station to new
+ App.ModelRoot.SelectedStation = new NullStation();
- ShowPage(item.TargetType, item.Title);
+ ShowPage(item.TargetType, item.Title);
- IsPresented = false;
- FlyoutPage.ListView.SelectedItem = null;
- }
+ IsPresented = false;
+ FlyoutPage.ListView.SelectedItem = null;
+ }
- ///
- /// Shows a detail page.
- ///
- /// Type of page to show.
- /// Title of page.
- public void ShowPage(Type typeOfPage, string title)
- {
- var page = (Page)Activator.CreateInstance(typeOfPage);
- page.Title = title;
+ ///
+ /// Shows a detail page.
+ ///
+ /// Type of page to show.
+ /// Title of page.
+ public void ShowPage(Type typeOfPage, string title)
+ {
+ var page = (Page)Activator.CreateInstance(typeOfPage);
+ page.Title = title;
#if USEFLYOUT
if (page is IDetailPage detailPage)
@@ -89,7 +89,7 @@ namespace TINK.View.Root
}
#endif
- Detail = new NavigationPage(page);
- }
- }
+ Detail = new NavigationPage(page);
+ }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK/View/RootFlyout/RootPageFlyout.xaml.cs b/LastenradBayern/TINK/View/RootFlyout/RootPageFlyout.xaml.cs
index 5134fa0..0b6a960 100644
--- a/LastenradBayern/TINK/View/RootFlyout/RootPageFlyout.xaml.cs
+++ b/LastenradBayern/TINK/View/RootFlyout/RootPageFlyout.xaml.cs
@@ -18,19 +18,19 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.Root
{
- [XamlCompilation(XamlCompilationOptions.Compile)]
- public partial class RootPageFlyout : ContentPage
- {
- public ListView ListView;
+ [XamlCompilation(XamlCompilationOptions.Compile)]
+ public partial class RootPageFlyout : ContentPage
+ {
+ public ListView ListView;
- public RootPageFlyout()
- {
- InitializeComponent();
+ public RootPageFlyout()
+ {
+ InitializeComponent();
- BindingContext = new RootPageFlyoutViewModel();
+ BindingContext = new RootPageFlyoutViewModel();
- ListView = MenuItemsListView;
- }
+ ListView = MenuItemsListView;
+ }
- }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK/View/RootFlyout/RootPageFlyoutMenuItem.cs b/LastenradBayern/TINK/View/RootFlyout/RootPageFlyoutMenuItem.cs
index 4756def..850e69f 100644
--- a/LastenradBayern/TINK/View/RootFlyout/RootPageFlyoutMenuItem.cs
+++ b/LastenradBayern/TINK/View/RootFlyout/RootPageFlyoutMenuItem.cs
@@ -3,18 +3,18 @@
namespace TINK.View.Root
{
- public class RootPageFlyoutMenuItem
- {
- public RootPageFlyoutMenuItem()
- {
- TargetType = typeof(RootPageFlyoutMenuItem);
- }
- public int Id { get; set; }
+ public class RootPageFlyoutMenuItem
+ {
+ public RootPageFlyoutMenuItem()
+ {
+ TargetType = typeof(RootPageFlyoutMenuItem);
+ }
+ public int Id { get; set; }
- public string GlyphCode { get; set; }
+ public string GlyphCode { get; set; }
- public string Title { get; set; }
+ public string Title { get; set; }
- public Type TargetType { get; set; }
- }
+ public Type TargetType { get; set; }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK/View/RootMasterDetail/MainPageMenuItem.cs b/LastenradBayern/TINK/View/RootMasterDetail/MainPageMenuItem.cs
index ca04b1e..5fe31de 100644
--- a/LastenradBayern/TINK/View/RootMasterDetail/MainPageMenuItem.cs
+++ b/LastenradBayern/TINK/View/RootMasterDetail/MainPageMenuItem.cs
@@ -4,39 +4,39 @@ using TINK.ViewModel.MasterDetail;
namespace TINK.View
{
- public class MainPageMenuItem
- {
- public MainPageMenuItem()
- {
- TargetType = typeof(MapPage);
- }
+ public class MainPageMenuItem
+ {
+ public MainPageMenuItem()
+ {
+ TargetType = typeof(MapPage);
+ }
- public MainPageMenuItem(
- int p_iId,
- Type p_oTypeOfPage,
- string p_strTitle = null)
- {
- TargetType = p_oTypeOfPage;
- Id = p_iId;
- Title = p_strTitle ?? Helper.GetCaption(p_oTypeOfPage);
- }
+ public MainPageMenuItem(
+ int p_iId,
+ Type p_oTypeOfPage,
+ string p_strTitle = null)
+ {
+ TargetType = p_oTypeOfPage;
+ Id = p_iId;
+ Title = p_strTitle ?? Helper.GetCaption(p_oTypeOfPage);
+ }
- public int Id
- {
- get;
- private set;
- }
+ public int Id
+ {
+ get;
+ private set;
+ }
- public string Title
- {
- get;
- private set;
- }
+ public string Title
+ {
+ get;
+ private set;
+ }
- public Type TargetType
- {
- get;
- private set;
- }
- }
+ public Type TargetType
+ {
+ get;
+ private set;
+ }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK/View/RootShell/AppShell.xaml.cs b/LastenradBayern/TINK/View/RootShell/AppShell.xaml.cs
index 71f7994..b27cdc1 100644
--- a/LastenradBayern/TINK/View/RootShell/AppShell.xaml.cs
+++ b/LastenradBayern/TINK/View/RootShell/AppShell.xaml.cs
@@ -4,12 +4,12 @@ using Xamarin.Forms;
namespace TINK.View.RootShell
{
- public partial class AppShell : Shell
- {
- public AppShell()
- {
- InitializeComponent();
- BindingContext = new AppShellViewModel();
- }
- }
+ public partial class AppShell : Shell
+ {
+ public AppShell()
+ {
+ InitializeComponent();
+ BindingContext = new AppShellViewModel();
+ }
+ }
}
diff --git a/LastenradBayern/TINK/View/RootShell/FlyoutHeader.xaml.cs b/LastenradBayern/TINK/View/RootShell/FlyoutHeader.xaml.cs
index 8dda9e4..67382d5 100644
--- a/LastenradBayern/TINK/View/RootShell/FlyoutHeader.xaml.cs
+++ b/LastenradBayern/TINK/View/RootShell/FlyoutHeader.xaml.cs
@@ -9,12 +9,12 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.RootShell
{
- [XamlCompilation(XamlCompilationOptions.Compile)]
- public partial class FlyoutHeader : ContentView
- {
- public FlyoutHeader()
- {
- InitializeComponent();
- }
- }
+ [XamlCompilation(XamlCompilationOptions.Compile)]
+ public partial class FlyoutHeader : ContentView
+ {
+ public FlyoutHeader()
+ {
+ InitializeComponent();
+ }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK/View/Settings/SettingsPage.xaml.cs b/LastenradBayern/TINK/View/Settings/SettingsPage.xaml.cs
index 8166aa5..00d3271 100644
--- a/LastenradBayern/TINK/View/Settings/SettingsPage.xaml.cs
+++ b/LastenradBayern/TINK/View/Settings/SettingsPage.xaml.cs
@@ -12,82 +12,82 @@ using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
namespace TINK.View.Settings
{
- [XamlCompilation(XamlCompilationOptions.Compile)]
+ [XamlCompilation(XamlCompilationOptions.Compile)]
#if USEFLYOUT
public partial class SettingsPage : ContentPage, IViewService, IDetailPage
#else
- public partial class SettingsPage : ContentPage, IViewService
+ public partial class SettingsPage : ContentPage, IViewService
#endif
- {
- /// Refernce to view model.
- SettingsPageViewModel m_oViewModel = null;
+ {
+ /// Refernce to view model.
+ SettingsPageViewModel m_oViewModel = null;
- /// Constructs a settings page.
- public SettingsPage()
- {
- InitializeComponent();
+ /// Constructs a settings page.
+ public SettingsPage()
+ {
+ InitializeComponent();
- var l_oModel = App.ModelRoot;
+ var l_oModel = App.ModelRoot;
- m_oViewModel = new SettingsPageViewModel(
- l_oModel,
- App.LocationServicesContainer,
- this);
+ m_oViewModel = new SettingsPageViewModel(
+ l_oModel,
+ App.LocationServicesContainer,
+ this);
- BindingContext = m_oViewModel;
+ BindingContext = m_oViewModel;
- Filters.ItemsSource = m_oViewModel.GroupFilter;
- }
+ Filters.ItemsSource = m_oViewModel.GroupFilter;
+ }
- /// Displays alert message.
- /// Title of message.
- /// Message to display.
- /// Type of buttons.
- public new async Task DisplayAlert(string p_strTitle, string p_strMessage, string p_strCancel)
- => await App.Current.MainPage.DisplayAlert(p_strTitle, p_strMessage, p_strCancel);
+ /// Displays alert message.
+ /// Title of message.
+ /// Message to display.
+ /// Type of buttons.
+ public new async Task DisplayAlert(string p_strTitle, string p_strMessage, string p_strCancel)
+ => await App.Current.MainPage.DisplayAlert(p_strTitle, p_strMessage, p_strCancel);
- /// Displays alert message.
- /// Title of message.
- /// Message to display.
- /// Detailed error description.
- /// Type of buttons.
- public async Task DisplayAdvancedAlert(
- string title,
- string message,
- string details,
- string cancel)
- => await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel);
+ /// Displays alert message.
+ /// Title of message.
+ /// Message to display.
+ /// Detailed error description.
+ /// Type of buttons.
+ public async Task DisplayAdvancedAlert(
+ string title,
+ string message,
+ string details,
+ string cancel)
+ => await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel);
- /// Displays detailed alert message.
- /// Title of message.
- /// Message to display.
- /// Detailed error description.
- /// Text of accept button.
- /// Text of cancel button.
- /// True if user pressed accept.
- public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel)
- => await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel);
+ /// Displays detailed alert message.
+ /// Title of message.
+ /// Message to display.
+ /// Detailed error description.
+ /// Text of accept button.
+ /// Text of cancel button.
+ /// True if user pressed accept.
+ public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel)
+ => await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel);
- /// Displays alert message.
- /// Title of message.
- /// Message to display.
- /// Text of accept button.
- /// Text of button.
- /// True if user pressed accept.
- public new async Task DisplayAlert(string p_strTitle, string p_strMessage, string p_strAccept, string p_strCancel)
- => await App.Current.MainPage.DisplayAlert(p_strTitle, p_strMessage, p_strAccept, p_strCancel);
+ /// Displays alert message.
+ /// Title of message.
+ /// Message to display.
+ /// Text of accept button.
+ /// Text of button.
+ /// True if user pressed accept.
+ public new async Task DisplayAlert(string p_strTitle, string p_strMessage, string p_strAccept, string p_strCancel)
+ => await App.Current.MainPage.DisplayAlert(p_strTitle, p_strMessage, p_strAccept, p_strCancel);
- ///
- /// Displays an action sheet.
- ///
- /// Title of message.
- /// Message to display.
- /// Text of button.
- ///
- /// Buttons holding options to select.
- /// Text selected
- public new async Task DisplayActionSheet(String p_strTitle, String p_strCancel, String destruction, params String[] p_oButtons)
- => await base.DisplayActionSheet(p_strTitle, p_strCancel, destruction, p_oButtons);
+ ///
+ /// Displays an action sheet.
+ ///
+ /// Title of message.
+ /// Message to display.
+ /// Text of button.
+ ///
+ /// Buttons holding options to select.
+ /// Text selected
+ public new async Task DisplayActionSheet(String p_strTitle, String p_strCancel, String destruction, params String[] p_oButtons)
+ => await base.DisplayActionSheet(p_strTitle, p_strCancel, destruction, p_oButtons);
#if USEFLYOUT
///
@@ -97,19 +97,19 @@ namespace TINK.View.Settings
public void ShowPage(ViewTypes p_oType, string p_strTitle = null)
=> m_oNavigation.ShowPage(p_oType.GetViewType(), p_strTitle);
#else
- /// Shows a page.
- /// Route of the page to show.
- public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route);
+ /// Shows a page.
+ /// Route of the page to show.
+ public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route);
#endif
- /// Pushes a page onto the modal stack.
- /// Page to display.
- public Task PushModalAsync(ViewTypes p_oTypeOfPage)
- => throw new NotImplementedException();
+ /// Pushes a page onto the modal stack.
+ /// Page to display.
+ public Task PushModalAsync(ViewTypes p_oTypeOfPage)
+ => throw new NotImplementedException();
- /// Pops a page from the modal stack.
- public Task PopModalAsync()
- => throw new NotSupportedException();
+ /// Pops a page from the modal stack.
+ public Task PopModalAsync()
+ => throw new NotSupportedException();
#if USEFLYOUT
/// Delegate to perform navigation.
@@ -124,33 +124,33 @@ namespace TINK.View.Settings
}
#endif
- ///
- /// Invoked when pages is closed/ hidden.
- /// Stops update process.
- ///
- protected async override void OnDisappearing()
- {
- if (m_oViewModel == null)
- {
- // View model might be null.
- return;
- }
+ ///
+ /// Invoked when pages is closed/ hidden.
+ /// Stops update process.
+ ///
+ protected async override void OnDisappearing()
+ {
+ if (m_oViewModel == null)
+ {
+ // View model might be null.
+ return;
+ }
- await m_oViewModel?.OnDisappearing();
- }
+ await m_oViewModel?.OnDisappearing();
+ }
- /// Pushes a page onto the stack.
- /// Page to display.
- public async Task PushAsync(ViewTypes p_oTypeOfPage)
- => await Navigation.PushAsync((Page)Activator.CreateInstance(p_oTypeOfPage.GetViewType()));
+ /// Pushes a page onto the stack.
+ /// Page to display.
+ public async Task PushAsync(ViewTypes p_oTypeOfPage)
+ => await Navigation.PushAsync((Page)Activator.CreateInstance(p_oTypeOfPage.GetViewType()));
#if USCSHARP9
public async Task DisplayUserFeedbackPopup() => await Navigation.ShowPopupAsync(new FeedbackPopup());
#else
- /// Displays user feedback popup.
- /// Co2 saving information.
- /// User feedback.
- public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => await Navigation.ShowPopupAsync(new FeedbackPopup(battery, co2Saving));
+ /// Displays user feedback popup.
+ /// Co2 saving information.
+ /// User feedback.
+ public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => await Navigation.ShowPopupAsync(new FeedbackPopup(battery, co2Saving));
#endif
#if USERFEEDBACKDLG_TRYOUT
@@ -164,5 +164,5 @@ namespace TINK.View.Settings
"OK");
}
#endif
- }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK/View/StringNotNullOrEmptyToVisibleConverter.cs b/LastenradBayern/TINK/View/StringNotNullOrEmptyToVisibleConverter.cs
index ebf2361..d4c2f32 100644
--- a/LastenradBayern/TINK/View/StringNotNullOrEmptyToVisibleConverter.cs
+++ b/LastenradBayern/TINK/View/StringNotNullOrEmptyToVisibleConverter.cs
@@ -4,20 +4,20 @@ using Xamarin.Forms;
namespace TINK.View
{
- /// Converts a string into visible state. If string is null or empty element becomes invisible.
- public class StringNotNullOrEmptyToVisibleConverter : IValueConverter
- {
- /// Converts a string into visible state.
- /// Text value from view model used to derive whether object is visible or not.
- /// Boolean value indicating whether object is visible or not.
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- return value != null && value is string text && !string.IsNullOrEmpty(text);
- }
+ /// Converts a string into visible state. If string is null or empty element becomes invisible.
+ public class StringNotNullOrEmptyToVisibleConverter : IValueConverter
+ {
+ /// Converts a string into visible state.
+ /// Text value from view model used to derive whether object is visible or not.
+ /// Boolean value indicating whether object is visible or not.
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return value != null && value is string text && !string.IsNullOrEmpty(text);
+ }
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- return "";
- }
- }
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return "";
+ }
+ }
}
diff --git a/LastenradBayern/TINK/View/ViewTypesTypeProvider.cs b/LastenradBayern/TINK/View/ViewTypesTypeProvider.cs
index d5c0c76..30d8cd7 100644
--- a/LastenradBayern/TINK/View/ViewTypesTypeProvider.cs
+++ b/LastenradBayern/TINK/View/ViewTypesTypeProvider.cs
@@ -15,63 +15,63 @@ using Xamarin.Forms;
namespace TINK.View
{
- public static class ViewTypesTypeProvider
- {
- public static Type GetViewType(this ViewTypes viewType)
- {
- switch (viewType)
- {
- case ViewTypes.LoginPage:
- return typeof(LoginPage);
+ public static class ViewTypesTypeProvider
+ {
+ public static Type GetViewType(this ViewTypes viewType)
+ {
+ switch (viewType)
+ {
+ case ViewTypes.LoginPage:
+ return typeof(LoginPage);
- case ViewTypes.MapPage:
- return typeof(MapPage);
+ case ViewTypes.MapPage:
+ return typeof(MapPage);
- case ViewTypes.RegisterPage:
- return typeof(RegisterPage);
+ case ViewTypes.RegisterPage:
+ return typeof(RegisterPage);
- case ViewTypes.PasswordForgottenPage:
- return typeof(PasswordForgottenPage);
+ case ViewTypes.PasswordForgottenPage:
+ return typeof(PasswordForgottenPage);
- case ViewTypes.BikeInfoCarouselPage:
- return typeof(BikeInfoCarouselPage);
+ case ViewTypes.BikeInfoCarouselPage:
+ return typeof(BikeInfoCarouselPage);
- case ViewTypes.MyBikesPage:
- return typeof(MyBikesPage);
+ case ViewTypes.MyBikesPage:
+ return typeof(MyBikesPage);
- case ViewTypes.SettingsPage:
- return typeof(SettingsPage);
+ case ViewTypes.SettingsPage:
+ return typeof(SettingsPage);
- case ViewTypes.TabbedPageInfo:
- return typeof(InfoPage);
+ case ViewTypes.TabbedPageInfo:
+ return typeof(InfoPage);
- case ViewTypes.FeesAndBikesPage:
- return typeof(FeesAndBikesPage);
+ case ViewTypes.FeesAndBikesPage:
+ return typeof(FeesAndBikesPage);
- case ViewTypes.ManageAccountPage:
- return typeof(ManageAccountPage);
+ case ViewTypes.ManageAccountPage:
+ return typeof(ManageAccountPage);
- case ViewTypes.AgbPage:
- return typeof(AgbPage);
+ case ViewTypes.AgbPage:
+ return typeof(AgbPage);
- case ViewTypes.WhatsNewPage:
- return typeof(WhatsNewPage);
+ case ViewTypes.WhatsNewPage:
+ return typeof(WhatsNewPage);
- case ViewTypes.BikesAtStation:
- return typeof(BikesAtStationPage);
+ case ViewTypes.BikesAtStation:
+ return typeof(BikesAtStationPage);
- case ViewTypes.ContactPage:
- return typeof(ContactPage);
+ case ViewTypes.ContactPage:
+ return typeof(ContactPage);
- case ViewTypes.SelectStationPage:
- return typeof(SelectStationPage);
+ case ViewTypes.SelectStationPage:
+ return typeof(SelectStationPage);
- case ViewTypes.MiniSurvey:
- return typeof(MiniSurveyPage);
+ case ViewTypes.MiniSurvey:
+ return typeof(MiniSurveyPage);
- default:
- return typeof(ContentPage);
- }
- }
- }
+ default:
+ return typeof(ContentPage);
+ }
+ }
+ }
}
diff --git a/LastenradBayern/TINK/View/WhatsNew/Agb/AgbPage.xaml.cs b/LastenradBayern/TINK/View/WhatsNew/Agb/AgbPage.xaml.cs
index ccaeb0f..cb114dd 100644
--- a/LastenradBayern/TINK/View/WhatsNew/Agb/AgbPage.xaml.cs
+++ b/LastenradBayern/TINK/View/WhatsNew/Agb/AgbPage.xaml.cs
@@ -9,76 +9,76 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.WhatsNew.Agb
{
- [XamlCompilation(XamlCompilationOptions.Compile)]
- public partial class AgbPage : ContentPage, IViewService
- {
- public AgbPage()
- {
- InitializeComponent();
+ [XamlCompilation(XamlCompilationOptions.Compile)]
+ public partial class AgbPage : ContentPage, IViewService
+ {
+ public AgbPage()
+ {
+ InitializeComponent();
- agbViewModel = new AgbViewModel(
- App.ModelRoot.NextActiveUri.Host,
- App.ModelRoot.IsSiteCachingOn,
- CultureInfo.CurrentUICulture.TwoLetterISOLanguageName,
- (resourceName) => ViewModelResourceHelper.GetSource(resourceName),
- this);
+ agbViewModel = new AgbViewModel(
+ App.ModelRoot.NextActiveUri.Host,
+ App.ModelRoot.IsSiteCachingOn,
+ CultureInfo.CurrentUICulture.TwoLetterISOLanguageName,
+ (resourceName) => ViewModelResourceHelper.GetSource(resourceName),
+ this);
- BindingContext = agbViewModel;
- }
+ BindingContext = agbViewModel;
+ }
- /// Displays alert message.
- /// Title of message.
- /// Message to display.
- /// Detailed error description.
- /// Type of buttons.
- public async Task DisplayAdvancedAlert(
- string title,
- string message,
- string details,
- string cancel)
- => await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel);
+ /// Displays alert message.
+ /// Title of message.
+ /// Message to display.
+ /// Detailed error description.
+ /// Type of buttons.
+ public async Task DisplayAdvancedAlert(
+ string title,
+ string message,
+ string details,
+ string cancel)
+ => await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel);
- /// Displays detailed alert message.
- /// Title of message.
- /// Message to display.
- /// Detailed error description.
- /// Text of accept button.
- /// Text of cancel button.
- /// True if user pressed accept.
- public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel)
- => await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel);
+ /// Displays detailed alert message.
+ /// Title of message.
+ /// Message to display.
+ /// Detailed error description.
+ /// Text of accept button.
+ /// Text of cancel button.
+ /// True if user pressed accept.
+ public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel)
+ => await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel);
- /// Invoked when page is shown.
- protected async override void OnAppearing()
- => await agbViewModel.OnAppearing();
+ /// Invoked when page is shown.
+ protected async override void OnAppearing()
+ => await agbViewModel.OnAppearing();
- /// Reference to view model.
- AgbViewModel agbViewModel;
+ /// Reference to view model.
+ AgbViewModel agbViewModel;
- public async Task PopModalAsync()
- => await Navigation.PopModalAsync();
+ public async Task PopModalAsync()
+ => await Navigation.PopModalAsync();
- /// Pushes a page onto the stack.
- /// Page to display.
- public Task PushAsync(ViewTypes p_oTypeOfPage)
- => throw new NotImplementedException();
+ /// Pushes a page onto the stack.
+ /// Page to display.
+ public Task PushAsync(ViewTypes p_oTypeOfPage)
+ => throw new NotImplementedException();
- public Task PushModalAsync(ViewTypes p_oTypeOfPage)
- => throw new NotImplementedException();
+ public Task PushModalAsync(ViewTypes p_oTypeOfPage)
+ => throw new NotImplementedException();
#if USEFLYOUT
public void ShowPage(ViewTypes p_oType, string p_strTitle = null)
=> throw new NotImplementedException();
#else
- /// Shows a page.
- /// Route of the page to show.
- public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route);
+ /// Shows a page.
+ /// Route of the page to show.
+ public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route);
#endif
#if USCSHARP9
public Task DisplayUserFeedbackPopup() => throw new NotSupportedException();
#else
- public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => throw new NotSupportedException();
+ public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => throw new NotSupportedException();
#endif
- }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK/View/WhatsNew/WhatsNewPage.xaml.cs b/LastenradBayern/TINK/View/WhatsNew/WhatsNewPage.xaml.cs
index f519596..c1c1a2c 100644
--- a/LastenradBayern/TINK/View/WhatsNew/WhatsNewPage.xaml.cs
+++ b/LastenradBayern/TINK/View/WhatsNew/WhatsNewPage.xaml.cs
@@ -7,100 +7,100 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.WhatsNew
{
- [XamlCompilation(XamlCompilationOptions.Compile)]
- public partial class WhatsNewPage : ContentPage, IViewService
- {
- /// Holds a reference on the view model.
- private ViewModel.WhatsNew.WhatsNewViewModel WhatsNewViewModel;
+ [XamlCompilation(XamlCompilationOptions.Compile)]
+ public partial class WhatsNewPage : ContentPage, IViewService
+ {
+ /// Holds a reference on the view model.
+ private ViewModel.WhatsNew.WhatsNewViewModel WhatsNewViewModel;
- /// Constructs whats new page.
- /// Action to invoke master detail page.
- public WhatsNewPage(Action showMasterDetail)
- {
- InitializeComponent();
+ /// Constructs whats new page.
+ /// Action to invoke master detail page.
+ public WhatsNewPage(Action showMasterDetail)
+ {
+ InitializeComponent();
- WhatsNewViewModel = new ViewModel.WhatsNew.WhatsNewViewModel(
- DependencyService.Get().Version,
- App.ModelRoot.WhatsNew.WhatsNewText,
- App.ModelRoot.WhatsNew.IsShowAgbRequired,
- showMasterDetail,
- this);
+ WhatsNewViewModel = new ViewModel.WhatsNew.WhatsNewViewModel(
+ DependencyService.Get().Version,
+ App.ModelRoot.WhatsNew.WhatsNewText,
+ App.ModelRoot.WhatsNew.IsShowAgbRequired,
+ showMasterDetail,
+ this);
- BindingContext = WhatsNewViewModel;
- }
+ BindingContext = WhatsNewViewModel;
+ }
- /// Displays alert message.
- /// Title of message.
- /// Message to display.
- /// Detailed error description.
- /// Type of buttons.
- public async Task DisplayAdvancedAlert(
- string title,
- string message,
- string details,
- string cancel)
- => await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel);
+ /// Displays alert message.
+ /// Title of message.
+ /// Message to display.
+ /// Detailed error description.
+ /// Type of buttons.
+ public async Task DisplayAdvancedAlert(
+ string title,
+ string message,
+ string details,
+ string cancel)
+ => await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel);
- /// Displays detailed alert message.
- /// Title of message.
- /// Message to display.
- /// Detailed error description.
- /// Text of accept button.
- /// Text of cancel button.
- /// True if user pressed accept.
- public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel)
- => await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel);
+ /// Displays detailed alert message.
+ /// Title of message.
+ /// Message to display.
+ /// Detailed error description.
+ /// Text of accept button.
+ /// Text of cancel button.
+ /// True if user pressed accept.
+ public async Task DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel)
+ => await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel);
- public Task PopModalAsync()
- {
- throw new NotImplementedException(); ;
- }
+ public Task PopModalAsync()
+ {
+ throw new NotImplementedException(); ;
+ }
- /// Pushes a page onto the stack.
- /// Page to display.
- public Task PushAsync(ViewTypes p_oTypeOfPage)
- {
- throw new NotImplementedException();
- }
+ /// Pushes a page onto the stack.
+ /// Page to display.
+ public Task PushAsync(ViewTypes p_oTypeOfPage)
+ {
+ throw new NotImplementedException();
+ }
- public async Task PushModalAsync(ViewTypes p_oTypeOfPage)
- {
- await Navigation.PushModalAsync((Page)Activator.CreateInstance(p_oTypeOfPage.GetViewType()));
- }
+ public async Task PushModalAsync(ViewTypes p_oTypeOfPage)
+ {
+ await Navigation.PushModalAsync((Page)Activator.CreateInstance(p_oTypeOfPage.GetViewType()));
+ }
#if USEFLYOUT
public void ShowPage(ViewTypes p_oType, string p_strTitle = null)
=> throw new NotImplementedException();
#else
- /// Shows a page.
- /// Route of the page to show.
- public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route);
+ /// Shows a page.
+ /// Route of the page to show.
+ public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route);
#endif
#if USCSHARP9
public Task DisplayUserFeedbackPopup() => throw new NotSupportedException();
#else
- public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => throw new NotSupportedException();
+ public async Task DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => throw new NotSupportedException();
#endif
- ///
- /// Invoked when pages is closed/ hidden.
- /// ///
- protected override void OnDisappearing()
- {
- base.OnDisappearing();
+ ///
+ /// Invoked when pages is closed/ hidden.
+ /// ///
+ protected override void OnDisappearing()
+ {
+ base.OnDisappearing();
- if (WhatsNewViewModel == null)
- {
- // View model might be null.
- return;
- }
+ if (WhatsNewViewModel == null)
+ {
+ // View model might be null.
+ return;
+ }
- WhatsNewViewModel?.OnDisappearing(() =>
- {
- App.ModelRoot.WhatsNew.WasShownInCurrentSession = true;
- App.ModelRoot.Save();
- });
- }
- }
+ WhatsNewViewModel?.OnDisappearing(() =>
+ {
+ App.ModelRoot.WhatsNew.WasShownInCurrentSession = true;
+ App.ModelRoot.Save();
+ });
+ }
+ }
}
\ No newline at end of file
diff --git a/LastenradBayern/TINK/ViewModel/RootFlyout/RootPageViewModel.cs b/LastenradBayern/TINK/ViewModel/RootFlyout/RootPageViewModel.cs
index 15a5a4d..b7a220b 100644
--- a/LastenradBayern/TINK/ViewModel/RootFlyout/RootPageViewModel.cs
+++ b/LastenradBayern/TINK/ViewModel/RootFlyout/RootPageViewModel.cs
@@ -24,175 +24,175 @@ using TINK.View.Themes;
namespace TINK.ViewModel.Root
{
- ///
- /// View model for flyout menu entries. Respositility
- /// - populates entries depending on app state on showing menu
- /// - updates menu denpending on app state change, i.e. user logs in/ out.
- ///
- public class RootPageFlyoutViewModel : INotifyPropertyChanged
- {
- ///
- /// Dictionary to manage collection of menu items.
- ///
- private Dictionary m_oEntryDictionary;
+ ///
+ /// View model for flyout menu entries. Respositility
+ /// - populates entries depending on app state on showing menu
+ /// - updates menu denpending on app state change, i.e. user logs in/ out.
+ ///
+ public class RootPageFlyoutViewModel : INotifyPropertyChanged
+ {
+ ///
+ /// Dictionary to manage collection of menu items.
+ ///
+ private Dictionary m_oEntryDictionary;
- public event PropertyChangedEventHandler PropertyChanged;
+ public event PropertyChangedEventHandler PropertyChanged;
- /// Updates menu entries depending on state.
- private void UpdateMenuEntries()
- {
- for (int l_iIndex = MenuItems.Count - 1; l_iIndex >= 0; l_iIndex--)
- {
- MenuItems.Clear();
- m_oEntryDictionary.Clear();
- }
+ /// Updates menu entries depending on state.
+ private void UpdateMenuEntries()
+ {
+ for (int l_iIndex = MenuItems.Count - 1; l_iIndex >= 0; l_iIndex--)
+ {
+ MenuItems.Clear();
+ m_oEntryDictionary.Clear();
+ }
- CheckAddItem(typeof(MapPage));
+ CheckAddItem(typeof(MapPage));
- if (App.ModelRoot.ActiveUser.IsLoggedIn)
- {
- CheckAddItem(typeof(MyBikesPage));
- CheckAddItem(typeof(FindBikePage));
- CheckAddItem(typeof(AccountPage));
- }
- else
- {
- CheckAddItem(typeof(LoginPage));
- }
+ if (App.ModelRoot.ActiveUser.IsLoggedIn)
+ {
+ CheckAddItem(typeof(MyBikesPage));
+ CheckAddItem(typeof(FindBikePage));
+ CheckAddItem(typeof(AccountPage));
+ }
+ else
+ {
+ CheckAddItem(typeof(LoginPage));
+ }
- if (App.ModelRoot.Uris.ActiveUri.Host.GetIsCopri()
- || App.ModelRoot.ActiveUser.IsLoggedIn)
- {
- CheckAddItem(typeof(SettingsPage));
- }
+ if (App.ModelRoot.Uris.ActiveUri.Host.GetIsCopri()
+ || App.ModelRoot.ActiveUser.IsLoggedIn)
+ {
+ CheckAddItem(typeof(SettingsPage));
+ }
- CheckAddItem(typeof(FeesAndBikesPage)); // Fees and bikes
+ CheckAddItem(typeof(FeesAndBikesPage)); // Fees and bikes
- CheckAddItem(typeof(ContactPage)); // Feedback and contact
+ CheckAddItem(typeof(ContactPage)); // Feedback and contact
- CheckAddItem(typeof(InfoPage)); // About sharee.bike
- }
+ CheckAddItem(typeof(InfoPage)); // About sharee.bike
+ }
- /// Adds a menu item to master detail menu.
- /// Type decribing entry to be added.
- private void CheckAddItem(Type p_oType)
- {
- if (m_oEntryDictionary.ContainsKey(p_oType))
- {
- // Nothing to do because has already been added.
- return;
- }
+ /// Adds a menu item to master detail menu.
+ /// Type decribing entry to be added.
+ private void CheckAddItem(Type p_oType)
+ {
+ if (m_oEntryDictionary.ContainsKey(p_oType))
+ {
+ // Nothing to do because has already been added.
+ return;
+ }
- m_oEntryDictionary.Add(
- p_oType,
- m_oEntryDictionary.Count);
+ m_oEntryDictionary.Add(
+ p_oType,
+ m_oEntryDictionary.Count);
- MenuItems.Add(new RootPageFlyoutMenuItem
- {
- TargetType = p_oType,
- GlyphCode = Helper.GetGlyphCode(p_oType),
- Title = Helper.GetCaption(p_oType),
- Id = m_oEntryDictionary[p_oType]
- });
- }
+ MenuItems.Add(new RootPageFlyoutMenuItem
+ {
+ TargetType = p_oType,
+ GlyphCode = Helper.GetGlyphCode(p_oType),
+ Title = Helper.GetCaption(p_oType),
+ Id = m_oEntryDictionary[p_oType]
+ });
+ }
- /// Removes a page from menu.
- ///
- private void RemoveItem(Type p_oType)
- {
- if (!m_oEntryDictionary.ContainsKey(p_oType))
- {
- // Nothing to do because item was never added/ already removed.
- return;
- }
+ /// Removes a page from menu.
+ ///
+ private void RemoveItem(Type p_oType)
+ {
+ if (!m_oEntryDictionary.ContainsKey(p_oType))
+ {
+ // Nothing to do because item was never added/ already removed.
+ return;
+ }
- MenuItems.Remove(MenuItems[m_oEntryDictionary[p_oType]]);
- m_oEntryDictionary.Remove(p_oType);
- }
+ MenuItems.Remove(MenuItems[m_oEntryDictionary[p_oType]]);
+ m_oEntryDictionary.Remove(p_oType);
+ }
- public RootPageFlyoutViewModel()
- {
- MenuItems = new ObservableCollection();
- m_oEntryDictionary = new Dictionary();
+ public RootPageFlyoutViewModel()
+ {
+ MenuItems = new ObservableCollection();
+ m_oEntryDictionary = new Dictionary();
- // Update menu entries on login/ logout actions.
- App.ModelRoot.ActiveUser.StateChanged += (sender, eventargs) => OnUpdateRequired();
+ // Update menu entries on login/ logout actions.
+ App.ModelRoot.ActiveUser.StateChanged += (sender, eventargs) => OnUpdateRequired();
- // Update flyout view model whenever theme is switched.
- App.ModelRoot.Themes.PropertyChanged += (sender, eventargs) =>
- {
- if (!(sender is ServicesContainerMutableT