FishEye for Silverlight
FisshEye for Silverlight 是 Expression 社区中的一个示例(http://gallery.expression.microsoft.com/FishEye)。原来的代码中实现的 Panel 的子元素只能横向排列,我在原来的代码的基础上添加了一个 Orientation 属性,实现像 StackPanel 的效果可以横向或纵向排列子元素。
默认为横向排列方式
<fish:FishEyePanel Margin="0,50,0,0" Magnification="3" ScaleToFit="False" Height="50" VerticalAlignment="Top"> <Button Height="50"> <Image Source="images/Alarm.png" Stretch="Fill"/> </Button> <Button Height="50"> <Image Source="images/Anouncement.png" Stretch="Fill"/> </Button> <Button Height="50"> <Image Source="images/Config-Tools.png" Stretch="Fill" /> </Button> <Button Height="50"> <Image Source="images/Paste.png" Stretch="Fill"/> </Button> <Button Height="50"> <Image Source="images/Under-construction.png" Stretch="Fill"/> </Button> <Button Height="50"> <Image Source="images/Vista-Shield.png" Stretch="Fill"/> </Button> </fish:FishEyePanel>
纵向排列方式
<fish:FishEyePanel
Orientation="Vertical"
Magnification="3" ScaleToFit="False" Width="50"> <Button Width="50"> <Image Source="images/Alarm.png" Stretch="Fill"/> </Button> <Button Width="50"> <Image Source="images/Anouncement.png" Stretch="Fill"/> </Button> <Button Width="50"> <Image Source="images/Config-Tools.png" Stretch="Fill" /> </Button> <Button Width="50"> <Image Source="images/Paste.png" Stretch="Fill"/> </Button> <Button Width="50"> <Image Source="images/Under-construction.png" Stretch="Fill"/> </Button> <Button Width="50"> <Image Source="images/Vista-Shield.png" Stretch="Fill"/> </Button> </fish:FishEyePanel>
源代码下载
为了你的幸福,我一直在努力!