mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-06-22 13:57:28 +02:00
Version 3.0.381
This commit is contained in:
parent
f963c0a219
commit
3a363acf3a
1525 changed files with 60589 additions and 125098 deletions
80
LastenradBayern/ShareeBike/View/Account/AccountPage.xaml
Normal file
80
LastenradBayern/ShareeBike/View/Account/AccountPage.xaml
Normal file
|
@ -0,0 +1,80 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:resources="clr-namespace:ShareeBike.MultilingualResources;assembly=SharedBusinessLogic"
|
||||
xmlns:sharedGui="clr-namespace:SharedGui.View"
|
||||
xmlns:conv="clr-namespace:ShareeBike.View;assembly=SharedBusinessLogic"
|
||||
mc:Ignorable="d"
|
||||
x:Class="ShareeBike.View.Account.AccountPage"
|
||||
BackgroundColor="{DynamicResource background-color}">
|
||||
|
||||
<Shell.TitleView>
|
||||
<Grid ColumnDefinitions="Auto, 1*">
|
||||
<Label Style="{StaticResource Label-Navbar}"
|
||||
Text="{x:Static resources:AppResources.MarkingAccount}"/>
|
||||
</Grid>
|
||||
</Shell.TitleView>
|
||||
|
||||
<ContentPage.Resources>
|
||||
<conv:BoolInverterConverter x:Key="BoolInverterConverter"/>
|
||||
</ContentPage.Resources>
|
||||
|
||||
<ContentPage.Content>
|
||||
|
||||
<!--Grid for content and Running process in same row-->
|
||||
<Grid>
|
||||
|
||||
<ScrollView
|
||||
Grid.Row="0">
|
||||
|
||||
<StackLayout>
|
||||
|
||||
<Frame
|
||||
Padding="10"
|
||||
Margin="0,10,0,5"
|
||||
HorizontalOptions="FillAndExpand"
|
||||
BackgroundColor="White">
|
||||
|
||||
<StackLayout
|
||||
Padding="10">
|
||||
|
||||
<Label
|
||||
Text="{Binding LoggedInInfo}" />
|
||||
|
||||
<Label
|
||||
IsVisible="{Binding IsBookingStateInfoVisible}"
|
||||
Text="{Binding BookingStateInfo}" />
|
||||
|
||||
<Button
|
||||
Text="{x:Static resources:AppResources.MarkingAccountPageManagePersonalData}"
|
||||
Command="{Binding OnManageAccount}"
|
||||
IsEnabled="{Binding IsLogoutPossible}">
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
Style="{StaticResource SecondaryButton}"
|
||||
Text="{x:Static resources:AppResources.MarkingAccountPageManageLogout}"
|
||||
Command="{Binding OnLogoutRequest}"
|
||||
IsEnabled="{Binding IsLogoutPossible}">
|
||||
</Button>
|
||||
|
||||
</StackLayout>
|
||||
|
||||
</Frame>
|
||||
|
||||
</StackLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
<!--While process is running-->
|
||||
<sharedGui:RunningProcessView
|
||||
IsVisible="{Binding IsIdle, Converter={StaticResource BoolInverterConverter}}"
|
||||
Grid.Row="0"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
</ContentPage.Content>
|
||||
|
||||
</ContentPage>
|
126
LastenradBayern/ShareeBike/View/Account/AccountPage.xaml.cs
Normal file
126
LastenradBayern/ShareeBike/View/Account/AccountPage.xaml.cs
Normal file
|
@ -0,0 +1,126 @@
|
|||
using ShareeBike.ViewModel;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Xaml;
|
||||
using System.Threading.Tasks;
|
||||
using System;
|
||||
using ShareeBike.Model.Device;
|
||||
using ShareeBike.ViewModel.Account;
|
||||
using ShareeBike.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
|
||||
|
||||
namespace ShareeBike.View.Account
|
||||
{
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class AccountPage : ContentPage, IViewService
|
||||
{
|
||||
/// <summary> Refernce to view model. </summary>
|
||||
AccountPageViewModel m_oViewModel = null;
|
||||
|
||||
/// <summary> Constructs a account page. </summary>
|
||||
public AccountPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
var l_oModel = App.ModelRoot;
|
||||
|
||||
m_oViewModel = new AccountPageViewModel(
|
||||
l_oModel,
|
||||
(url) => DependencyService.Get<IExternalBrowserService>().OpenUrl(url),
|
||||
this);
|
||||
|
||||
BindingContext = m_oViewModel;
|
||||
}
|
||||
|
||||
/// <summary> Displays alert message. </summary>
|
||||
/// <param name="title">Title of message.</param>
|
||||
/// <param name="message">Message to display.</param>
|
||||
/// <param name="cancel">Type of buttons.</param>
|
||||
public new async Task DisplayAlert(string title, string message, string cancel)
|
||||
=> await App.Current.MainPage.DisplayAlert(title, message, cancel);
|
||||
|
||||
/// <summary> Displays alert message.</summary>
|
||||
/// <param name="title">Title of message.</param>
|
||||
/// <param name="message">Message to display.</param>
|
||||
/// <param name="details">Detailed error description.</param>
|
||||
/// <param name="cancel">Type of buttons.</param>
|
||||
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);
|
||||
|
||||
/// <summary> Displays alert message.</summary>
|
||||
/// <param name="title">Title of message.</param>
|
||||
/// <param name="message">Message to display.</param>
|
||||
/// <param name="accept">Text of accept button.</param>
|
||||
/// <param name="cancel">Text of button.</param>
|
||||
/// <returns>True if user pressed accept.</returns>
|
||||
public new async Task<bool> DisplayAlert(string title, string message, string accept, string cancel)
|
||||
=> await App.Current.MainPage.DisplayAlert(title, message, accept, cancel);
|
||||
|
||||
/// <summary> Displays detailed alert message.</summary>
|
||||
/// <param name="title">Title of message.</param>
|
||||
/// <param name="message">Message to display.</param>
|
||||
/// <param name="details">Detailed error description.</param>
|
||||
/// <param name="accept">Text of accept button.</param>
|
||||
/// <param name="cancel">Text of cancel button.</param>
|
||||
/// <returns>True if user pressed accept.</returns>
|
||||
public async Task<bool> 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);
|
||||
|
||||
/// <summary>
|
||||
/// Displays an action sheet.
|
||||
/// </summary>
|
||||
/// <param name="title">Title of message.</param>
|
||||
/// <param name="message">Message to display.</param>
|
||||
/// <param name="cancel">Text of button.</param>
|
||||
/// <param name="destruction"></param>
|
||||
/// <param name="p_oButtons">Buttons holding options to select.</param>
|
||||
/// <returns>Text selected</returns>
|
||||
public new async Task<string> DisplayActionSheet(String title, String cancel, String destruction, params String[] p_oButtons)
|
||||
=> await base.DisplayActionSheet(title, cancel, destruction, p_oButtons);
|
||||
|
||||
/// <summary> Shows a page.</summary>
|
||||
/// <param name="route">Route of the page to show.</param>
|
||||
public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route);
|
||||
|
||||
/// <summary> Pushes a page onto the modal stack. </summary>
|
||||
/// <param name="p_oTypeOfPage">Page to display.</param>
|
||||
public Task PushModalAsync(ViewTypes typeOfPage)
|
||||
=> Navigation.PushModalAsync((Page)Activator.CreateInstance(typeOfPage.GetViewType()));
|
||||
|
||||
/// <summary> Pops a page from the modal stack. </summary>
|
||||
public Task PopModalAsync()
|
||||
=> throw new NotSupportedException();
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when page is shown.
|
||||
/// Starts update process.
|
||||
/// </summary>
|
||||
protected async override void OnAppearing()
|
||||
=> await m_oViewModel.OnAppearing();
|
||||
/// <summary>
|
||||
/// Invoked when pages is closed/ hidden.
|
||||
/// Stops update process.
|
||||
/// </summary>
|
||||
protected async override void OnDisappearing()
|
||||
{
|
||||
if (m_oViewModel == null)
|
||||
{
|
||||
// View model might be null.
|
||||
return;
|
||||
}
|
||||
await m_oViewModel.OnDisappearing();
|
||||
}
|
||||
|
||||
/// <summary> Pushes a page onto the stack. </summary>
|
||||
/// <param name="p_oTypeOfPage">Page to display.</param>
|
||||
public async Task PushAsync(ViewTypes p_oTypeOfPage)
|
||||
=> await Navigation.PushAsync((Page)Activator.CreateInstance(p_oTypeOfPage.GetViewType()));
|
||||
#if USCSHARP9
|
||||
public Task<IViewService.IUserFeedback> DisplayUserFeedbackPopup() => throw new NotSupportedException();
|
||||
#else
|
||||
public async Task<IUserFeedback> DisplayUserFeedbackPopup(IBatteryMutable battery = null) => throw new NotSupportedException();
|
||||
#endif
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue