Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel()
        {
            listCO = new List <ClientOutput>();
            listCO.Add(ClientOutput.GetSampleClientOutput());

            LineSeries LineSeries = new LineSeries();

            LineSeries.Title  = "Series 1";
            LineSeries.Values = GetValuesForLineSeries();

            SeriesCollection = new SeriesCollection();
            SeriesCollection.Add(LineSeries);



            Thread graphThread = new Thread(new ThreadStart(GraphValuesController));

            try
            {
                graphThread.SetApartmentState(ApartmentState.STA);
                graphThread.IsBackground = true;
                //graphThread = new Thread(new ThreadStart(GraphValuesController));
                graphThread.Start();
            }
            catch (Exception ex)
            {
                graphThread.Abort();
                throw ex;
            }


            LoadPluginOutputsCommand = new RelayCommand(LoadPluginOutputsMethod);

            //Labels = value => new DateTime((long)((TimeSpan.FromMinutes(5).Ticks - (TimeSpan.FromSeconds(5).Ticks * value))/*/(10000*1000*60)*/)).ToString("t");
        }
Ejemplo n.º 2
0
        public void LoadPluginOutputsMethod()
        {
            clientOutputs = new ObservableCollection <ClientOutput>();
            ClientOutput co = ClientOutput.GetSampleClientOutput();

            clientOutputs.Add(co);

            LineSeries LineSeries = new LineSeries();

            LineSeries.Title  = "Series 1";
            LineSeries.Values = GetValuesForLineSeries();

            SeriesCollection = new SeriesCollection();
            SeriesCollection.Add(LineSeries);

            /*LineSeries LineSeries = new LineSeries();
             * LineSeries.Title = "Series 1";
             * LineSeries.Values = GetValuesForLineSeries(); */
            //if (SeriesCollection != null && SeriesCollection.Count > 0)
            //{
            //    SeriesCollection[0] = new LineSeries()
            //    {
            //        Title = "Series 1",
            //        Values = GetValuesForLineSeries()
            //    };
            //}
            //else
            //{
            //    SeriesCollection = new SeriesCollection();
            //    SeriesCollection.Add(
            //    new LineSeries()
            //    {
            //        Title = "Series 1",
            //        Values = GetValuesForLineSeries()
            //    });
            //}

            //Messenger.Default.Send<NotificationMessage>(new NotificationMessage("Plugin Outputs loaded."));
        }