1
0
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:
Kyle Spearrin
2017-11-21 23:08:45 -05:00
parent b48e8eeb0e
commit 3b44ede67e
24 changed files with 439 additions and 379 deletions

View File

@@ -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();
}
}
}