1) Yes, you can access any part of any class if it is declared public. In this case, you can declare progressBar public control, and everything that has a link to class MainWindow , can play with it. HOWEVER, that would be pretty bad practice. Instead, you can bind to some βvalueβ that updates with respect to the current progress of the activity and allows the MainWindow class to worry about how it represents this change (in this case, updating the ProgressBar)
2) object sender in all cases implies a reference to the object that raised the event, so the consumer of the event knows where the event came from. Using null is also bad IMO practice, and in general the object that raises the event should do it like this:
SomeEvent(this, someEventArgs);
source share