Duplicate code in day of the week event handlers
What you need to do is:


Add a parameter of type System.DayOfWeek called, say, day_of_week.
Replace the fields BinaryDataGrid.Sunday, .Monday, etc. with a Dictionary&lt;K,V&gt; that has a key of type System.DayOfWeek and use day_of_week to access values within that dictionary.
Do the same for your _sun, _mon etc. global variables. (For which you will burn in hell, incidentally.)


If you cannot modify BinaryDataGrid, then write two helper methods, one for getting and one for setting the value of the day member of BinaryDataGrid: Each method has a switch( day_of_week ) and modifies the appropriate member of BinaryDataGrid.

Good luck and have fun.