Passes a string message (Notification) and a generic value (Content) to a recipient.
Наследование: GenericMessage
 private void CreateIndexMessageHandler(NotificationMessage<CreateIndexViewModel> message)
 {
     if (message.Notification == Constants.CreateIndexMessage || message.Notification == Constants.RecreateIndexMessage)
     {
         this.Close();
     }
 }
Пример #2
0
        private void NotifyMe(NotificationMessage obj)
        {
            var notification = obj.Notification;
            double result;
            var parseresult= double.TryParse(notification, out result);

            if (!parseresult) return;
            timerValue = Convert.ToDouble(notification);

            if (timerValue > 60)
            {
                MinuteValue = 01;
                SecondsValue = timerValue - 60;
            }
            else if (timerValue < 60)
            {
                MinuteValue = 00;
                SecondsValue = timerValue;
            }
            else
            {
                SecondsValue = 00;
                MinuteValue = 1;
            }
            RaisePropertyChanged(()=> MinuteValue);
            RaisePropertyChanged(()=>SecondsValue);
        }
 private void InitialAction(NotificationMessage<object> obj)
 {
     if (obj.Target.ToString()=="Load"&&obj.Notification=="OpenWindow")
     {
         LoadProjects();
     }
 }
Пример #4
0
		public AllMeasurements ()
		{
			InitializeComponent ();

			Master = _master = new FilterPage ();

			_scope = App.AutoFacContainer.BeginLifetimeScope ();

			var mainNav = new NavigationPage (_scope.Resolve<MeasurementPage>());
			mainNav.Title = "Measurements";

			var msg = new NotificationMessage<IDictionary<string, int>>(new Dictionary<string, int>(), _loadingMsgId);
			msg.Content.Add("Mode", 0);

			Messenger.Default.Send<NotificationMessage<IDictionary<string, int>>> (msg, _loadingMsgId);
			Detail = mainNav;

			this.Icon = "slideout.png";

			Messenger.Default.Register<NotificationMessage<FilterViewModel>>(this, _loadingMsgId, m => IsPresented = false);


			/*_master.PageSelectionChanged = (measurementTypeDefId) => {

				IDictionary<string, int> msgSelectionChanged = new Dictionary<string, int>();
				msgSelectionChanged.Add("DefinitionId", measurementTypeDefId);
				msgSelectionChanged.Add("Mode", 0);
				var page = App.NavigationService.MasterNavigateTo (MeasurementListPage.PageName, msgSelectionChanged);
				Detail = new NavigationPage(page);
				Detail.Title = page.Title;
				IsPresented = false;
			};*/
		}
Пример #5
0
        private void MessageReceived(NotificationMessage notificationMessage)
        {
            Dispatcher.BeginInvoke(new Action(() =>
            {
                if (notificationMessage.Notification == Messages.ShowWaitWindow)
                {
                    if (waitWindow != null)
                        waitWindow.Close();

                    waitWindow = new WaitWindow("Logging in, please wait...", true) {Owner = this};

                    waitWindow.ShowDialog();
                }
                else if (notificationMessage.Notification == Messages.NavigateToMainWindow)
                {
                    if (waitWindow != null)
                        waitWindow.Close();

                    Close();
                }
                else if (notificationMessage.Notification == Messages.DismissWaitWindow)
                {
                    if (waitWindow != null)
                    {
                        waitWindow.Close();
                        waitWindow = null;
                    }
                }
            }));
        }
 private void OnNotificationReceived(NotificationMessage obj)
 {
     UiBeginInvoke(()=>
         {
             NotificationText = obj.Notification;
         });
 }
 private void UpdateDocumentMessageHandler(NotificationMessage<ReplaceOneViewModel> message)
 {
     if (message.Notification == Constants.UpdateDocumentMessage)
     {
         this.Close();
     }
 }
 private void CreateCollectionMessageHandler(NotificationMessage<CreateCollectionViewModel> message)
 {
     if (message.Notification == Constants.CreateCollectionMessage)
     {
         this.Close();
     }
 }
 private void NotificationMessageReceived(NotificationMessage msg)
 {
     //if (msg.Notification == "AddDeviceSimView")
     //{
     //    ImageStart.Source = (ImageSource)FindResource("");
     //}
 }        
Пример #10
0
        private void MessageReceived(NotificationMessage notificationMessage)
        {
            Dispatcher.BeginInvoke(new Action(() =>
            {
                if (notificationMessage.Notification == Messages.NavigateToMainWindow)
                {
                    var settingsRepository = GalaSoft.MvvmLight.Ioc.SimpleIoc.Default.GetInstance<IGenericSettingsRepository<AppPreferences>>();
                    var settings = settingsRepository.GetSettings();

                    try
                    {
                        GalaSoft.MvvmLight.Ioc.SimpleIoc.Default.Register(() => new WcfCrmClient(settings.ConnectionProperties, settings.ClientCredential));
                    }
                    catch (Exception)
                    { }

                    var mainWindow = new MainWindow();

                    mainWindow.Title = string.Format("{0} - {1} ({2})", "Call Center CRM", settings.ClientCredential.UserName, settings.ClientCredential.PhoneNumber);
                    mainWindow.Show();

                    Application.Current.MainWindow = mainWindow;
                }
                else if (notificationMessage.Notification == Messages.ShowAboutWindow)
                {
                    var aboutWindow = new AboutWindow("Call Center CRM");
                    aboutWindow.ShowDialog();
                }
            }));
        }
Пример #11
0
 private void NotificationMessageReceived(NotificationMessage msg)
 {
     if (msg.Notification != ChatViewShow) return;
     var chatView = new ChatView();
     Hide();
     chatView.ShowDialog();
     Close();
 }
