I am trying to do this but failing if (panel != ChartPanel)
// {
// ChartControl.Dispatcher.InvokeAsync(() =>
// {
// panel.Visibility = EverythingShowing ? System.Windows.Visibility.Visible : System.Windows.Visibility.Collapsed;
// });
// }
doesn’t make any difference if i change to Visibility.Hidden. The behaviour is that the contents become invisible but the panel remains as empty. Any ideas anyone. Claude couldn’t work it out so i thought i would apply the might of human coders!!
Changing the visibility should stop the panel from rendering, which it sounds like it’s doing in your case. However, the space allocated to that panel by the containing grid will likely remain and leave an empty space as you describe. You might try getting the row definition for the panel’s row from the containing grid and setting it’s height to 0. You could also just remove the panel entirely, but I’m not sure how NT would react to that. I suspect it wouldn’t be pretty.
However, the recommended way to hide an individual indicator is to set the plot color to transparent and ForceRefresh(). Here’s a link to the old forum with some examples.
Thanks Mark. I have tried setting the space and height for instance to zero but it had no effect. I actually started this because I thought NT came up with a really neat idea ( ShowIndicators) BUT it should be on a HotKey or a button and also it should be panel based - ie all panels or just the chartPanel - which is what i am trying to do.
I have it how i want it - which is remove everything from the chart panel on a button event but before I posted it on the EcoSystem i just wanted to mimic the official ShowIndicator option.
There’s already a new indicator contribution that came out about five days ago that does this exact same thing. It is the newest in the repository, and if you go look at it, you can just download it and look at the code.
Yes. I have improved upon that and posted my own today called Toggle any Draw or Plot Object Invisible. No idea how long it takes NT to approve these things but it was an interesting exercise that took me down quite a few rabbit holes