示例#1
0
        private void MessageBoxNotificationRequestProcess(BaseEventAggregatorMessage messageInput, MessageBoxNotification notification)
        {
            BaseEventAggregatorMessage messageOutput = messageInput.Clone() as BaseEventAggregatorMessage;

            messageOutput.MessageBoxOutput = notification.Output;
            messageOutput.SenderName       = messageInput.RecepientName;
            messageOutput.RecepientName    = messageInput.SenderName;

            AppStorage.Instance.EventAggregator.GetEvent <BaseEventAggregatorToken>().Publish(messageOutput);
        }
示例#2
0
        private void MessageBoxNotificationRequestRaise(BaseEventAggregatorMessage messageInput)
        {
            // Show LoginView in 'login' mode
            _messageBoxNotification = new MessageBoxNotification()
            {
                Title   = messageInput.Title ?? "WPFUserSearch",
                Message = messageInput.Caption,
                Input   = messageInput.MessageBoxInput,
            };

            this.MessageBoxNotificationRequest.Raise(_messageBoxNotification, Raised =>
            {
                MessageBoxNotificationRequestProcess(messageInput, _messageBoxNotification);
            });
        }
示例#3
0
        public void EventAggregatorMessageProcess(BaseEventAggregatorMessage messageInput)
        {
            // Process only relevant messages
            if (messageInput.RecepientName != this.GetType().Name)
            {
                return;
            }

            switch (messageInput.Command)
            {
            case CommandNameEnum.MessageBoxShow:

                MessageBoxNotificationRequestRaise(messageInput);
                break;
            }
        }
        private void SingleUserNotificationRequestRaise(BaseEventAggregatorMessage messageInput, SingleUserViewModeEnum mode)
        {
            _singleUserNotification = new SingleUserNotification()
            {
                Title = mode == SingleUserViewModeEnum.Create ?
                        "Create User" :
                        "Update User",
                Mode = mode,
                User = mode == SingleUserViewModeEnum.Create ?
                       new User()
                {
                    PK_User = Guid.NewGuid(),
                } :
                this.UserSelectedItem,
            };

            this.SingleUserNotificationRequest.Raise(_singleUserNotification, Raised =>
            {
                if (Raised.Confirmed)
                {
                    InitializeData();
                }
            });
        }