public DERDashboardUserControl()
        {
            InitializeComponent();

            _selectedTreeButton = new Button();
            var yAxis = new Axis {
                Separator = new LiveCharts.Wpf.Separator {
                    StrokeThickness = 0.12
                }
            };
            var sAxis = new Axis {
                Separator = new LiveCharts.Wpf.Separator {
                    StrokeThickness = 0.1, Step = 1
                }
            };

            cartesianChart.AxisY.Add(yAxis);
            cartesianChart.AxisX.Add(sAxis);

            //var mapper = new LiveCharts.Configurations.CartesianMapper<double>().X((values,index)=>index).Y((values)=>values).Fill((v,i)=>i==DateTime.Now.Hour?Brushes.Green : Brushes.White).Stroke((v, i) => i == DateTime.Now.Hour ? Brushes.Green : Brushes.White);

            //LiveCharts.Charting.For<double>(mapper, LiveCharts.SeriesOrientation.Horizontal);
            // cartesianChart.AxisX.Add({ Label = });

            DataContext = new DERDashboardUserControlViewModel(this);
        }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            DERDashboardUserControlViewModel d = new DERDashboardUserControlViewModel(this);
            var energySourceValue = d.Optimization();

            EnergySource.Value = (int)energySourceValue;
            //CurrentConsumption.Text = (EnergySource.Value - ProductionFromGenerators.Value).ToString() + "kw/h";
        }