private void DoHidePublishButton() { ThreadHelper.ThrowIfNotOnUIThread(); if (PublishButton.TryHide()) { this._retryCount = 0; return; } if (this._retryCount++ > MaximumRetries) { this._retryCount = 0; this.LogWarning("Was not able to find publish button"); return; } #if DEBUG this.LogInfo("Not able to find publish button - retrying later"); #endif DispatcherTimer timer = new DispatcherTimer(DispatcherPriority.Normal, Application.Current.Dispatcher) { Interval = TimeSpan.FromMilliseconds(1000), }; timer.Tick += this.TryHidePublishButton; timer.Start(); }
public void OnActivate() { this.btnToggleVisibility.Visible = PublishButton.IsAvailable(); }
private void btnToggleVisibility_OnClick(object sender, System.EventArgs e) { PublishButton.Toggle(); }