效果圖:
因為silverlight的xml讀取政策等其它原因,沒辦法直接在部落格中貼出來,下面是線上示例位址:
<a href="http://images.24city.com/jimmy/projection/default.htm" target="_blank">http://images.24city.com/jimmy/projection/default.htm</a>
思路:
1.将每個圖檔以及下面的标題文字,封裝成控件
1

<UserControl x:Class="ControlTest.model.ImgItem"
2

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4

xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5

xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6

mc:Ignorable="d" >
7

8

<UserControl.Resources>
9

<Storyboard x:Name="sbShow">
10

<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="img" Storyboard.TargetProperty="(UIElement.Opacity)">
11

<EasingDoubleKeyFrame KeyTime="00:00:00" Value="0.0"/>
12

<EasingDoubleKeyFrame KeyTime="00:00:01" Value="1.0"/>
13

</DoubleAnimationUsingKeyFrames>
14

</Storyboard>
15

</UserControl.Resources>
16

17

<StackPanel Orientation="Vertical">
18

<Image x:Name="img" Width="300" Cursor="Hand" Grid.Row="0">
19

<Image.Projection>
20

<PlaneProjection RotationY="60" RotationZ="4" x:Name="pp"></PlaneProjection>
21

</Image.Projection>
22

</Image>
23

24

<TextBlock x:Name="txtTitle" Text="Image's Title" TextAlignment="Center" TextWrapping="Wrap" Grid.Row="0" Visibility="Collapsed" HorizontalAlignment="Center" Margin="0,5,0,0">
25

</TextBlock>
26

</StackPanel>
27

28

</UserControl>
2.動态加載xml資料源,xml配置如下:

<?xml version="1.0" encoding="utf-8" ?>

<data>

<item src="img/001.jpg" title="第一張圖檔(點選将跳轉到百度)" link="http://www.baidu.com/" />

<item src="img/002.jpg" title="第二張圖檔" link="img/002.jpg" />

<item src="img/003.jpg" title="第三張圖檔(點選将跳轉到我的部落格)" link="http://yjmyzz.cnblogs.com/" />

<item src="img/004.jpg" title="第四張圖檔" link="img/004.jpg" />

<item src="img/005.jpg" title="第五張圖檔" link="img/005.jpg" />

<item src="img/006.jpg" title="第六張圖檔" link="img/006.jpg" />

<item src="img/007.jpg" title="第七張圖檔" link="img/007.jpg" />

<item src="img/008.jpg" title="第八張圖檔" link="img/008.jpg" />

<item src="img/009.jpg" title="第九張圖檔" link="img/009.jpg" />

<config canvasleft="150" smallImgTop="100" smallImgWidth="240" bigImgTop="10" bigImgWidth="500" itemSpace="80" midIndex="4" adjustWidth="70"/>

</data>

3.動态生成1中封裝的控件,然後動态加載到主界面中的Canvas 中
詳情見源代碼
仍有很多改進之外,比如圖檔太多時,橫向可考慮用左右箭頭移動,而且現在這種直接漸變出大圖的效果也很粗糙,如果有朋友抽空改進了,記得通知我一起分享(目前國内的silverlight研究氛圍太淡,需要更多人的關注...)