/// <summary>
        /// Refreshes the preview in case of being a VideoPreview.
        /// </summary>
        public void RefreshPreview()
        {
            VideoPreview videoPreview = this.previewControl as VideoPreview;

            if (videoPreview != null)
            {
                double currentWidth = this.MainCanvas.ActualWidth <= 0
                                          ? this.MainCanvas.Width
                                          : this.MainCanvas.ActualWidth;

                videoPreview.Refresh(currentWidth);
            }
        }
        public void RefreshPreview(RefreshSource refreshSource)
        {
            VideoPreview videoPreview = this.previewControl as VideoPreview;
            AudioPreview audioPreview = this.previewControl as AudioPreview;

            if (videoPreview != null)
            {
                double currentWidth = this.MainCanvas.ActualWidth <= 0
                                          ? this.MainCanvas.Width
                                          : this.MainCanvas.ActualWidth;

                videoPreview.Refresh(currentWidth, refreshSource);
            }

            if (audioPreview != null)
            {
                audioPreview.Refresh();
            }
        }