private void OnActiveTimeEntryManagerPropertyChanged(object sender, PropertyChangedEventArgs args) { if (args.PropertyName == ActiveTimeEntryManager.PropertyActive || args.PropertyName == ActiveTimeEntryManager.PropertyRunning) { if (SyncModel()) { Rebind(); } if (ActiveEntryChanged != null) { ActiveEntryChanged.Invoke(sender, args); } } }
public void OnStart() { // Hook up to time entry manager if (timeEntryManager == null) { timeEntryManager = ServiceContainer.Resolve <ActiveTimeEntryManager> (); timeEntryManager.PropertyChanged += OnActiveTimeEntryManagerPropertyChanged; } canRebind = true; SyncModel(); Rebind(); if (ActiveEntryChanged != null) { ActiveEntryChanged.Invoke(this, EventArgs.Empty); // Initial rendering } }