void droneController_OnNotifyTraceMessage(object sender, TraceNotificationEventArgs e)
 {
     if (!Dispatcher.CheckAccess())
     {
         Dispatcher.BeginInvoke(new Action <object, TraceNotificationEventArgs>(droneController_OnNotifyTraceMessage), sender, e);
     }
     else
     {
         //Traces.Add(e.NotificationMessage);
         //TraceBox.ScrollIntoView(TraceBox.Items[TraceBox.Items.Count-1]);
     }
 }
 void droneController_OnNotifyTraceMessage(object sender, TraceNotificationEventArgs e)
 {
     if (!Dispatcher.CheckAccess())
     {
         Dispatcher.BeginInvoke(new Action<object, TraceNotificationEventArgs>(droneController_OnNotifyTraceMessage), sender, e);
     }
     else
     {
         //Traces.Add(e.NotificationMessage);
         //TraceBox.ScrollIntoView(TraceBox.Items[TraceBox.Items.Count-1]);
     }
 }
        private void OnNotifiedTraceMessage(TraceNotificationEventArgs e)
        {
            if (OnNotifyTraceMessage != null && ConnectionStatus != ConnectionStatus.Closed)
            {
                if (e.NotificationLevel >= TraceNotificationLevel)
                {
                    //Verbose notification will be Throttled in order
                    //to avoid message flooding in the client
                    if (e.NotificationLevel == TraceNotificationLevel.Verbose)
                    {
                        traceThrottler++;

                        if (traceThrottler > 10)
                        {
                            OnNotifyTraceMessage(this, e);
                            traceThrottler = 0;
                        }
                    }
                    else
                    {
                        OnNotifyTraceMessage(this, e);
                    }
                }
            }
        }