Example #1
0
        public void DisplayAddsNotification()
        {
            var textBlock = new TextBlock();

            _toastNotificationService.Display(new object(), textBlock);
            Assert.True(_toastControl.ToastNotificationCollection.Contains(textBlock));
        }
        private void OnStateChanged(object sender, EventArgs e)
        {
            switch (_keyBindingService.ConflictingKeyBindingState)
            {
            case ConflictingKeyBindingState.HasNotChecked:
            case ConflictingKeyBindingState.ConflictsIgnoredOrResolved:
                if (_hasDisplayed)
                {
                    _toastNotificationService.Remove(_toastKey);
                }
                break;

            case ConflictingKeyBindingState.FoundConflicts:
                _toastNotificationService.Display(_toastKey, _control, OnNotificationClosed);
                _hasDisplayed = true;
                break;

            default:
                throw new Exception("Enum value unknown");
            }
        }