private void button1_Click(object sender, RoutedEventArgs e)
        {
            Hider.Visibility = Visibility.Visible;
            YesNo yn = new YesNo("Удалить вопрос?", "Вы уверены в том, что хотите удалить этот вопрос? Отменить это будет невозможно");
            yn.ShowDialog();
            Hider.Visibility = Visibility.Hidden;
            if (!yn.result)
            {
                return;
            }

            Questions.Items.Remove(Questions.SelectedItem);
            if (Questions.Items.Count != 0)
            {
                Questions.SelectedItem = Questions.Items[0];
                int ind = 1;
                foreach (Question item in Questions.Items)
                {
                    string old = (string)item.Content;
                    item.Number = ind;
                    item.Content = ind + ". " + old.Substring(old.IndexOf(' ') + 1);
                    ind++;
                }
                NumberOfQuestions = ind - 1;
            }
            else
            {
                MiddleEditor.IsEnabled = false;
                NumberOfQuestions = 0;
            }
        }
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.window = ((QuestionEditor.YesNo)(target));
     
     #line 8 "..\..\..\Views\YesNo.xaml"
     this.window.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.Window_MouseDown);
     
     #line default
     #line hidden
     return;
     case 2:
     this.textBlock = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 3:
     this.button = ((System.Windows.Controls.Button)(target));
     
     #line 18 "..\..\..\Views\YesNo.xaml"
     this.button.Click += new System.Windows.RoutedEventHandler(this.button_Click);
     
     #line default
     #line hidden
     return;
     case 4:
     this.button1 = ((System.Windows.Controls.Button)(target));
     
     #line 19 "..\..\..\Views\YesNo.xaml"
     this.button1.Click += new System.Windows.RoutedEventHandler(this.button1_Click);
     
     #line default
     #line hidden
     return;
     }
     this._contentLoaded = true;
 }
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     Hider.Visibility = Visibility.Visible;
     YesNo yn = new YesNo("Выход из приложения", "Вы действительно хотите выйти? Результат может быть утерян");
     yn.ShowDialog();
     Hider.Visibility = Visibility.Hidden;
     if (!yn.result)
     {
         return;
     }
     this.Close();
 }