void closeWindow_Click(object sender, RoutedEventArgs e) { if (editWindow != null) editWindow = null; refreshAll(); }
void tab1_Click(object sender, RoutedEventArgs e) { try { string dayID_PeriodID = ((Button)sender).Tag.ToString(); string[] tempArray = new string[2]; tempArray = dayID_PeriodID.Split(';'); if (tempArray[0] != "0" && tempArray[1] != "0")//So Edit window wont come up when days or time is clicked { string btnContent = " -- Please Select -- "; if (((Button)sender).Content != null) btnContent = ((Button)sender).Content.ToString(); if (editWindow != null) editWindow.Close(); editWindow = new Edit_Schedule(dayID_PeriodID, btnContent, selectedRoom); editWindow.closeWindow.Click += new RoutedEventHandler(closeWindow_Click); editWindow.UpdateList.Click += new RoutedEventHandler(UpdateList_Click); editWindow.ClearVal.Click += new RoutedEventHandler(ClearVal_Click); editWindow.Owner = Window.GetWindow(this); editWindow.ShowDialog(); } } catch (Exception) { RefreshTab4(); } }