//implenting singelton pattern to this class public static BookForm Instance() { if (instance == null) { instance = new BookForm(); } instance.SetAsNewWindow(); return(instance); }
private void BackButton_Click(object sender = null, EventArgs e = null) { if (book == null) { Utils.SwitchBetweenWindows(this, BookForm.Instance()); } else { Utils.SwitchBetweenWindows(this, BookDetails.Instance(book)); } }
private void Books_Click(object sender, EventArgs e) { Utils.SwitchBetweenWindows(this, BookForm.Instance()); }