private void AddOrderBtn_Click(object sender, RoutedEventArgs e)
 {
     if (ContractorList.SelectedItem != null)
     {
         Contractor item = (Contractor) ContractorList.SelectedItem;
         AddOrder order = new AddOrder(item);
         order.Show();
         order.Closed += FillContractorOrders;
     }
     else
     {
         this.ShowMessageAsync("Ошибка", "Выбирите поставщика");
     }
 }
 private void OrdersListBox_PreviewMouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     if (OrdersListBox.SelectedItem == null) return;
     AddOrder order = new AddOrder((Contractor)ContractorList.SelectedItem, (Order)OrdersListBox.SelectedItem);
     order.Show();
     order.Closed += FillContractorOrders;
 }