Removed some code duplication
Invoking PostRepositoryChanged in UI thread
Prevent callback from being called after control is disposed. Fixes #1317.