private void BoardsName_Click(object sender, RoutedEventArgs e) { this.menuItem = (MenuItem)e.OriginalSource; if (this.menuItem != null) { string selectedBoard = this.menuItem.Header.ToString(); this.menuItem.Background = new SolidColorBrush(Colors.IndianRed); show((Board)this.boardsCollection[selectedBoard]); this.MainB = (Board)this.boardsCollection[selectedBoard]; InfoObject info = SystemInterface.setCurrBaord(this.userName, selectedBoard); if (!info.getIsSucceeded()) { MessageBox.Show(info.getMessage()); } else { this.menuItem = null; } } }