public void SetMainActivity(MainActivity activity) { var lastActivity = currentMainActivity; currentMainActivity = activity; if (!currentMainActivity.Equals(lastActivity)) { if (lastActivity == MainActivity.Work) { workProgress = 0; } activityChangedEvent.Publish(currentMainActivity); } }