Tag Archives: .Net

Event Arguments == Static Snapshots?

Is the event argument that’s passed to an event handler/handler override always a non-changing snapshot taken the moment the event occurred?

No! While convention suggests a “yes” answer, no technical constrain enforces this assumption (as I discovered recently). The properties of an event argument can (and sometimes do) return information about the current (live) state of the system instead of describing the moment the event occurred.

Continue reading

DataGrid – Per-Row Running Totals

The program I’m working on lists transactions in a WPF Toolkit DataGrid. Each grid row displays a transaction’s date, amount, etc.  Each row in the grid needed to show the sum of all transaction amounts prior to and including that row. You might call this a per-row running total. Example:

Date       | Check #   | Payee       | Amount    | Balance
2/1/10                   Frank         10.00       10.00
3/6/10       101         John          -6.95        3.05
4/9/10       102         Tom           -1.05        2.00

Continue reading