mirror of
https://github.com/bitwarden/android.git
synced 2024-11-01 23:54:06 +03:00
42 lines
1,017 B
C#
42 lines
1,017 B
C#
|
using System.Threading.Tasks;
|
|||
|
using Acr.UserDialogs;
|
|||
|
using Bit.App.Controls;
|
|||
|
using Bit.App.Resources;
|
|||
|
using Xamarin.Forms;
|
|||
|
using XLabs.Ioc;
|
|||
|
|
|||
|
namespace Bit.App.Pages
|
|||
|
{
|
|||
|
public class BaseLockPage : ExtendedContentPage
|
|||
|
{
|
|||
|
public BaseLockPage()
|
|||
|
: base(false, false)
|
|||
|
{
|
|||
|
|
|||
|
UserDialogs = Resolver.Resolve<IUserDialogs>();
|
|||
|
}
|
|||
|
|
|||
|
protected IUserDialogs UserDialogs { get; set; }
|
|||
|
|
|||
|
protected override bool OnBackButtonPressed()
|
|||
|
{
|
|||
|
if(Device.OS == TargetPlatform.Android)
|
|||
|
{
|
|||
|
MessagingCenter.Send(Application.Current, "BackgroundApp");
|
|||
|
}
|
|||
|
|
|||
|
return true;
|
|||
|
}
|
|||
|
|
|||
|
protected async Task LogoutAsync()
|
|||
|
{
|
|||
|
if(!await UserDialogs.ConfirmAsync(AppResources.LogoutConfirmation, null, AppResources.Yes, AppResources.Cancel))
|
|||
|
{
|
|||
|
return;
|
|||
|
}
|
|||
|
|
|||
|
MessagingCenter.Send(Application.Current, "Logout", (string)null);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|