public void ToggleSpinnerState(bool toggle_on) { if (MainToolbar.VisibleItems[1].Identifier == "Spinner") { (MainToolbar.VisibleItems[1].View as NSProgressIndicator).StopAnimation(this); MainToolbar.RemoveItem(1); } if (toggle_on) { MainToolbar.InsertItem("Spinner", 1); (MainToolbar.VisibleItems[1].View as NSProgressIndicator).StartAnimation(this); } }
void ToggleSpinnerState(bool toggle_on) { const int spinner_position = 2; if (MainToolbar.VisibleItems[spinner_position].Identifier == "Spinner") { (MainToolbar.VisibleItems[spinner_position].View as NSProgressIndicator).StopAnimation(this); MainToolbar.RemoveItem(spinner_position); } if (toggle_on) { MainToolbar.InsertItem("Spinner", spinner_position); (MainToolbar.VisibleItems[spinner_position].View as NSProgressIndicator).StartAnimation(this); } }