Esempio n. 1
0
        private void BroadcastHubProxy_ReceiveNewMessage(object sender, BroadcastProxyEventArgs e)
        {
            // MessageBox.Show("In the chart render");;

            List <Point> dispayedPoints = new List <Point>();

            PushChart.UpdateData();

            //Draws stuff on the chart
            foreach (Tuple <int?, int?> tuple in e.data)
            {
                dispayedPoints.Add(new Point((double)(tuple.Item1 ?? 0), (double)(tuple.Item2 ?? 0)));
            }

            values = new ObservableCollection <Point>(dispayedPoints);

            PushChart.Diagram.Series[0].Points.Clear();

            foreach (Point p in values)
            {
                Bars.AddPoint(p.X, p.Y);
            }


            Bars.DataContext = this;

            Bars.Visible = true;

            //        MessageBox.Show("After the points");

            PushChart.Visibility = Visibility.Visible;

            values = null;
        }
Esempio n. 2
0
        /// <summary>
        /// Calls the event handler when a new message is received.
        /// </summary>
        /// <param name="e">The event args, containing new message count.</param>
        public async Task OnNewMessageReceived(BroadcastProxyEventArgs e)
        {
            var handler = this.ReceiveNewMessage;

            if (handler != null)
            {
                handler(this, e);
            }
        }