Click here to Skip to main content
Click here to Skip to main content
 
Add your own
alternative version
Go to top

Configurable Silverlight Image Rotator

, 23 Feb 2009
Using Silverlight 2.0 and C#/VB.NET to build an image rotator that has a useful set of basic features and is easy to setup and deploy.
ImageRotator_CSharp.zip
ImageRotator_CSharp
ImageRotator_CSharp.Web
bin
de
System.Web.Silverlight.resources.dll
es
System.Web.Silverlight.resources.dll
fr
System.Web.Silverlight.resources.dll
ImageRotator_CSharp.Web.dll
it
System.Web.Silverlight.resources.dll
ja
System.Web.Silverlight.resources.dll
ko
System.Web.Silverlight.resources.dll
System.Web.Silverlight.dll
zh-Hans
System.Web.Silverlight.resources.dll
zh-Hant
System.Web.Silverlight.resources.dll
ClientBin
ImageRotator_CSharp.xap
Images
a.jpg
b.jpg
c.jpg
d.jpg
e.jpg
f.jpg
g.jpg
ImageRotator_CSharp.Web.csproj.user
Properties
ImageRotator_CSharp
Bin
Debug
de
System.Xml.Linq.resources.dll
es
System.Xml.Linq.resources.dll
fr
System.Xml.Linq.resources.dll
ImageRotator_CSharp.dll
ImageRotator_CSharp.xap
it
System.Xml.Linq.resources.dll
ja
System.Xml.Linq.resources.dll
ko
System.Xml.Linq.resources.dll
System.Xml.Linq.dll
zh-Hans
System.Xml.Linq.resources.dll
zh-Hant
System.Xml.Linq.resources.dll
ImageRotator_CSharp.csproj.user
Properties
PrecompiledWeb
bin
de
System.Web.Silverlight.resources.dll
es
System.Web.Silverlight.resources.dll
fr
System.Web.Silverlight.resources.dll
ImageRotator_CSharp.Web.dll
it
System.Web.Silverlight.resources.dll
ja
System.Web.Silverlight.resources.dll
ko
System.Web.Silverlight.resources.dll
System.Web.Silverlight.dll
zh-Hans
System.Web.Silverlight.resources.dll
zh-Hant
System.Web.Silverlight.resources.dll
ClientBin
ImageRotator_CSharp.xap
Images
a.jpg
b.jpg
c.jpg
d.jpg
e.jpg
f.jpg
g.jpg
ImageRotator_CSharp_DeploymentOnly.zip
ImageRotator_CSharp.Web
bin
de
System.Web.Silverlight.resources.dll
es
System.Web.Silverlight.resources.dll
fr
System.Web.Silverlight.resources.dll
ImageRotator_CSharp.Web.dll
it
System.Web.Silverlight.resources.dll
ja
System.Web.Silverlight.resources.dll
ko
System.Web.Silverlight.resources.dll
System.Web.Silverlight.dll
zh-Hans
System.Web.Silverlight.resources.dll
zh-Hant
System.Web.Silverlight.resources.dll
ClientBin
ImageRotator_CSharp.xap
Images
a.jpg
b.jpg
c.jpg
d.jpg
e.jpg
f.jpg
g.jpg
ImageRotator_CSharp.Web.csproj.user
Properties
ImageRotator_VB.zip
ImageRotator_VB
ImageRotator_VB.Web
App_Data
bin
de
System.Web.Silverlight.resources.dll
es
System.Web.Silverlight.resources.dll
fr
System.Web.Silverlight.resources.dll
ImageRotator_VB.Web.dll
it
System.Web.Silverlight.resources.dll
ja
System.Web.Silverlight.resources.dll
ko
System.Web.Silverlight.resources.dll
System.Web.Silverlight.dll
zh-Hans
System.Web.Silverlight.resources.dll
zh-Hant
System.Web.Silverlight.resources.dll
ClientBin
ImageRotator_VB.xap
Images
a.jpg
b.jpg
c.jpg
d.jpg
e.jpg
f.jpg
g.jpg
ImageRotator_VB.Web.vbproj.user
My Project
Application.myapp
MyExtensions
Settings.settings
obj
Debug
ImageRotator_VB.Web.dll
ImageRotator_VB.Web.pdb
ImageRotator_VB.Web.Resources.resources
ImageRotator_VB.Web.vbproj.GenerateResource.Cache
ImageRotator_VB
Bin
Debug
de
System.Xml.Linq.resources.dll
es
System.Xml.Linq.resources.dll
fr
System.Xml.Linq.resources.dll
ImageRotator_VB.dll
ImageRotator_VB.xap
it
System.Xml.Linq.resources.dll
ja
System.Xml.Linq.resources.dll
ko
System.Xml.Linq.resources.dll
System.Xml.Linq.dll
zh-Hans
System.Xml.Linq.resources.dll
zh-Hant
System.Xml.Linq.resources.dll
ImageRotator_VB.vbproj.user
My Project
<?xml version="1.0"?>
<doc>
<assembly>
<name>
ImageRotator_VB
</name>
</assembly>
<members>
<member name="M:ImageRotator_VB.SilverlightControl1.InitializeComponent">
	<summary>
InitializeComponent
</summary>
</member><member name="M:ImageRotator_VB.SlideShowImage.#ctor">
	<summary> 
 Creates new instance of a SlideShowImage. 
 </summary>
</member><member name="P:ImageRotator_VB.SlideShowImage.ImageUri">
	<summary> 
 Sets imageUri. 
 </summary>
</member><member name="P:ImageRotator_VB.SlideShowImage.ImageSource">
	<summary> 
 Gets BitmapImage from imageUri. 
 </summary>
</member><member name="P:ImageRotator_VB.SlideShowImage.RedirectLink">
	<summary> 
 Gets/Sets image redirect link when image is clicked. 
 </summary>
</member><member name="P:ImageRotator_VB.SlideShowImage.Order">
	<summary> 
 Gets/Sets order images are to be displayed. 
 </summary>
</member><member name="P:ImageRotator_VB.SlideShowImage.ButtonNumber">
	<summary> 
 Gets/Sets number on image buttons. 
 </summary>
</member><member name="P:ImageRotator_VB.SlideShowImage.DisplayImage">
	<summary> 
 Gets/Sets whether or not image is displayed. 
 </summary>
</member><member name="M:ImageRotator_VB.PictureAlbumLoadedEventArgs.#ctor(System.Boolean)">
	<summary> 
 Argument indicating if Picture album has loaded. 
 </summary>
	<param name="loadCompleted"></param>
</member><member name="P:ImageRotator_VB.PictureAlbumLoadedEventArgs.PictureAlbumLoadedSuccessfully">
	<summary> 
 Indicates if PictureAlbum was loaded successfully from SlideShowImages file. 
 </summary>
</member><member name="M:ImageRotator_VB.PictureAlbum.#ctor">
	<summary> 
 Creates new instance of PictureAlbum. 
 </summary>
</member><member name="M:ImageRotator_VB.PictureAlbum.LoadPictureAlbumXMLFile">
	<summary> 
 Asynchronously gets SlideShowImages.xml file. 
 </summary>
</member><member name="M:ImageRotator_VB.PictureAlbum.XMLFileLoaded(System.Object,System.Net.DownloadStringCompletedEventArgs)">
	<summary> 
 Parses SlideShowImages.xml file and loads contents into slideShowImages collection. 
 Then fires pictureAlbumLoadedEvent. 
 </summary>
	<param name="sender"></param>
	<param name="e"></param>
</member><member name="P:ImageRotator_VB.PictureAlbum.SlideShowImages">
	<summary> 
 Collection of SlideShowImage's obtained loaded from SlideShowImages.xml file. 
 </summary>
</member><member name="P:ImageRotator_VB.PictureAlbum.ImageWidth">
	<summary> 
 Width of images obtained from SlideShowImages.xml file. 
 </summary>
</member><member name="P:ImageRotator_VB.PictureAlbum.ImageHeight">
	<summary> 
 Height of images obtained from SlideShowImages.xml file. 
 </summary>
</member><member name="M:ImageRotator_VB.App.InitializeComponent">
	<summary>
InitializeComponent
</summary>
</member><member name="M:ImageRotator_VB.Page.InitializeComponent">
	<summary>
InitializeComponent
</summary>
</member><member name="M:ImageRotator_VB.App.Application_Startup(System.Object,System.Windows.StartupEventArgs)">
	<summary> 
 If all 11 initParamaters are passed in call the overloaded constructor 
 on Page.xaml.cs otherwise, throw an exception. 
 </summary>
	<param name="sender"></param>
	<param name="e"></param>
</member><member name="M:ImageRotator_VB.Page.#ctor(System.Collections.Generic.IDictionary{System.String,System.String})">
	<summary> 
 Overloaded contstructor that takes in InitParams and stores them into 
 private member variables for later use. 
 </summary>
	<param name="parameters"></param>
</member><member name="M:ImageRotator_VB.Page.LoadPictureAlbum">
	<summary> 
 Sets up event listener for when SlideShowImages.xml file is loaded and 
 then calls method to load that file and populate the picture album. 
 </summary>
</member><member name="M:ImageRotator_VB.Page.PictureAlbumLoaded(System.Object,ImageRotator_VB.PictureAlbumLoadedEventArgs)">
	<summary> 
 Callback method that fires when LoadPictureAlbumXMFFile has completed. 
 It creates first image right away, then asynchronously creates rest 
 of the images. 
 </summary>
	<param name="sender"></param>
	<param name="args"></param>
</member><member name="M:ImageRotator_VB.Page.ProcessSlideShowImage(System.Object)">
	<summary> 
 WaitCallback method asynchronous calls to create image controls. 
 Image that's created must be added to page on dispatcher thread. 
 </summary>
	<param name="imageIndex"></param>
</member><member name="M:ImageRotator_VB.Page.AddNewImage(System.Int32,System.Windows.Visibility)">
	<summary> 
 Creates new Image control and adds it to imageStackPanel's children collection. 
 Once all Image controls are created call methods to setup rest of Silverlight control. 
 </summary>
	<param name="imageIndex"></param>
	<param name="visibility"></param>
</member><member name="M:ImageRotator_VB.Page.SizeUserControlAndDiv">
	<summary> 
 Dynamically sizes the html container div that holds this Silverlight 
 control. 
 </summary>
</member><member name="M:ImageRotator_VB.Page.SetupImageBorder">
	<summary> 
 Sets up Image control's border color and thickness. 
 </summary>
</member><member name="M:ImageRotator_VB.Page.SetupNavication">
	<summary> 
 Helper method to determine what navigational elements 
 need to be setup and displayed. 
 </summary>
</member><member name="M:ImageRotator_VB.Page.SetupAutoPlayTimer">
	<summary> 
 Helper method to determine if auto play should be setup or not. 
 </summary>
</member><member name="M:ImageRotator_VB.Page.NewWindow_Click(System.Object,System.Windows.RoutedEventArgs)">
	<summary> 
 Opens new popup window with uri of the selected imagesToLoadCount 
 redirect link. 
 </summary>
	<param name="sender"></param>
	<param name="e"></param>
</member><member name="M:ImageRotator_VB.Page.CreateNumberedButtons">
	<summary> 
 Creates numbered buttons and wires up required events for interaction. 
 </summary>
</member><member name="M:ImageRotator_VB.Page.SelectedPicture(System.Int32)">
	<summary> 
 Contains change logic for when new image is selected. 
 </summary>
	<param name="index"></param>
</member><member name="M:ImageRotator_VB.Page.NextPictureImage">
	<summary> 
 Contains logic to track next image to be displayed. 
 </summary>
	<returns></returns>
</member><member name="M:ImageRotator_VB.Page.LastPictureImage">
	<summary> 
 Contains logic to track last image displayed. 
 </summary>
	<returns></returns>
</member><member name="M:ImageRotator_VB.Page.FadeOut">
	<summary> 
 Contains logic to faid out current image. 
 </summary>
