Click here to Skip to main content
15,891,431 members
Articles / Programming Languages / C# 4.0

Dynamically Loading Silverlight Video Players using MEF

,
Rate me:
Please Sign up or sign in to vote.
4.97/5 (10 votes)
24 Aug 2010Ms-PL8 min read 55.4K   2.7K   16  
An example using MEF to dynamically load Silverlight Video Players
  • completeprojectwithallsamplevideoplayers.zip
    • PhilMiddlemissTheme
    • SkinableVideoPlayer.sln
    • SkinableVideoPlayer.Web
    • SkinableVideoPlayer
      • App.xaml
      • App.xaml.cs
      • Bin
        • Debug
          • AppManifest.xaml
          • ar
            • System.Windows.Controls.resources.dll
          • bg
            • System.Windows.Controls.resources.dll
          • ca
            • System.Windows.Controls.resources.dll
          • cs
            • System.Windows.Controls.resources.dll
          • da
            • System.Windows.Controls.resources.dll
          • de
            • System.ComponentModel.Composition.Initialization.resources.dll
            • System.ComponentModel.Composition.resources.dll
            • System.Windows.Controls.resources.dll
          • el
            • System.Windows.Controls.resources.dll
          • es
            • System.ComponentModel.Composition.Initialization.resources.dll
            • System.ComponentModel.Composition.resources.dll
            • System.Windows.Controls.resources.dll
          • et
            • System.Windows.Controls.resources.dll
          • eu
            • System.Windows.Controls.resources.dll
          • fi
            • System.Windows.Controls.resources.dll
          • fr
            • System.ComponentModel.Composition.Initialization.resources.dll
            • System.ComponentModel.Composition.resources.dll
            • System.Windows.Controls.resources.dll
          • he
            • System.Windows.Controls.resources.dll
          • hr
            • System.Windows.Controls.resources.dll
          • hu
            • System.Windows.Controls.resources.dll
          • id
            • System.Windows.Controls.resources.dll
          • it
            • System.ComponentModel.Composition.Initialization.resources.dll
            • System.ComponentModel.Composition.resources.dll
            • System.Windows.Controls.resources.dll
          • ja
            • System.ComponentModel.Composition.Initialization.resources.dll
            • System.ComponentModel.Composition.resources.dll
            • System.Windows.Controls.resources.dll
          • ko
            • System.ComponentModel.Composition.Initialization.resources.dll
            • System.ComponentModel.Composition.resources.dll
            • System.Windows.Controls.resources.dll
          • lt
            • System.Windows.Controls.resources.dll
          • lv
            • System.Windows.Controls.resources.dll
          • Microsoft.Expression.Interactions.dll
          • Microsoft.Expression.Interactions.xml
          • ms
            • System.Windows.Controls.resources.dll
          • nl
            • System.Windows.Controls.resources.dll
          • no
            • System.Windows.Controls.resources.dll
          • pl
            • System.Windows.Controls.resources.dll
          • pt
            • System.Windows.Controls.resources.dll
          • pt-BR
            • System.Windows.Controls.resources.dll
          • ro
            • System.Windows.Controls.resources.dll
          • ru
            • System.ComponentModel.Composition.Initialization.resources.dll
            • System.ComponentModel.Composition.resources.dll
            • System.Windows.Controls.resources.dll
          • sk
            • System.Windows.Controls.resources.dll
          • SkinableVideoPlayer.dll
          • SkinableVideoPlayer.xap
          • SkinableVideoPlayerTestPage.html
          • SkinableVideoPlayerViewModel.dll
          • sl
            • System.Windows.Controls.resources.dll
          • sr-Cyrl-CS
            • System.Windows.Controls.resources.dll
          • sr-Latn-CS
            • System.Windows.Controls.resources.dll
          • sv
            • System.Windows.Controls.resources.dll
          • System.ComponentModel.Composition.dll
          • System.ComponentModel.Composition.Initialization.dll
          • System.ComponentModel.Composition.Initialization.xml
          • System.ComponentModel.Composition.xml
          • System.CoreEx.dll
          • System.Observable.dll
          • System.Reactive.dll
          • System.Windows.Controls.dll
          • System.Windows.Controls.Toolkit.dll
          • System.Windows.Controls.Toolkit.Internals.dll
          • System.Windows.Controls.Toolkit.xml
          • System.Windows.Controls.xml
          • System.Windows.Interactivity.dll
          • System.Windows.Interactivity.xml
          • th
            • System.Windows.Controls.resources.dll
          • tr
            • System.Windows.Controls.resources.dll
          • uk
            • System.Windows.Controls.resources.dll
          • vi
            • System.Windows.Controls.resources.dll
          • zh-Hans
            • System.ComponentModel.Composition.Initialization.resources.dll
            • System.ComponentModel.Composition.resources.dll
            • System.Windows.Controls.resources.dll
          • zh-Hant
            • System.ComponentModel.Composition.Initialization.resources.dll
            • System.ComponentModel.Composition.resources.dll
            • System.Windows.Controls.resources.dll
        • Release
      • classes
      • Models
      • Properties
      • Service References
        • wsSkinableVideoPlayer
          • configuration.svcinfo
          • configuration91.svcinfo
          • Reference.cs
          • Reference.svcmap
          • SkinableVideoPlayer.wsSkinableVideoPlayer.GetVideosResponse.datasource
          • SkinableVideoPlayer.wsSkinableVideoPlayer.GetXapsResponse.datasource
          • WebService.disco
          • WebService.wsdl
      • ServiceReferences.ClientConfig
      • SkinableVideoPlayer.csproj
      • SkinableVideoPlayer.csproj.user
      • ViewModels
      • Views
    • SkinableVideoPlayer_View
    • SkinableVideoPlayerViewModel
      • Bin
        • Debug
          • ar
          • bg
          • ca
          • cs
          • da
          • de
          • el
          • es
          • et
          • eu
          • fi
          • fr
          • he
          • hr
          • hu
          • id
          • it
          • ja
          • ko
          • lt
          • lv
          • ms
          • nl
          • no
          • pl
          • pt
          • pt-BR
          • ro
          • ru
          • sk
          • SkinableVideoPlayerViewModel.dll
          • sl
          • sr-Cyrl-CS
          • sr-Latn-CS
          • sv
          • th
          • tr
          • uk
          • vi
          • zh-Hans
          • zh-Hant
        • Release
      • ClassDiagram1.cd
      • classes
      • Model
      • Properties
      • Service References
        • wsSkinableVideoPlayer
          • configuration.svcinfo
          • configuration91.svcinfo
          • Reference.cs
          • Reference.svcmap
          • SkinableVideoPlayerViewModel.wsSkinableVideoPlayer.GetVideosResponse.datasource
          • SkinableVideoPlayerViewModel.wsSkinableVideoPlayer.GetXapsResponse.datasource
          • WebService.disco
          • WebService.wsdl
      • ServiceReferences.ClientConfig
      • SkinableVideoPlayerViewModel.csproj
      • SkinableVideoPlayerViewModel.csproj.user
      • ViewModel
  • versionone.zip
    • SkinableVideoPlayer.sln
    • WebService.cs
    • SkinableVideoPlayer.xap
    • VersionOne.xap
    • Default.aspx
    • Silverlight.js
    • desktop.ini
    • niceday.wmv
    • Thumbs.db
    • web.config
    • WebService.asmx
    • App.xaml
    • App.xaml.cs
    • AppManifest.xaml
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.ComponentModel.Composition.Initialization.resources.dll
    • System.ComponentModel.Composition.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.ComponentModel.Composition.Initialization.resources.dll
    • System.ComponentModel.Composition.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.ComponentModel.Composition.Initialization.resources.dll
    • System.ComponentModel.Composition.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.ComponentModel.Composition.Initialization.resources.dll
    • System.ComponentModel.Composition.resources.dll
    • System.Windows.Controls.resources.dll
    • System.ComponentModel.Composition.Initialization.resources.dll
    • System.ComponentModel.Composition.resources.dll
    • System.Windows.Controls.resources.dll
    • System.ComponentModel.Composition.Initialization.resources.dll
    • System.ComponentModel.Composition.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • Microsoft.Expression.Interactions.dll
    • Microsoft.Expression.Interactions.xml
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.ComponentModel.Composition.Initialization.resources.dll
    • System.ComponentModel.Composition.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • SkinableVideoPlayer.dll
    • SkinableVideoPlayer.xap
    • SkinableVideoPlayerTestPage.html
    • SkinableVideoPlayerViewModel.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.ComponentModel.Composition.dll
    • System.ComponentModel.Composition.Initialization.dll
    • System.ComponentModel.Composition.Initialization.xml
    • System.ComponentModel.Composition.xml
    • System.Windows.Controls.dll
    • System.Windows.Controls.Toolkit.dll
    • System.Windows.Controls.Toolkit.Internals.dll
    • System.Windows.Controls.Toolkit.xml
    • System.Windows.Controls.xml
    • System.Windows.Interactivity.dll
    • System.Windows.Interactivity.xml
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.ComponentModel.Composition.Initialization.resources.dll
    • System.ComponentModel.Composition.resources.dll
    • System.Windows.Controls.resources.dll
    • System.ComponentModel.Composition.Initialization.resources.dll
    • System.ComponentModel.Composition.resources.dll
    • System.Windows.Controls.resources.dll
    • DelegateCommand.cs
    • DeploymentCatalogService.cs
    • Extensions.cs
    • SilverlightXaps.cs
    • AppManifest.xml
    • AssemblyInfo.cs
    • configuration.svcinfo
    • configuration91.svcinfo
    • Reference.cs
    • Reference.svcmap
    • SkinableVideoPlayer.wsSkinableVideoPlayer.GetVideosResponse.datasource
    • SkinableVideoPlayer.wsSkinableVideoPlayer.GetXapsResponse.datasource
    • WebService.disco
    • WebService.wsdl
    • ServiceReferences.ClientConfig
    • SkinableVideoPlayer.csproj
    • SkinableVideoPlayer.csproj.user
    • MainPageModel.cs
    • MainPage.xaml
    • MainPage.xaml.cs
    • SkinableVideoPlayerViewModel.dll
    • SkinableVideoPlayerViewModel.pdb
    • DelegateCommand.cs
    • SilverlightVideos.cs
    • obj
    • VersionOne
      • App.xaml
      • App.xaml.cs
      • Bin
        • Debug
          • AppManifest.xaml
          • ar
            • System.Windows.Controls.resources.dll
          • bg
            • System.Windows.Controls.resources.dll
          • ca
            • System.Windows.Controls.resources.dll
          • cs
            • System.Windows.Controls.resources.dll
          • da
            • System.Windows.Controls.resources.dll
          • de
            • System.ComponentModel.Composition.resources.dll
            • System.Windows.Controls.resources.dll
          • el
            • System.Windows.Controls.resources.dll
          • es
            • System.ComponentModel.Composition.resources.dll
            • System.Windows.Controls.resources.dll
          • et
            • System.Windows.Controls.resources.dll
          • eu
            • System.Windows.Controls.resources.dll
          • fi
            • System.Windows.Controls.resources.dll
          • fr
            • System.ComponentModel.Composition.resources.dll
            • System.Windows.Controls.resources.dll
          • he
            • System.Windows.Controls.resources.dll
          • hr
            • System.Windows.Controls.resources.dll
          • hu
            • System.Windows.Controls.resources.dll
          • id
            • System.Windows.Controls.resources.dll
          • it
            • System.ComponentModel.Composition.resources.dll
            • System.Windows.Controls.resources.dll
          • ja
            • System.ComponentModel.Composition.resources.dll
            • System.Windows.Controls.resources.dll
          • ko
            • System.ComponentModel.Composition.resources.dll
            • System.Windows.Controls.resources.dll
          • lt
            • System.Windows.Controls.resources.dll
          • lv
            • System.Windows.Controls.resources.dll
          • ms
            • System.Windows.Controls.resources.dll
          • nl
            • System.Windows.Controls.resources.dll
          • no
            • System.Windows.Controls.resources.dll
          • pl
            • System.Windows.Controls.resources.dll
          • pt
            • System.Windows.Controls.resources.dll
          • pt-BR
            • System.Windows.Controls.resources.dll
          • ro
            • System.Windows.Controls.resources.dll
          • ru
            • System.ComponentModel.Composition.resources.dll
            • System.Windows.Controls.resources.dll
          • sk
            • System.Windows.Controls.resources.dll
          • sl
            • System.Windows.Controls.resources.dll
          • sr-Cyrl-CS
            • System.Windows.Controls.resources.dll
          • sr-Latn-CS
            • System.Windows.Controls.resources.dll
          • sv
            • System.Windows.Controls.resources.dll
          • System.ComponentModel.Composition.dll
          • System.ComponentModel.Composition.xml
          • System.Windows.Controls.dll
          • System.Windows.Controls.Toolkit.dll
          • System.Windows.Controls.Toolkit.Internals.dll
          • System.Windows.Controls.Toolkit.pdb
          • System.Windows.Controls.Toolkit.xml
          • System.Windows.Controls.xml
          • System.Windows.Interactivity.dll
          • System.Windows.Interactivity.xml
          • th
            • System.Windows.Controls.resources.dll
          • tr
            • System.Windows.Controls.resources.dll
          • uk
            • System.Windows.Controls.resources.dll
          • VersionOne.dll
          • VersionOne.pdb
          • VersionOne.xap
          • VersionOneTestPage.html
          • vi
            • System.Windows.Controls.resources.dll
          • zh-Hans
            • System.ComponentModel.Composition.resources.dll
            • System.Windows.Controls.resources.dll
          • zh-Hant
            • System.ComponentModel.Composition.resources.dll
            • System.Windows.Controls.resources.dll
        • Release
      • obj
      • Properties
      • VersionOne.csproj
      • VersionOne.csproj.user
      • Views
  • base.zip
    • SkinableVideoPlayer.sln
    • WebService.cs
    • SkinableVideoPlayer.xap
    • Default.aspx
    • Silverlight.js
    • desktop.ini
    • niceday.wmv
    • Thumbs.db
    • web.config
    • WebService.asmx
    • App.xaml
    • App.xaml.cs
    • AppManifest.xaml
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.ComponentModel.Composition.Initialization.resources.dll
    • System.ComponentModel.Composition.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.ComponentModel.Composition.Initialization.resources.dll
    • System.ComponentModel.Composition.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.ComponentModel.Composition.Initialization.resources.dll
    • System.ComponentModel.Composition.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.ComponentModel.Composition.Initialization.resources.dll
    • System.ComponentModel.Composition.resources.dll
    • System.Windows.Controls.resources.dll
    • System.ComponentModel.Composition.Initialization.resources.dll
    • System.ComponentModel.Composition.resources.dll
    • System.Windows.Controls.resources.dll
    • System.ComponentModel.Composition.Initialization.resources.dll
    • System.ComponentModel.Composition.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • Microsoft.Expression.Interactions.dll
    • Microsoft.Expression.Interactions.xml
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.ComponentModel.Composition.Initialization.resources.dll
    • System.ComponentModel.Composition.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • SkinableVideoPlayer.dll
    • SkinableVideoPlayer.xap
    • SkinableVideoPlayerTestPage.html
    • SkinableVideoPlayerViewModel.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.ComponentModel.Composition.dll
    • System.ComponentModel.Composition.Initialization.dll
    • System.ComponentModel.Composition.Initialization.xml
    • System.ComponentModel.Composition.xml
    • System.Windows.Controls.dll
    • System.Windows.Controls.Toolkit.dll
    • System.Windows.Controls.Toolkit.Internals.dll
    • System.Windows.Controls.Toolkit.xml
    • System.Windows.Controls.xml
    • System.Windows.Interactivity.dll
    • System.Windows.Interactivity.xml
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.Windows.Controls.resources.dll
    • System.ComponentModel.Composition.Initialization.resources.dll
    • System.ComponentModel.Composition.resources.dll
    • System.Windows.Controls.resources.dll
    • System.ComponentModel.Composition.Initialization.resources.dll
    • System.ComponentModel.Composition.resources.dll
    • System.Windows.Controls.resources.dll
    • DelegateCommand.cs
    • DeploymentCatalogService.cs
    • Extensions.cs
    • SilverlightXaps.cs
    • AppManifest.xml
    • AssemblyInfo.cs
    • configuration.svcinfo
    • configuration91.svcinfo
    • Reference.cs
    • Reference.svcmap
    • SkinableVideoPlayer.wsSkinableVideoPlayer.GetVideosResponse.datasource
    • SkinableVideoPlayer.wsSkinableVideoPlayer.GetXapsResponse.datasource
    • WebService.disco
    • WebService.wsdl
    • ServiceReferences.ClientConfig
    • SkinableVideoPlayer.csproj
    • SkinableVideoPlayer.csproj.user
    • MainPageModel.cs
    • MainPage.xaml
    • MainPage.xaml.cs
    • SkinableVideoPlayerViewModel.dll
    • DelegateCommand.cs
    • SilverlightVideos.cs
    • AssemblyInfo.cs
    • configuration.svcinfo
    • configuration91.svcinfo
    • Reference.cs
    • Reference.svcmap
    • SkinableVideoPlayerViewModel.wsSkinableVideoPlayer.GetVideosResponse.datasource
    • SkinableVideoPlayerViewModel.wsSkinableVideoPlayer.GetXapsResponse.datasource
    • WebService.disco
    • WebService.wsdl
    • ServiceReferences.ClientConfig
    • SkinableVideoPlayerViewModel.csproj
    • SkinableVideoPlayerViewModel.csproj.user
    • MainViewModel.cs
