The solution to this problem is achieved by making use of Events, to send information from one class to another, as was rightly pointed out by OriginalGriff in one of the previous comments, have a look at this article authored by OriginalGriff :
Transferring information between two forms, Part 2: Child to Parent[
^]
Another useful article which introduces to us the concept of Events is :
Delegates - a 15 minutes quick start tutorial[
^]
The solution to this problem can be summarized as follows:
All the variables which are defined in the MainWindow.xaml file are accessible only in MainWindow class which is present in MainWindow.xaml.cs, so to access these variables in any other class in the same project,we have to make use of Events. We can trigger the Event in that class where we want to access the variables of MainWindow.xaml and handle that Event in MainWindow class. Thats it.