| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 | using InABox.Wpf;using System.Windows;namespace InABox.WPF{    /// <summary>    ///     Interaction logic for NumberEdit.xaml    /// </summary>    public partial class NumberEdit : ThemableWindow    {        public NumberEdit(string title, int min, int max, int value)        {            InitializeComponent();            Title = title;            Value = value;            Editor.Minimum = min;            Editor.Maximum = max;        }        public int Value        {            get => Editor.Value.HasValue ? Editor.Value.Value : 0;            set => Editor.Value = value;        }        private void OK_Click(object sender, RoutedEventArgs e)        {            DialogResult = true;            Close();        }        private void Cancel_Click(object sender, RoutedEventArgs e)        {            DialogResult = false;            Close();        }        public static bool Execute(string title, int min, int max, ref int value)        {            var edit = new NumberEdit(title, min, max, value);            if (edit.ShowDialog() == true)            {                value = edit.Value;                return true;            }            return false;        }    }}
 |