I am doing some kind of status reporting so I can update the new status to the UI. For e.g. the status can be - "Loading...", "Loaded..." and so on. My problem is that the StatusChanged event is always null and can't be fired.
public class StatusReporter
{
public delegate void StatusChangedEventHandler(Status status);
public static event StatusChangedEventHandler StatusChanged;
private static Status status;
public static Status CurrentStatus
{
get
{
return status;
}
set
{
status = value;
OnStatusChange();
}
}
private static void OnStatusChange()
{
if (StatusChanged != null)
{
StatusChanged(status);
}
}
}