public MqttDataService(IXpdSettings xpdSetting, IEventAggregator eventAggregator, IPageDialogService pageDialogService)
 {
     _xpdSetting        = xpdSetting;
     _eventAggregator   = eventAggregator;
     _pageDialogService = pageDialogService;
     Debug.WriteLine($"\n\n in MqttDataService constructor \n\n");
 }
        public SettingsPageViewModel(IXpdSettings xpdSettings, IMqttDataService mqttDataService)
        {
            Title            = "new settings page";
            _xPdSetting      = xpdSettings;
            _mqttDataService = mqttDataService;

            LoadCa  = new DelegateCommand(() => _xPdSetting.LoadCa());
            LoadPfx = new DelegateCommand(() => _xPdSetting.LoadPfx());
        }
        public MqttViewViewModel(IEventAggregator eventAggregator, IMqttDataService MqttDataService, IXpdSettings xpdSettings)
        {
            _xpdsettings     = xpdSettings;
            _eventAggregator = eventAggregator;
            _mqttDataService = MqttDataService;
            Task.Run(async() =>
            {
                await _mqttDataService.Initialize();
            });
            _eventAggregator.GetEvent <MqttMessageTransport>().Subscribe(MqttMessageTransportMessageReceived, ThreadOption.UIThread);
            HotKeyCommandButton   = new Command <string>(DoHotKeyCommandButton);
            PublishMessageCommand = new DelegateCommand(ExecutePublishMessageCommand, CanPublish);

            MosquittoPubSub = $"mosquitto_pub -h {_xpdsettings.MqttBrokerAddress} -t {_xpdsettings.MqttBrokerTopic} -m 'Your message goes here.'";
        }
Esempio n. 4
0
 public SettingsViewViewModel(IXpdSettings xpdSettings)
 {
     _xPdSetting = xpdSettings;
     // Title = "Mqtt Settings";
 }