示例#1
0
        public UserInteraction(IAutomationService automationService, IMethodQueue methodQueue)
        {
            _methodQueue        = methodQueue;
            _popupDataViewModel = new PopupDataViewModel();

            automationService.RegisterActionType("ShowMessage", Resources.ShowMessage, new { Message = "" });
            automationService.RegisterActionType("DisplayPopup", Resources.DisplayPopup, new { Title = "", Message = "", Color = "" });

            EventServiceFactory.EventService.GetEvent <GenericEvent <ActionData> >().Subscribe(x =>
            {
                if (x.Value.Action.ActionType == "ShowMessage")
                {
                    var param = x.Value.GetAsString("Message");
                    if (!string.IsNullOrEmpty(param))
                    {
                        GiveFeedback(param);
                    }
                }

                if (x.Value.Action.ActionType == "DisplayPopup")
                {
                    var title   = x.Value.GetAsString("Title");
                    var message = x.Value.GetAsString("Message");
                    var color   = x.Value.GetAsString("Color");
                    color       = string.IsNullOrEmpty(color.Trim()) ? "DarkRed" : color;
                    if (!string.IsNullOrEmpty(message.Trim()))
                    {
                        DisplayPopup(title, message, null, "", color);
                    }
                }
            });
        }
示例#2
0
 public UserInteraction(IMethodQueue methodQueue)
 {
     _methodQueue        = methodQueue;
     _popupDataViewModel = new PopupDataViewModel();
 }
 public UserInteraction(IMethodQueue methodQueue, IApplicationState applicationState)
 {
     _methodQueue = methodQueue;
     _popupDataViewModel = new PopupDataViewModel(applicationState);
 }