예제 #1
0
        public void DisplayFlashMessage(string message, Type type, TimeSpan?lifespan = null)
        {
            var d = new FlashMessageDecorator(new FlashMessage(message, type, lifespan));

            d.OnDisposal += (o, e) => { FlashMessages.Remove(e); };
            FlashMessages.Add(d);

            if (!_dispatcherTimer.IsEnabled)
            {
                _dispatcherTimer.Start();
            }
        }
 private void Remove(FlashMessageDecorator p)
 {
     OnDisposal?.Invoke(this, this);
 }