private void SetVMConnectionModel(MainViewModel mainViewModel, bool connected)
 {
     if (mainViewModel.ConnectionActive != connected)
     {
         mainViewModel.ConnectionActive = connected;
     }
 }
        public MainWindow()
        {
            InitializeComponent();
            Execute.InitializeWithDispatcher();

            _vm = new MainViewModel( new SignalRHubSync(), new WpfContext() );
            this.DataContext = _vm;
            _vm.Load();
        }
 private void SetVMMessageModel(MainViewModel mainViewModel, MyMessage myMessage)
 {
     mainViewModel.MyMessages.Add(myMessage);
 }
 public void SendConnectionEvent(MainViewModel mainViewModel, bool connected)
 {
     Execute.OnUIThread(() => SetVMConnectionModel(mainViewModel, connected));
 }
 public void RecieveMessageEvent(MainViewModel mainViewModel, MyMessage myMessage)
 {
     Execute.OnUIThread(() => SetVMMessageModel(mainViewModel, myMessage));
 }