code: function () {
          window.removeEventListener("focus", savePhotoOnFocus);
          // call only when the app is in focus again
          savePhoto(cameraPicture, {
              destinationType: destinationType,
              targetHeight: targetHeight,
              targetWidth: targetWidth,
              encodingType: encodingType,
              saveToPhotoAlbum: saveToPhotoAlbum
          }, successCallback, errorCallback);
      }
docs: define focus handler for windows phone 10.0