I tried to change the Tab Name like this:
foreach (Window window in Application.Current.Windows)
{
(window as MainWindow).HomeTab.Header = "Teaching Learning Based Optimization";
}
However all I get is an NullReferenceException. What am I missing?