public AdditionalNukeCondtions()
        {
            InitializeComponent();
            Instance = this;

            this.Closed    += delegate { Instance = null; };
            this.MouseDown += delegate {
                try
                {
                    BindingExpression exp = ((TextBox)Keyboard.FocusedElement).GetBindingExpression(TextBox.TextProperty);
                    exp?.UpdateSource();
                    if (exp?.HasValidationError != null && (bool)exp?.HasValidationError)
                    {
                        ((TextBox)Keyboard.FocusedElement).Text = "0";
                    }

                    exp?.UpdateSource();
                    Keyboard.ClearFocus();
                }
                catch (Exception)
                {
                    // ignored
                }
            };
        }
        private void OpenAdditionalNukeConditions_ButtonClick(object sender, RoutedEventArgs e)
        {
            if (AdditionalNukeCondtions.Instance != null ||
                ((ViewModel)this.DataContext)?.SelectedBot?.Engine?.NukeHandler?.SelectedNuke == null)  //
            {
                return;
            }

            var unitsForm = new AdditionalNukeCondtions();

            unitsForm.DataContext = this.DataContext;
            Dispatcher.BeginInvoke((Action)(() => unitsForm.ShowDialog()));
        }