Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Hide & Show axes with BaselineStrokeThickness=0

Hey,

In my project I want to hide / show the Y axis, It works usually.

But when BaselineStrokeThickness is 0 and TickVisibility of the MinorDivisons is collapsed, I am able to hide the Y axis but can not re-present it.

I attach a project, for example.

0 Kudos
Message 1 of 3
(3,064 Views)

I was able to reproduce the problem, and have file a task to correct this in the next release.

 

As a workaround, you can trigger a manual referesh of the scale.  For example, adding the following changes to your example corrected the problem:

 

    public partial class MainWindow : Window {
        public MainWindow( ) {
            InitializeComponent( );
            ShowYAxis.Checked += OnShowYAxisChecked;
        }

        private void OnShowYAxisChecked( object sender, RoutedEventArgs e ) {
            Dispatcher.BeginInvoke( new Action( delegate {
                NationalInstruments.Controls.Primitives.IScale scale = YAxis;
                scale.OnInvalidated( EventArgs.Empty );
            } ) );
        }
    }

 

(I used a BeginInvoke call, because the binding updates after the Checked event occurs. Depending on how you are setting visibility in your application, there may be a more appropriate place to put the workaround logic.)

~ Paul H
0 Kudos
Message 2 of 3
(3,037 Views)

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

~ Paul H
0 Kudos
Message 3 of 3
(1,722 Views)