SilverlightCarrousel实现界面布局

Silverlight开发工具的出现为我们带来了全新的编程环境。那么,在使用这一工具进行开发的前提就是要良好的掌握各种内置控件的使用。比如我们今天要为大家介绍的Silverlight Carrousel是一个布局控件,可对其内部的子控件排出像《旋转木马》一样的效果。#t#

通城网站制作公司哪家好,找创新互联!从网页设计、网站建设、微信开发、APP开发、成都响应式网站建设公司等网站项目制作,到程序开发,运营维护。创新互联从2013年创立到现在10年的时间,我们拥有了丰富的建站经验和运维经验,来保证我们的工作的顺利进行。专注于网站建设就选创新互联

Silverlight Carrousel使用:

在这里下载DLL文件,其中包含一个文件:CarrouselPanel.dll。下载了文件后在Silverlight项目中添加引用。
在page.xaml的头部添加代码

  1. xmlns:CarrouselPanel="
    clr-namespace:Carrousel
    Panel;assembly=CarrouselPanel"
      

把ScatterView控件放入page中

 
 
 
  1. < CarrouselPanel:CarrouselPanel 
    x:Name="xCarrouselPanel" Height=
    "Auto" HorizontalAlignment=
    "Stretch" VerticalAlignment=
    "Stretch" Width="Auto"/> 

在后台添加子控件

 
 
 
  1. for (int i = 1; i < = 21; i++)  
  2. {  
  3. StreamResourceInfo sri = 
    Application.GetResourceStream
    (new Uri("Carrousel;component/
    img/" + i + ".jpg", UriKind.
    Relative));  
  4. BitmapImage bi = new BitmapImage();  
  5. bi.SetSource(sri.Stream);  
  6. Image img = new Image();  
  7. img.Source = bi;  
  8. img.Width = 120;  
  9. img.Height = 200;  
  10. this.xCarrouselPanel.AddChild(img);  
  11. }  

Silverlight Carrousel的相关应用方法就为大家介绍到这里。


分享题目:SilverlightCarrousel实现界面布局
URL标题:http://csdahua.cn/article/codeijj.html
扫二维码与项目经理沟通

我们在微信上24小时期待你的声音

解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流