mirror of
https://github.com/bitwarden/mobile
synced 2025-12-14 23:33:34 +00:00
refactor message center use to services
This commit is contained in:
@@ -4,27 +4,28 @@ using Bit.App.Controls;
|
||||
using Bit.App.Resources;
|
||||
using Xamarin.Forms;
|
||||
using XLabs.Ioc;
|
||||
using Bit.App.Abstractions;
|
||||
|
||||
namespace Bit.App.Pages
|
||||
{
|
||||
public class BaseLockPage : ExtendedContentPage
|
||||
{
|
||||
private readonly IDeviceActionService _deviceActionService;
|
||||
|
||||
public BaseLockPage()
|
||||
: base(false, false)
|
||||
{
|
||||
|
||||
UserDialogs = Resolver.Resolve<IUserDialogs>();
|
||||
AuthService = Resolver.Resolve<IAuthService>();
|
||||
_deviceActionService = Resolver.Resolve<IDeviceActionService>();
|
||||
}
|
||||
|
||||
protected IUserDialogs UserDialogs { get; set; }
|
||||
protected IAuthService AuthService { get; set; }
|
||||
|
||||
protected override bool OnBackButtonPressed()
|
||||
{
|
||||
if(Device.RuntimePlatform == Device.Android)
|
||||
{
|
||||
MessagingCenter.Send(Application.Current, "BackgroundApp");
|
||||
}
|
||||
|
||||
_deviceActionService.Background();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -34,8 +35,7 @@ namespace Bit.App.Pages
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
MessagingCenter.Send(Application.Current, "Logout", (string)null);
|
||||
AuthService.LogOut();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user