/// <summary>
        /// Change the preview image of the asset as asset is changed.
        /// </summary>
        /// <param name="d">The <see cref="DependencyObject"/>.</param>
        /// <param name="e">The <see cref="System.Windows.DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
        private static void AssetChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            VideoPreview preview = d as VideoPreview;

            if (preview != null && preview.thumbnailService != null)
            {
                Uri frameUri = new Uri(preview.thumbnailService.GetThumbnailSource(preview.Asset), UriKind.RelativeOrAbsolute);
                preview.FramePreviewImage.Source = new BitmapImage(frameUri);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Adds the asset to timeline.
        /// </summary>
        private void AddAssetToTimeline()
        {
            Asset selectedAsset = this.AssetsList.SelectedItem as Asset;

            if (selectedAsset != null && !(selectedAsset is FolderAsset))
            {
                if (selectedAsset is VideoAsset)
                {
                    // VideoPreview preview = this.AssetsList.GetChildControls<VideoPreview>().Where(x => x.Asset == selectedAsset).Single();
                    VideoPreview    preview         = this.AssetsList.GetChildControls <VideoPreview>().Where(x => x.Asset == selectedAsset).Single();
                    VideoAsset      videoAsset      = selectedAsset as VideoAsset;
                    VideoAssetInOut videoAssetInOut = new VideoAssetInOut(videoAsset);
                    this.Model.AddAssetToTimeline(videoAssetInOut);
                }
                else
                {
                    this.Model.AddAssetToTimeline(selectedAsset);
                }
            }
        }