</member><member name="M:ImageRotator_VB.Page.FadeIn">
	<summary> 
 Contains logic to faid in new image. 
 </summary>
</member><member name="M:ImageRotator_VB.Page.SwitchImage">
	<summary> 
 Contains logic to process image changing. 
 </summary>
</member><member name="M:ImageRotator_VB.Page.StartAutoPlayTimer(System.Object,System.Windows.RoutedEventArgs)">
	<summary> 
 Sets up and starts autoplay timer. 
 </summary>
	<param name="o"></param>
	<param name="sender"></param>
</member><member name="M:ImageRotator_VB.Page.AutoPlayTimerTicked(System.Object,System.EventArgs)">
	<summary> 
 Handles tick event for timer. Selects next picture. 
 </summary>
	<param name="o"></param>
	<param name="sender"></param>
</member><member name="M:ImageRotator_VB.Page.FadeOutStoryboard_Completed(System.Object,System.EventArgs)">
	<summary> 
 Handles storyboard animation completed event. Fades in next image. 
 </summary>
	<param name="sender"></param>
	<param name="e"></param>
</member><member name="M:ImageRotator_VB.Page.Arrow_MouseEnter(System.Object,System.Windows.Input.MouseEventArgs)">
	<summary> 
 Handles arrow buttons mouseenter event. 
 </summary>
	<param name="sender"></param>
	<param name="e"></param>
</member><member name="M:ImageRotator_VB.Page.Arrow_MouseLeave(System.Object,System.Windows.Input.MouseEventArgs)">
	<summary> 
 Handles arrow buttons mouseleave event. 
 </summary>
	<param name="sender"></param>
	<param name="e"></param>
</member><member name="M:ImageRotator_VB.Page.LeftArrow_MouseLeftButtonDown(System.Object,System.Windows.Input.MouseButtonEventArgs)">
	<summary> 
 Handles LeftArrow's MouseLeftButtonDown event. 
 </summary>
	<param name="sender"></param>
	<param name="e"></param>
</member><member name="M:ImageRotator_VB.Page.RightArrow_MouseLeftButtonDown(System.Object,System.Windows.Input.MouseButtonEventArgs)">
	<summary> 
 Handles RightArrow's MouseLeftButtonDown event. 
 </summary>
	<param name="sender"></param>
	<param name="e"></param>
</member><member name="M:ImageRotator_VB.Page.Number_MouseLeave(System.Object,System.Windows.Input.MouseEventArgs)">
	<summary> 
 Handles Number's MouseLeave event. 
 </summary>
	<param name="sender"></param>
	<param name="e"></param>
</member><member name="M:ImageRotator_VB.Page.Number_MouseEnter(System.Object,System.Windows.Input.MouseEventArgs)">
	<summary> 
 Handles Number's MouseEnter event. 
 </summary>
	<param name="sender"></param>
	<param name="e"></param>
</member><member name="M:ImageRotator_VB.Page.Number_MouseLeftButtonDown(System.Object,System.Windows.RoutedEventArgs)">
	<summary> 
 Handles Numbers MouseLeftButtonDown event. 
 </summary>
	<param name="sender"></param>
	<param name="e"></param>
</member><member name="P:ImageRotator_VB.Page.UserControlWidth">
	<summary> 
 Gets Image border adjusted width. 
 </summary>
</member><member name="P:ImageRotator_VB.Page.UserControlHeight">
	<summary> 
 Gets Image border adjusted height. 
 </summary>
</member>
</members>
</doc>

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 Code Project Open License (CPOL)

Share

About the Author

johnsontroye
Software Developer (Senior)
United States United States
I have been Software developer for the past 10 years. Mostly worked in web world in asp.net and c#. Recently began job using wpf and vb.net.
 
Also enjoy reading books on politics and American history, listening to music, and COD on XBox 360.
 
Visit my blog at: www.anothercodesite.com/blog
 
All posts have source code for both C# and VB.

| Advertise | Privacy | Mobile
Web04 | 2.8.140905.1 | Last Updated 23 Feb 2009
Article Copyright 2009 by johnsontroye
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid