资源简介
这个类是C# WPF功能的轮播图,只有一个类,简单。 用的时候 直接实例化,然后将需要轮播的List传进去,是参考网上的一个Demo,但是那个Demo耗内存,我修改了一下
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Threading;
namespace KthSelfDataServiceClient
{
public class ActiveImageAutoScroll : UserControl
{
private static List ScrollImages;
private Image imgAdvertPic = new Image()
{
Stretch = Stretch.Uniform
};
public Grid MainGrid = new Grid()
{
HorizontalAlignment = HorizontalAlignment.Stretch
VerticalAlignment = VerticalAlignment.Stretch
};
public WrapPanel btnPanel = new WrapPanel();
DoubleAnimation doubleAnimation = new DoubleAnimation(); //创建双精度动画对象
public static DependencyProperty advertPicList = DependencyProperty.Register(“advertPicList“
typeof(List) typeof(ActiveImageAutoScroll)
new Propertymetadata(new PropertyChangedCallback(ScrollImagesCreateActive)));
public static DependencyProperty advertPicStayTime = DependencyProperty.Register(“advertPicStayTime“
typeof(List) typeof(ActiveImageAutoScroll)
new Propertymetadata(new PropertyChangedCallback(loadAdvertStayTime)));
public static DependencyProperty isShowPageNumBtn = DependencyProperty.Register(“isShowPageNumBtn“
typeof(bool) typeof(ActiveImageAutoScroll)
new Propertymetadata(new PropertyChangedCallback(showPageNum)));
public List AdvertPicStayTime
{
get { return (List)GetValue(advertPicStayTime); }
set { SetValue(advertPicStayTime value); }
}
public List AdvertPicList
{
get { return (List)GetValue(advertPicList); }
set { SetValue(advertPicList value); }
}
public bool IsShowPageNumBtn
{
get { return (bool)GetValue(isShowPageNumBtn); }
set {
SetValue(isShowPageNumBtn value);
if (!IsShowPageNumBtn)
{
btnPanel.Visibility = Visibility.Collapsed;
}
else
{
btnPanel.Visibility = Visibility.Visible;
}
}
}
private static void ScrollImagesCreateActive(Dependencyobject sender DependencyPropertyChangedEventArgs e)
{
ActiveImageAutoScroll advertPicControl = (ActiveImageAutoScroll)sender;
if (e.Property == advertPicList)
{
advertPicControl.AdvertPicList = (List)e.NewValue;
ScrollImages = advertPicControl.AdvertPicList;
}
}
private static void loadAdvertStayTim
相关资源
- C# TIP文件生成和拆解
- C#解析HL7消息的库135797
- C# OCR数字识别实例,采用TessnetOcr,对
- 考试管理系统 - C#源码
- asp.net C#购物车源代码
- C#实时网络流量监听源码
- C#百度地图源码
- Visual C#.2010从入门到精通配套源程序
- C# 软件版本更新
- C#屏幕软键盘源码,可以自己定制界面
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
评论
共有 条评论