<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
	xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
	xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
	xmlns:local="clr-namespace:SkinableVideoPlayer_View"
	xmlns:SkinableVideoPlayer="clr-namespace:SkinableVideoPlayer;assembly=SkinableVideoPlayerViewModel" 
    x:Name="userControl" 
    mc:Ignorable="d"
	x:Class="SkinableVideoPlayer_View.MainPage"
	UseLayoutRounding="True"  d:DesignWidth="600" d:DesignHeight="350">

	<UserControl.DataContext>
		<SkinableVideoPlayer:MainViewModel/>
	</UserControl.DataContext>

	<Grid x:Name="LayoutRoot" Background="White" Width="600" Height="350">
		<Grid.RowDefinitions>
			<RowDefinition Height="0.914*"/>
			<RowDefinition Height="0.086*"/>
		</Grid.RowDefinitions>
		<i:Interaction.Triggers>
			<i:EventTrigger>
				<i:InvokeCommandAction x:Name="SetMediaElement" Command="{Binding SetMediaElementCommand}" CommandParameter="{Binding ElementName=mediaElement, Mode=OneWay}"/>
			</i:EventTrigger>
		</i:Interaction.Triggers>
		<MediaElement x:Name="mediaElement" Source="{Binding SelectedVideoProperty}" AutoPlay="False" Margin="0,9,0,66">
			<i:Interaction.Triggers>
				<i:EventTrigger EventName="MediaOpened">
					<i:InvokeCommandAction x:Name="SetSeekCommand" Command="{Binding SetSeekControlCommand}" CommandParameter="{Binding ElementName=progressBar}"/>
				</i:EventTrigger>
			</i:Interaction.Triggers>
		</MediaElement>
		<Grid x:Name="PlayerControls" VerticalAlignment="Top" Grid.Row="1" >
			<StackPanel HorizontalAlignment="Center" VerticalAlignment="Bottom" Orientation="Horizontal">
				<Button x:Name="RewindButton" Content="&lt;&lt;" Width="27" HorizontalAlignment="Left">
					<i:Interaction.Triggers>
						<i:EventTrigger EventName="Click">
							<i:InvokeCommandAction x:Name="RewindCommand" Command="{Binding RewindVideoCommand}"/>
						</i:EventTrigger>
					</i:Interaction.Triggers>
				</Button>
				<Button x:Name="PlayButton" Content="Play" Width="75" HorizontalAlignment="Left" Margin="5,0,0,0">
					<i:Interaction.Triggers>
						<i:EventTrigger EventName="Click">
							<i:InvokeCommandAction x:Name="PlayCommand" Command="{Binding PlayVideoCommand}"/>
						</i:EventTrigger>
					</i:Interaction.Triggers>
				</Button>
				<Button x:Name="StopButton" Content="Stop" Width="68" HorizontalAlignment="Left" Margin="5,0,0,0">
					<i:Interaction.Triggers>
						<i:EventTrigger EventName="Click">
							<i:InvokeCommandAction x:Name="StopCommand" Command="{Binding StopVideoCommand}"/>
						</i:EventTrigger>
					</i:Interaction.Triggers>
				</Button>
				<Button x:Name="PauseButton" Content="Pause" Width="75" HorizontalAlignment="Left" Margin="5,0,0,0">
					<i:Interaction.Triggers>
						<i:EventTrigger EventName="Click">
							<i:InvokeCommandAction x:Name="PauseCommand" Command="{Binding PauseVideoCommand}"/>
						</i:EventTrigger>
					</i:Interaction.Triggers>
				</Button>
				<Button x:Name="ForwardButton" Content="&gt;&gt;" Width="27" HorizontalAlignment="Left" Margin="5,0,0,0">
					<i:Interaction.Triggers>
						<i:EventTrigger EventName="Click">
							<i:InvokeCommandAction x:Name="ForwardCommand" Command="{Binding ForwardVideoCommand}"/>
						</i:EventTrigger>
					</i:Interaction.Triggers>
				</Button>
				<Slider Maximum="1" LargeChange="0.5" Value="{Binding Volume, ElementName=mediaElement, Mode=TwoWay}" Width="49" HorizontalAlignment="Left" Height="22" Margin="10,0,0,0"/>
			</StackPanel>
		</Grid>
		<ProgressBar x:Name="progressBar" Height="16" Margin="193,0,219,34" VerticalAlignment="Bottom" Maximum="{Binding TotalDurationProperty}" Value="{Binding CurrentPositionProperty, Mode=TwoWay}"/>
		<StackPanel x:Name="DisplayPanel" Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="0,293,0,0">
			<TextBlock x:Name="ProgressDisplay" Text="{Binding CurrentProgressProperty}" TextAlignment="Center" Height="12" RenderTransformOrigin="0.5,0.5" d:LayoutOverrides="HorizontalAlignment">
				<TextBlock.RenderTransform>
					<CompositeTransform/>
				</TextBlock.RenderTransform>
			</TextBlock>
			<ComboBox x:Name="VideoList" ItemsSource="{Binding SilverlightVideoList}" SelectedIndex="{Binding SelectedVideoInListProperty}" Margin="10,0,0,0">
				<i:Interaction.Triggers>
					<i:EventTrigger EventName="DropDownClosed">
						<i:InvokeCommandAction x:Name="SetVideo" Command="{Binding SetVideoCommand}" CommandParameter="{Binding SelectedItem, ElementName=VideoList}"/>
					</i:EventTrigger>
				</i:Interaction.Triggers>
			</ComboBox>
		</StackPanel>
		<toolkit:BusyIndicator Content="" Margin="229,156,260,0" VerticalAlignment="Top" IsBusy="{Binding MediaBufferingProperty}" Height="58" BusyContent="{Binding MediaBufferingTimeProperty}"/>
	</Grid>
</UserControl>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)


Written By
Software Developer (Senior) http://ADefWebserver.com
United States United States
Michael Washington is a Microsoft MVP. He is a ASP.NET and
C# programmer.
He is the founder of
AiHelpWebsite.com,
LightSwitchHelpWebsite.com, and
HoloLensHelpWebsite.com.

He has a son, Zachary and resides in Los Angeles with his wife Valerie.

He is the Author of:

Written By
Software Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions