void Window_Closed(object sender, EventArgs e)
        {
            if (sender is AgendaWindow)
            {
                _agendaWindow = null;
            }
            else if (sender is ManageUsersWindow)
            {
                _manageUsersWindow = null;
            }
            else if (sender is ManageRemindersWindow)
            {
                _manageRemindersWindow = null;
                RefreshRemindersStackPanel();
            }
            else if (sender is ManageMedicinesWindow)
            {
                _manageMedicinesWindow = null;
                RefreshMedicinesStackPanel();
            }
            else if (sender is ManageTreatmentsWindow)
            {
                _manageTreatmentsWindow = null;
            }
            else if (sender is ManageReceivedInvoicesWindow)
            {
                _manageReceivedInvoicesWindow = null;
            }
            else if (sender is ManageOutgoingInvoicesWindow)
            {
                _manageOutgoingInvoicesWindow = null;
            }
            else if (sender is TotalInvoicesWindow)
            {
                _totalInvoicesWindow = null;
            }
            else if (sender is ManageProvidersWindow)
            {
                _manageProvidersWindow = null;
            }
            else if (sender is ManageTechnicalsWindow)
            {
                _manageTechnicalsWindow = null;
            }
            else if (sender is ManageLaboratoryWorksWindow)
            {
                _manageLaboratoryWorksWindow = null;
            }
            else if (sender is MedicalProofDocument)
            {
                _medicalProofDocumentWindow = null;
            }
            else if (sender is ManageGeneralPaidsWindow)
            {
                _manageGeneralPaidsWindow = null;
            }
            else if (sender is ManageContactsWindow)
            {
                _manageContactsWindow = null;
            }
            else if (sender is ManageCleanedMaterialsWindow)
            {
                _manageCleanedMaterialsWindow = null;
            }
            else if (sender is SendEmailWindow)
            {
                _sendEmailWindow = null;
            }
            else if (sender is ConfigureEmailWindow)
            {
                _configureEmailWindow = null;
            }
            else if (sender is ManagePatientsWindow)
            {
                _managePatientsWindow = null;
            }
            else if (sender is ManageDotationsWindow)
            {
                _manageDotationsWindow = null;
                RefreshDotationsStackPanel();
            }
            else if (sender is ManageTreatmentPricesWindow)
            {
                _manageTreatmentPricesWindow = null;
            }
            else if (sender is ManageBudgetsWindow)
            {
                _manageBudgetsWindow = null;
            }
            else if (sender is ManageAmericanExpressPaidsWindow)
            {
                _manageAmericanExpressPaidsWindow = null;
            }
            else if (sender is ManageAuthorizationsWindow)
            {
                _manageAuthorizationsWindow = null;
            }
            else if (sender is ManageDentegraAuthorizationsWindow)
            {
                _manageElegibilitiesWindow = null;
            }
            else if (sender is ManageDrawersWindow)
            {
                _manageDrawersWindow = null;
            }
            else if (sender is CashRegisterWindow)
            {
                _cashRegisterWindow = null;
            }
            else if (sender is ManageBanksWindow)
            {
                _manageBanksWindow = null;
            }
            else if (sender is ViewPaymentsWindow)
            {
                _viewPaymentsWindow = null;
            }
            else if (sender is ViewPaymentFoliosWindow)
            {
                _viewPaymentFoliosWindow = null;
            }
            else if (sender is ViewEventsWindow)
            {
                _viewEventsWindow = null;
            }
            else if (sender is ViewPendingPaymentsWindow)
            {
                _viewPendingPaymentsWindow = null;
            }
            else if (sender is FinishedEventsReminderModal)
            {
                _finishedEventsReminderModal = null;

                List<DateTime> datesUpdated = (sender as FinishedEventsReminderModal).FinishedEvents
                                                .Where(fe => fe.IsCompleted || fe.IsCanceled)
                                                .Select(fe => (new DateTime(fe.StartEvent.Year, fe.StartEvent.Month, fe.StartEvent.Day)))
                                                .Distinct()
                                                .ToList();

                if (datesUpdated.Count > 0 && _agendaWindow != null)
                {
                    _agendaWindow.RepaintSchedulerIfDateModifiedIsSelected(datesUpdated);
                }
            }
        }
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.Window = ((MyDentApplication.ManageTreatmentPricesWindow)(target));
     return;
     case 2:
     this.LayoutRoot = ((System.Windows.Controls.Grid)(target));
     return;
     case 3:
     this.tcTratments = ((System.Windows.Controls.TabControl)(target));
     return;
     case 4:
     this.dgDentristy = ((System.Windows.Controls.DataGrid)(target));
     return;
     case 5:
     this.tcPainClinic = ((System.Windows.Controls.TabControl)(target));
     return;
     case 6:
     this.dgPainClinic = ((System.Windows.Controls.DataGrid)(target));
     return;
     case 7:
     this.dgPainClinicHI = ((System.Windows.Controls.DataGrid)(target));
     return;
     case 8:
     this.tcEndodontics = ((System.Windows.Controls.TabControl)(target));
     return;
     case 9:
     this.dgEndodontics = ((System.Windows.Controls.DataGrid)(target));
     return;
     case 10:
     this.dgEndodonticsHI = ((System.Windows.Controls.DataGrid)(target));
     return;
     case 11:
     this.tcOrthodontics = ((System.Windows.Controls.TabControl)(target));
     return;
     case 12:
     this.dgOrthodontics = ((System.Windows.Controls.DataGrid)(target));
     return;
     case 13:
     this.dgOrthodonticsHI = ((System.Windows.Controls.DataGrid)(target));
     return;
     case 14:
     this.tcCmf = ((System.Windows.Controls.TabControl)(target));
     return;
     case 15:
     this.dgCmf = ((System.Windows.Controls.DataGrid)(target));
     return;
     case 16:
     this.dgCmfHI = ((System.Windows.Controls.DataGrid)(target));
     return;
     case 17:
     this.tcPeriodontics = ((System.Windows.Controls.TabControl)(target));
     return;
     case 18:
     this.dgPeriodontics = ((System.Windows.Controls.DataGrid)(target));
     return;
     case 19:
     this.dgPeriodonticsHI = ((System.Windows.Controls.DataGrid)(target));
     return;
     case 20:
     this.tcPediatricDental = ((System.Windows.Controls.TabControl)(target));
     return;
     case 21:
     this.dgPediatricDental = ((System.Windows.Controls.DataGrid)(target));
     return;
     case 22:
     this.dgPediatricDentalHI = ((System.Windows.Controls.DataGrid)(target));
     return;
     case 23:
     this.btnDeleteTreatment = ((System.Windows.Controls.Button)(target));
     
     #line 326 "..\..\..\Treatments\ManageTreatmentPricesWindow.xaml"
     this.btnDeleteTreatment.Click += new System.Windows.RoutedEventHandler(this.btnDeleteTreatment_Click);
     
     #line default
     #line hidden
     return;
     case 24:
     this.btnEditTreatment = ((System.Windows.Controls.Button)(target));
     
     #line 327 "..\..\..\Treatments\ManageTreatmentPricesWindow.xaml"
     this.btnEditTreatment.Click += new System.Windows.RoutedEventHandler(this.btnEditTreatment_Click);
     
     #line default
     #line hidden
     return;
     case 25:
     this.btnAddTreatment = ((System.Windows.Controls.Button)(target));
     
     #line 328 "..\..\..\Treatments\ManageTreatmentPricesWindow.xaml"
     this.btnAddTreatment.Click += new System.Windows.RoutedEventHandler(this.btnAddTreatment_Click);
     
     #line default
     #line hidden
     return;
     case 26:
     this.btnCopyPrices = ((System.Windows.Controls.Button)(target));
     
     #line 329 "..\..\..\Treatments\ManageTreatmentPricesWindow.xaml"
     this.btnCopyPrices.Click += new System.Windows.RoutedEventHandler(this.btnCopyPrices_Click);
     
     #line default
     #line hidden
     return;
     case 27:
     this.dtudSelectedYear = ((Xceed.Wpf.Toolkit.DateTimeUpDown)(target));
     return;
     case 28:
     this.btnRefresh = ((System.Windows.Controls.Button)(target));
     
     #line 332 "..\..\..\Treatments\ManageTreatmentPricesWindow.xaml"
     this.btnRefresh.Click += new System.Windows.RoutedEventHandler(this.btnRefresh_Click);
     
     #line default
     #line hidden
     return;
     }
     this._contentLoaded = true;
 }
        private void btnManageTreatmentPrices_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            if (_manageTreatmentPricesWindow == null)
            {
                _manageTreatmentPricesWindow = new ManageTreatmentPricesWindow(_userLoggedIn);
                _manageTreatmentPricesWindow.Closed += Window_Closed;
            }

            _manageTreatmentPricesWindow.Show();
            _manageTreatmentPricesWindow.WindowState = WindowState.Normal;
        }