public async void Synchronize(bool downloadAll = false) { try { Uploaded = 0; Downloaded = 0; Trace.Info(_traceCategory, "sign in"); await CloudService.SignIn(); Trace.Info(_traceCategory, "start synchronization"); ProgressValue = 0; await IsoToCloudSync(); ProgressValue = HalfOfProgress; await CloudToIsoSync(downloadAll); ProgressValue = HalfOfProgress * 2; Trace.Info(_traceCategory, "synchronize complete"); } catch (Exception ex) { MessageBox.Show(String.Format("Error occurred during synchronization: {0}", ex.Message)); } finally { // NOTE seems to be workaround: need to clear underlying cache to prevent attempts to // upload files several times in case of serial synchronize button clicks // Defenitely need to replace implementation of CloudService! CloudService.Release(); ProgressValue = 0; OnComplete(); } }