Reputation: 3639
We have a common DateTimeAxis that we refer to in all our content pages with an SfChart.
<xForms:DateTimeAxis
x:Key="CommonDateTimeAxis"
AxisLineStyle="{StaticResource ChartAxisLineStyle}"
EdgeLabelsDrawingMode="Shift"
Interval="{Binding DateTimeAxisIntervalGrouping}"
IntervalType="{Binding DateTimeAxisInterval, Converter={StaticResource DataTimeAxisTypeConverter}}"
MajorTickStyle="{StaticResource ChartMajorTickStyle}"
Maximum="{Binding CurrentDataWindow.End}"
Minimum="{Binding CurrentDataWindow.Start}"
PlotOffset="12"
ShowMajorGridLines="False">
<xForms:DateTimeAxis.LabelStyle>
<xForms:ChartAxisLabelStyle
FontFamily="{StaticResource LightFontFamily}"
FontSize="10"
LabelFormat="{Binding DateTimeAxisDateFormat}"
TextColor="{StaticResource OffWhite}" />
</xForms:DateTimeAxis.LabelStyle>
</xForms:DateTimeAxis>
Note that we are binding to a ViewModel property as we change the format dynamically.
LabelFormat="{Binding DateTimeAxisDateFormat}"
On initial load of a page and viewmodel the setting of the format works fine. However if once we close the View\ViewModel then go back into any other of our View\ViewModels with sfChart (or the same one) the LabelFormat remains stuck on whatever value it was prior to closing the first View/ViewModel.
I thought I was doing something foolish with retaining instances but I then realised that if i simply declare the DateTimeAxis locally i.e. not a shared resource in a ResourceDictionary, the binding always works.
That's not expected right? FWIW I have opened an incident with Syncfusion seperately and will report anything useful back here
Upvotes: 1
Views: 147
Reputation: 124
The reported issue has been fixed and moved to Syncfusion SfChart NuGet Version: 18.2.0.47
Upvotes: 1