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

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个附件,已经成功下载803次)

最值得关注的外文源代码

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

飞扬的枫  2013年01月24日
谢谢分享,学习了
dnstwjc@sina.com  2012年04月04日
很复杂啊!
nana  2011年12月11日
谢谢分享
盖茨  2011年09月29日
真的很不错
dongfight  2011年04月07日
谢谢分享,学习了
apple96  2011年04月07日
谢谢分享啊!
mj811026  2011年04月07日
学习下,呵呵
aanb122  2010年12月23日
好好学习
中国龙  2010年10月22日
正在学习silverlight,虚心向您学习……
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日
很好啊
字数在300字内
请如实评论
200万国内源码搜索
CopyRight (C) codesoso.com 2007-2009 All Rights Reserved zhihuishi   免责声明