private static LineSeries CreateLineSeries(CalculationViewModel newViewModel)
        {
            var newSeries = new LineSeries
                                {
                                    DataContext = newViewModel,
                                    DependentValuePath = "Value",
                                    IndependentValuePath = "Date"
                                };
            BindingOperations.SetBinding(newSeries, Series.TitleProperty, new Binding("Title"));

            var filter = new CollectionSizeFilter();
            BindingOperations.SetBinding(filter,
                                         CollectionSizeFilter.MaxItemCountProperty,
                                         new Binding("ActualWidth")
                                             {
                                                 RelativeSource = new RelativeSource(RelativeSourceMode.FindAncestor, typeof(Chart), 1),
                                                 Converter = new DivisionConverter(),
                                                 ConverterParameter = 25
                                             }
                                       );
            BindingOperations.SetBinding(filter,
                                         CollectionViewSource.SourceProperty,
                                         new Binding("ResultOverTime"));
            newSeries.Resources.Add("FilteredBalances", filter);

            BindingOperations.SetBinding(newSeries,
                                         DataPointSeries.ItemsSourceProperty,
                                         new Binding { Source = filter });
            return newSeries;
        }
 private void ShowChart(string region, CalculationViewModel calculationViewModel)
 {
     _regionManager.AddToRegion(region, calculationViewModel);
 }