Beispiel #1
0
        public async Task DoWorkAsync()
        {
            await Task.Run(() =>
            {
                var random = new Random();

                _notificationEvent.Publish("Starting work...");

                for (var i = 0; i < 3; ++i)
                {
                    Thread.Sleep(random.Next(2000));
                    _notificationEvent.Publish($"Step #{i + 1} finished.");
                }

                _notificationEvent.Publish("Work finished!");
            });
        }
Beispiel #2
0
 void HelloWorldButtonOnClick(object sender, EventArgs e)
 {
     _notificationEvent.Publish("Hello World!");
 }