You need to set both properties:
SolidColorBrush myBrush =
linearAxis.ElementBrush = myBrush;
lineSeries.Stroke = byBrush;
Do try this and see that all will work correctly.
The reason that this code (linearAxis.ElementBrush = lineSeries.Stroke) does not work is that the Stroke property of the series is null by default. This is needed in order to support Stroke priorities - local series.Stroke has a higher priority than the Palette brushes, and Palette brushes have higher priority than the Stroke set from a style.
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>