【发布时间】:2020-04-23 08:44:15
【问题描述】:
我有一个使用 MVVMLight messenger 的 Xamarin.Android 应用程序。
应用程序也在使用后台服务。
应用程序和服务都注册到 StopApplicationAndServiceMessage 消息:
Messenger.Default.Register<StopApplicationAndServiceMessage>(...)
它们每个都将自定义方法传递给第二个参数。
应用程序菜单有一个选项可以退出发布 StopApplicationAndServiceMessage 消息的应用程序。
Messenger.Default.Send(new StopApplicationAndServiceMessage(reason));
在应用程序中处理消息时,有没有办法等待/确保消息已被后台服务处理?
任何帮助表示赞赏。
【问题讨论】:
标签: xamarin.android mvvm-light