private FramesGrabber(StorageFile currentStorageFile, VideoPropsViewModel videoPropsViewModel, double perc, TimeSpan start, TimeSpan end) { //we can do this in InitAsync, but loosing readonly modifiers... file = currentStorageFile; this.videoPropsViewModel = videoPropsViewModel; this.start = start; this.end = end; framesCount = (int)Math.Round(RangeDuration.TotalSeconds * videoPropsViewModel.FrameRate); percentageOfResolution = perc; }
//ctors public static async Task <FramesGrabber> CtorAsync(StorageFile currentStorageFile, VideoPropsViewModel videoPropsViewModel, double perc, TimeSpan start, TimeSpan end) { //how to make ctor async: https://stackoverflow.com/questions/8145479/can-constructors-be-async var thisObj = new FramesGrabber(currentStorageFile, videoPropsViewModel, perc, start, end); await thisObj.InitAsync(); return(thisObj); }