public void CloseNewSongDialog() { if (newSongDialogControl == null) { return; } newSongDialogControl.CloseDialog(); newSongDialogControl = null; }
public void OpenNewSongDialog() { if (newSongDialogControl != null) { return; } VisualElement visualElement = newSongDialogUi.CloneTree(); visualElement.AddToClassList("overlay"); uiDocument.rootVisualElement.Add(visualElement); newSongDialogControl = injector .WithRootVisualElement(visualElement) .CreateAndInject <NewSongDialogControl>(); newSongDialogControl.DialogClosedEventStream .Subscribe(_ => { newSongDialogControl = null; createSongButton.Focus(); }); }