Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Axis labels not updated correctly on inactive TabItem

Solved!
Go to solution

Hi all,

I have a problem regarding the labels of some graphs within a tab control:

I use the EngineeringValuePresenter from here and the hint on the <RangeLabeledDivisions/> from here to avoid the error relating to the frozen poperty. Thanks btw for the two topics, the EngineeringValuePresenter solves a lot of problems at once!

I have a set of graphs each set within one TabItem of a TabControl with each graph's DataSources set to an ObservableCollection<Point[]>.

When my displayed data change during runtime, the axis (numeric) labels of the graphs within the active TabItem are updated correctly, but the axis labels of the graphs within the inactive TabItem stay as they were before - only the display, because when I click on the max/min-values of the axis, the right values are there. I attached a screenshot of this behaviour for better understanding:

C.PNG

Only if I change e.g. the max-Value of the axis by adding another decimal place, the axis is updated correctly.

Did I miss to set any properties or is there another way to force each graph's axis to also update, when the according DataSource is changed?

Any hint would be appreciated, thank you.

0 Kudos
Message 1 of 4
(3,079 Views)
Solution
Accepted by topic author mrpip

It looks like your problem is due to the same underlying issue as the “incorrect x axis” question, where the scales do not get updated when the graph is in an inactive tab and unloaded. To workaround the issue, you can use this Loaded event handler to manually refresh the scales whenever a tab is activated:

private void OnGraphLoaded( object sender, RoutedEventArgs e ) {
    var graph = (LayeredGraph)sender;
    foreach( IScale scale in graph.AllScales )
        scale.OnInvalidated( new PropertyChangedEventArgs( "Tab Loaded" ) );
}
~ Paul H
Message 2 of 4
(3,063 Views)

Thanks Paul, this works as it should!

0 Kudos
Message 3 of 4
(3,049 Views)

Just wanted to let you know this issue was fixed in the Measurement Studio 2019 release.

~ Paul H
0 Kudos
Message 4 of 4
(2,429 Views)