public static int? ShowDialog(Window owner, string title, int current, int max) { ItemCountWindow form = new ItemCountWindow(title, current, max); form.Owner = owner; form.WindowStartupLocation = WindowStartupLocation.CenterOwner; var dialogResult = form.ShowDialog(); if (dialogResult != null && dialogResult.Value) { return form.result; } return null; }
public static int?ShowDialog(Window owner, string title, int current, int max) { ItemCountWindow form = new ItemCountWindow(title, current, max); form.Owner = owner; form.WindowStartupLocation = WindowStartupLocation.CenterOwner; var dialogResult = form.ShowDialog(); if (dialogResult != null && dialogResult.Value) { return(form.result); } return(null); }