I have a toolbar button that works fine.
However when I add an Image it inconsistently doubles up ie 2 buttons
here is my code
the image is currently set in ONHistorical, but I have also tried on data loaded and get the same issue.
ps this code is from the help guide as well so I really am mystified.
Can anyone assist?
else if (State == State.Historical) { if(ChartControl != null) { ChartControl.Dispatcher.InvokeAsync((Action)(() => { myBitmapImage.BeginInit(); myBitmapImage.UriSource = new Uri(NinjaTrader.Core.Globals.InstallDir + "switch21.png"); myBitmapImage.Rotation = Rotation.Rotate270; myBitmapImage.EndInit(); // Assign the BitmapImage as the ImageSource of the ImageBrush backgroundImage.ImageSource = myBitmapImage; //myBitmapImage. })); } if (!IsToolBarButtonAdded) AddButtonToToolbar(); }
Comment