1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-16 00:03:22 +00:00

use new messaging and broadcaster services

This commit is contained in:
Kyle Spearrin
2019-04-18 13:15:46 -04:00
parent da73a2f5d2
commit 2becf769c1
5 changed files with 43 additions and 30 deletions

View File

@@ -16,9 +16,13 @@ namespace Bit.App
public partial class App : Application
{
private readonly MobileI18nService _i18nService;
private readonly IBroadcasterService _broadcasterService;
private readonly IMessagingService _messagingService;
public App()
{
_broadcasterService = ServiceContainer.Resolve<IBroadcasterService>("broadcasterService");
_messagingService = ServiceContainer.Resolve<IMessagingService>("messagingService");
_i18nService = ServiceContainer.Resolve<II18nService>("i18nService") as MobileI18nService;
InitializeComponent();
@@ -27,7 +31,7 @@ namespace Bit.App
MainPage = new TabsPage();
ServiceContainer.Resolve<MobilePlatformUtilsService>("platformUtilsService").Init();
MessagingCenter.Subscribe<Application, DialogDetails>(Current, "ShowDialog", async (sender, details) =>
_broadcasterService.Subscribe<DialogDetails>("showDialog", async (details) =>
{
var confirmed = true;
var confirmText = string.IsNullOrWhiteSpace(details.ConfirmText) ?
@@ -41,7 +45,7 @@ namespace Bit.App
{
await MainPage.DisplayAlert(details.Title, details.Text, details.ConfirmText);
}
MessagingCenter.Send(Current, "ShowDialogResolve", new Tuple<int, bool>(details.DialogId, confirmed));
_messagingService.Send("showDialogResolve", new Tuple<int, bool>(details.DialogId, confirmed));
});
}