Пример #12
0
		private void NotificationMessageReceived(NotificationMessage notificationMessage)
		{
			if (notificationMessage.Notification == "OpenFileWindow")
			{
				var openFile = new OpenFile();
				openFile.ShowDialog();
			}
		}
Пример #13
0
 private void ProjectDatabaseTransitionMessageReceived(NotificationMessage msg)
 {
     if (msg.Notification == "ShowProjectDeviceDatabase")
     {
         var projectDeviceDatabaseView = new ProjectDeviceDatabaseView();
         projectDeviceDatabaseView.Show();
     }
 }
Пример #14
0
 private void AddCategoryTransitionMessageReceived(NotificationMessage msg)
 {
     if (msg.Notification == "ShowAddCategory")
     {
         var addCategoryView = new AddCategoryView();
         addCategoryView.Show();
     }
 }
Пример #15
0
 private void NotificationMessageReceived(NotificationMessage<ViewModelBase> currentView)
 {
     CurrentView = currentView.Content;
     if(currentView.Notification.Equals("TournamentViewModel"))
     {
         TournamentViewModel = (TournamentViewModel) currentView.Content;
     }
 }
Пример #16
0
        private void RefreshScreen(NotificationMessage obj)
        {
            if (obj.Notification != MessageNames.UpdateDebugScreens || Engine == null)
                return;

            if (Application.Current != null)
                Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(Refresh));
        }
Пример #17
0
 private void AddSignalTypeTransitionMessageReceived(NotificationMessage msg)
 {
     if (msg.Notification == "ShowAddSignalType")
     {
         var addSignalTypeView = new AddSignalTypeView();
         addSignalTypeView.Show();
     }
 }
Пример #18
0
 private void DeviceDatabaseTransitionMessageReceived(NotificationMessage msg)
 {
     if (msg.Notification == "ShowDeviceDatabase")
     {
         var deviceDatabaseView = new DeviceDatabaseView();
         deviceDatabaseView.Show();
     }
 }
Пример #19
0
		private void NotificationMessageReceived(NotificationMessage<StateFileModel> notificationMessage)
		{
			if (notificationMessage.Notification == "SaveFileWindow")
			{
				var saveFile = new SaveFile {DataContext = new SaveFileViewModel(notificationMessage.Content)};
				saveFile.ShowDialog();
			}
		}
 private void BsonParseExceptionMessageHandler(NotificationMessage<BsonExtensions.BsonParseException> message)
 {
     if (message.Notification == Constants.InsertParseException && message.Sender == this.DataContext && message.Content.PropertyName == Constants.InsertProperty)
     {
         insertEditor.CaretOffset = message.Content.Position;
         insertEditor.Focus();
     }
 }
Пример #21
0
 private void AddSupplierTransitionMessageReceived(NotificationMessage msg)
 {
     if (msg.Notification == "ShowAddSupplier")
     {
         var addSupplierViewView = new AddSupplierView();
         addSupplierViewView.Show();
     }
 }
Пример #22
0
 private void NotificationMessageReceived(NotificationMessage msg)
 {
     if (msg.Notification == "ShowDeviceManagementWindow")
     {
         var managentWindow = new DeviceManagentWindow {Owner = this};
         managentWindow.ShowDialog();
     }
 }
Пример #23
0
 private void LogDetailsMessageHandler(NotificationMessage<LoggingEvent> message)
 {
     if (message.Notification == Constants.ShowLogDetailsMessage)
     {
         LogDetailsView logDetails = new LogDetailsView();
         logDetails.DataContext = message.Content;
         logDetails.ShowDialog();
     }
 }
        private void InitialAction(NotificationMessage<object> obj)
        {
            if (obj.Target.ToString() == "EditCondition")
            {
                ConditionItem = obj.Content as CalculationConditionItem;

                Materials = new ObservableCollection<MaterialItem>(materialLibraryDS.GetAllMaterialItems());
                GroupNames = new ObservableCollection<string>(CreateGroups());
            }
        }
Пример #25
0
 private void NotificationMessageReceived(NotificationMessage msg)
 {
     switch (msg.Notification) {
         case "ShowStatistic":
             //(new StatisticsView()).Show();
             break;
         default:
             break;
     }
 }
Пример #26
0
        private void NotificationMessageReceived(NotificationMessage msg)
        {
            if (msg.Notification == "ShowAboutUs")
            {
                AboutUsWindow acercaDeWindow = new AboutUsWindow();
                acercaDeWindow.Owner = this.Owner;

                acercaDeWindow.ShowDialog();
            }
        }
Пример #27
0
 private void ItemExpandingMessageHandler(NotificationMessage message)
 {
     if (message.Notification == Constants.ItemExpandingMessage && message.Target == this.DataContext)
     {
         foreach (var col in grdView.Columns)
         {
             if (double.IsNaN(col.Width)) col.Width = col.ActualWidth;
             col.Width = double.NaN;
         }
     }
 }
 private void NotificationMessageReceived(NotificationMessage message)
 {
     switch (message.Notification)
     {
         case "ShowAboutWindow":
             ShowAboutWindow();
             break;
         default:
             return;
     }
 }
 private void NotificationMessageHandlerString(NotificationMessage<string> msg)
 {
     // Checks the actual content of the message.
     switch (msg.Notification)
     {
         case Messages.Messages.SETTINGSIP_PING:
             MessageBox.Show(msg.Content);
             break;
         default:
             break;
     }
 }
 private void NotificationMessageHandler(NotificationMessage m)
 {
     // Checks the actual content of the message.
     /*switch (m.Notification)
     {
         case "blablablabla":
             MessageBox.Show("blablablablabl");
             break;
         default:
             break;
     }*/
 }