Пример #1
0
    public override bool FinishedLaunching(UIApplication app, NSDictionary options)
    {
        MessagingCenter.Subscribe <StartLongRunningTaskMessage> (this, "StartLongRunningTaskMessage", async message => {
            longRunningTaskExample = new iOSLongRunningTaskExample();
            await longRunningTaskExample.Start();
        });

        MessagingCenter.Subscribe <StopLongRunningTaskMessage> (this, "StopLongRunningTaskMessage", message => {
            longRunningTaskExample.Stop();
        });
    }
Пример #2
0
        void WireUpLongRunningTask()
        {
            MessagingCenter.Subscribe <StartLongRunningTaskMessage>(this, "StartLongRunningTaskMessage", async message => {
                longRunningTaskExample = new iOSLongRunningTaskExample();
                await longRunningTaskExample.Start(message);
            });

            MessagingCenter.Subscribe <StopLongRunningTaskMessage>(this, "StopLongRunningTaskMessage", message => {
                longRunningTaskExample.Stop();
            });
        }
Пример #3
0
        private void WireUpLongRunningTask()
        {
            MessagingCenter.Subscribe <StartLongRunningTaskMessage>(this, nameof(StartLongRunningTaskMessage), async message => {
                _longRunningTaskExample = new iOSLongRunningTaskExample();
                await _longRunningTaskExample.Start();
            });

            MessagingCenter.Subscribe <StopLongRunningTaskMessage>(this, nameof(StopLongRunningTaskMessage), message => {
                _longRunningTaskExample.Stop();
            });
        }