//public Style Style { get { return (Style) GetValue(StyleProperty); } set { SetValue(StyleProperty, value); } }

        protected virtual void UpdateSeriesDefinitions(IEnumerable oldValue, IEnumerable newValue)
        {
            //m_SourceChanged.SetEventSource(newValue);
            SeriesDefinitions.Clear();

            if (newValue != null)
            {
                foreach (var item in newValue)
                {
                    SeriesDefinitions.Add((SeriesDefinition)item);
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// Initializes a new instance of the LineSeries class.
        /// </summary>
        public LineSeries()
        {
            SetBinding(DefinitionSeries.DependentAxisProperty, new Binding("DependentRangeAxis")
            {
                Source = this
            });
            SetBinding(DefinitionSeries.SelectionModeProperty, new Binding("IsSelectionEnabled")
            {
                Source = this, Converter = new WinRTXamlToolkit.Controls.DataVisualization.Charting.Compatible.SelectionEnabledToSelectionModeConverter()
            });
            _definition = new SeriesDefinition();
            _definition.SetBinding(SeriesDefinition.ItemsSourceProperty, new Binding("ItemsSource")
            {
                Source = this
            });
            _definition.SetBinding(SeriesDefinition.TitleProperty, new Binding("Title")
            {
                Source = this
            });
            _definition.SetBinding(SeriesDefinition.DataPointStyleProperty, new Binding(DataPointStyleName)
            {
                Source = this
            });
            _definition.SetBinding(SeriesDefinition.LegendItemStyleProperty, new Binding(LegendItemStyleName)
            {
                Source = this
            });
            _definition.SetBinding(SeriesDefinition.DataShapeStyleProperty, new Binding(PolylineStyleName)
            {
                Source = this
            });
            _definition.SetBinding(SeriesDefinition.TransitionDurationProperty, new Binding("TransitionDuration")
            {
                Source = this
            });
#if !NO_EASING_FUNCTIONS
            _definition.SetBinding(SeriesDefinition.TransitionEasingFunctionProperty, new Binding("TransitionEasingFunction")
            {
                Source = this
            });
#endif
            // For compatibility
            DependentValueBinding   = new Binding();
            IndependentValueBinding = new Binding();
            SeriesDefinitions.Add(_definition);
        }
        /// <summary>
        /// Initializes a new instance of the AreaSeries class.
        /// </summary>
        public AreaSeries()
        {
            SetBinding(DefinitionSeries.DependentAxisProperty, new Binding {
                Path = new PropertyPath("DependentRangeAxis"), Source = this
            });
            SetBinding(DefinitionSeries.SelectionModeProperty, new Binding {
                Path = new PropertyPath("IsSelectionEnabled"), Source = this, Converter = new SelectionEnabledToSelectionModeConverter()
            });
            _definition = new SeriesDefinition();
            _definition.SetBinding(SeriesDefinition.ItemsSourceProperty, new Binding("ItemsSource")
            {
                Source = this
            });
            _definition.SetBinding(SeriesDefinition.TitleProperty, new Binding("Title")
            {
                Source = this
            });
            _definition.SetBinding(SeriesDefinition.DataPointStyleProperty, new Binding(DataPointStyleName)
            {
                Source = this
            });
            _definition.SetBinding(SeriesDefinition.LegendItemStyleProperty, new Binding(LegendItemStyleName)
            {
                Source = this
            });
            _definition.SetBinding(SeriesDefinition.DataShapeStyleProperty, new Binding(PathStyleName)
            {
                Source = this
            });
            _definition.SetBinding(SeriesDefinition.TransitionDurationProperty, new Binding("TransitionDuration")
            {
                Source = this
            });
#if !NO_EASING_FUNCTIONS
            _definition.SetBinding(SeriesDefinition.TransitionEasingFunctionProperty, new Binding("TransitionEasingFunction")
            {
                Source = this
            });
#endif
            // For compatibility
            DependentValueBinding   = new Binding();
            IndependentValueBinding = new Binding();
            SeriesDefinitions.Add(_definition);
        }