public EditVideoViewModel(ICacheService cacheService, ICommonErrorHandler errorHandler, IStateService stateService, INavigationService navigationService, IMTProtoService mtProtoService, ITelegramEventAggregator eventAggregator)
            : base(cacheService, errorHandler, stateService, navigationService, mtProtoService, eventAggregator)
        {
            VideoFile = StateService.VideoFile;
            StateService.VideoFile = null;

            IsCompressionEnabled = true;
            NotifyOfPropertyChange(() => IsCompressionEnabled);

            BeginOnThreadPool(async() =>
            {
                var properties      = await VideoFile.GetBasicPropertiesAsync();
                var videoProperties = await VideoFile.Properties.GetVideoPropertiesAsync();

                Size     = properties.Size;
                Duration = videoProperties.Duration.TotalSeconds;
                Width    = videoProperties.Width;
                Height   = videoProperties.Height;

                DurationString = GetDurationString(videoProperties.Duration);
                NotifyOfPropertyChange(() => DurationString);
                var originalSizeString = FileSizeConverter.Convert((long)properties.Size);

                OriginalVideoParameters = string.Format("{0}x{1}, {2}, {3}", videoProperties.Width, videoProperties.Height, DurationString, originalSizeString);
                NotifyOfPropertyChange(() => OriginalVideoParameters);

                var maxLength   = Math.Max(videoProperties.Width, videoProperties.Height);
                var scaleFactor = maxLength > 640.0 ? 640.0 / maxLength : 1.0;
                if (scaleFactor == 1.0)
                {
                    IsCompressionEnabled = false;
                    NotifyOfPropertyChange(() => IsCompressionEnabled);
                    Compression = false;
                }

                EditedSize           = (ulong)(properties.Size * scaleFactor * scaleFactor);
                var editedSizeString = FileSizeConverter.Convert((long)EditedSize);
                var editedHeight     = videoProperties.Height * scaleFactor;
                var editedWidth      = videoProperties.Width * scaleFactor;

                EditedVideoParameters = string.Format("{0}x{1}, {2}, ~{3}", editedWidth, editedHeight, DurationString, editedSizeString);
                NotifyOfPropertyChange(() => EditedVideoParameters);

                ThumbPhoto = await GetFileThumbAsync(VideoFile);
                NotifyOfPropertyChange(() => ThumbPhoto);
            });
        }