private void UserControl_Loaded(object sender, RoutedEventArgs e) { if (objGeneralDba == null) { objGeneralDba = new GeneralDba(); } _floor.Text = "FLOOR " + floor; VLC_Drive_01.IsChecked = objGeneralDba.GetFloorVLCStatus(floor, VLC_Drive_01.Name); VLC_Drive_02.IsChecked = objGeneralDba.GetFloorVLCStatus(floor, VLC_Drive_02.Name); VLC_Drive_03.IsChecked = objGeneralDba.GetFloorVLCStatus(floor, VLC_Drive_03.Name); VLC_Drive_04.IsChecked = objGeneralDba.GetFloorVLCStatus(floor, VLC_Drive_04.Name); VLC_Drive_05.IsChecked = objGeneralDba.GetFloorVLCStatus(floor, VLC_Drive_05.Name); VLC_Drive_06.IsChecked = objGeneralDba.GetFloorVLCStatus(floor, VLC_Drive_06.Name); VLC_Drive_01.Checked += VLC_Drive_Checked; VLC_Drive_01.Unchecked += VLC_Drive_Unchecked; VLC_Drive_02.Checked += VLC_Drive_Checked; VLC_Drive_02.Unchecked += VLC_Drive_Unchecked; VLC_Drive_03.Checked += VLC_Drive_Checked; VLC_Drive_03.Unchecked += VLC_Drive_Unchecked; VLC_Drive_04.Checked += VLC_Drive_Checked; VLC_Drive_04.Unchecked += VLC_Drive_Unchecked; VLC_Drive_05.Checked += VLC_Drive_Checked; VLC_Drive_05.Unchecked += VLC_Drive_Unchecked; VLC_Drive_06.Checked += VLC_Drive_Checked; VLC_Drive_06.Unchecked += VLC_Drive_Unchecked; }