当前注册人数155278人 邮箱: 密码: 注册新用户 忘记密码
首页 C/C++/MFC C# ASP.NET VB.NET MATLAB   站内搜索 BBS讨论社区 下载代码说明/积分规则
为什么要注册?

1. 可以直接免费从本站下载代码,防止邮件发送不到您的邮箱,或登录不了国外网站

2. 可以设定关键字,当有您关心的代码收录时,邮件通知您

3. 对这里的代码进行评分和评论

4. 可以和大家一起分享你的源代码,得到更多的建议

A simple treeview in Silverlight 2.0

Silverlight 2.0中简单的TreeView树控件示例源代码

2008年05月06日
C#
这个文章和示例程序的目的是展示如何在SilverLight中创建一个模板树控件。该控件继承与Control和ContentControl类,并展示了INotifyCollectionChanged来管理Item的能力。
 
相关知识
private void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
{
    switch (e.Action)
    {
        case NotifyCollectionChangedAction.Add:
            // ...
            this.UpdateContainerForItem(e.NewStartingIndex);
            return;
        case NotifyCollectionChangedAction.Remove:
            //...
            this.ClearContainerForItemOverride(elements[e.OldStartingIndex], e.OldItems[0] as UIElement);
            return;
        case NotifyCollectionChangedAction.Replace:
            //...
                this.ClearContainerForItemOverride(elements[e.NewStartingIndex], e.OldItems[0] as UIElement);
                elements.RemoveAt(e.NewStartingIndex);
                this.UpdateContainerForItem(e.NewStartingIndex);
            return;
        case NotifyCollectionChangedAction.Reset:
            this.ClearVisualChildren(this.GetItems());
             break;
        default:
            return;
    }
}
源代码原文下载:
A simple treeview in Silverlight 2.0 Creating a templatable treeview in silverlight

源码图片

从本站下载附件及源代码(1个附件,已经成功下载439次)

最值得关注的外文源代码

CheckBox ComboBox Extending the ComboBox Class and Its Items
Customizable Tree Control with Animation Support
Custom TreeView for standard SQL data.
Tri-State TreeView control for .NET 1.1
评论(评论是增加积分的一个有效途径)
字数在300字内
请如实评论
本源代码共评论43次,此处显示最近20次评论! 查看所有评论

hclzwh2010  2010年05月05日
学习下
hclzwh2010  2010年05月05日
学习下
小马哥  2010年01月26日
好好学习天天向上
zhangborr  2009年09月28日
haobu hao ya
我心依然  2009年09月26日
还可以啊。。
shqyun  2009年06月12日
正需要这个
龙云  2009年05月22日
不错的,学习了~~~~
盖茨  2009年05月13日
下了,挺好的
bingyun84  2009年05月07日
下了,挺好的
蓝色风车—呼呼  2009年04月13日
学习下
星星下  2009年04月02日
很好啊
星星下  2009年04月02日
good
renkairock  2009年03月26日
很好xiexie
huyouan  2009年03月22日
学习
forestsulin111  2009年03月10日
hao
kitty  2009年02月12日
好东西。。
aking  2009年01月07日
想找一个从数据库中添加到treeview的方法,不知道这个怎么样?
blueair-01  2008年11月03日
想找一个从数据库中添加到treeview的方法,不知道这个怎么样?
鞠鹏飞  2008年10月22日
下了
鞠鹏飞  2008年10月22日
下了
字数在300字内
请如实评论
CopyRight (C) codesoso.com 2007-2009 All Rights Reserved   免责声明
京ICP备08011023号