public ToastPromtsHostControl()
 {
     _activeItemsControl = new ItemsControl { Background = new SolidColorBrush(Colors.Transparent) };
     Children.Add(_activeItemsControl);
     
     _timer.Interval = TimeSpan.FromSeconds(1);
     _timer.Tick += Timer_OnTick;
     _timer.Start();
     _lastUsedInstance = this; //instance is defined in xaml
 }
        public ToastPromtsHostControl()
        {
            _activeItemsControl = new ItemsControl {
                Background = new SolidColorBrush(Colors.Transparent)
            };
            Children.Add(_activeItemsControl);

            _timer.Interval = TimeSpan.FromSeconds(1);
            _timer.Tick    += Timer_OnTick;
            _timer.Start();
            _lastUsedInstance = this; //instance is defined in xaml
        }
Esempio n. 3
0
        public Task <bool> Notify(ToastNotificationType type, string title, string description, TimeSpan duration, object context, bool clickable = true)
        {
            var taskCompletionSource = new TaskCompletionSource <bool>();

            Brush brush;
            var   element = _customRenderer.Render(type, title, description, context, out brush);

            ToastPromtsHostControl.EnqueueItem(element, b =>
            {
                if (clickable)
                {
                    taskCompletionSource.TrySetResult(b);
                }
            }, brush,
                                               tappable: _customRenderer.IsTappable,
                                               timeout: duration,
                                               showCloseButton: _customRenderer.HasCloseButton);
            return(taskCompletionSource.Task);
        }
Esempio n. 4
0
 public void HideAll()
 {
     ToastPromtsHostControl.Clear();
 }