123天津阴部痘痘是什么原因,硬的,是什么that this property

产地:中国 美国 欧盟
最小起订量:1KG
LEXAN 123R PC抗紫外线
产品价格:电议&人民币
所属行业:塑胶原料
发 货 地:东莞
观注次数:9次
发布日期:
公司名称:
联 系 人:杨先生
联系手机:
联系固话:0769-
联系地址:易小姐
常平大京九塑胶城塑通八路841
联系邮箱:
联系我时,请说是在机电之家上看到的,谢谢!
基础创新塑料&
说明书,报价手册及驱动
暂无相关下载&
其他资料下载
暂无相关下载&
◆我司长期现货供应基础创新塑料PC 123R&价格合理,诚信经营,质量保证,可全国供货(珠三角地区可送货上门)免费提供SGS,UL,COA等相关证明,欢迎来电咨询。
◆销售热线:杨先生 易小姐
◆E-mail:◆地址:广东省东莞市常平大京九塑胶城塑通八路841号
Lexan HF1110R:高流动级。易脱模版本的LEXAN HF1110。对于薄壁照明镜片,数据存储组件和安全眼镜镜片。Lexan HF1130: UV稳定。良好的透明性,耐热性,保持性能和尺寸稳定性。Lexan MFR LUX2114 :融指18。改进的阻燃性。内部脱模。 UV稳定。Lexan LUX2114G :融指18。改进的阻燃性。内部脱模。 UV稳定。Lexan MFR LUX2614 :融指7.0。改进的阻燃性。 UV稳定和室外照明。内部脱模。Lexan 2614G:融指7.0。改进的阻燃性。 UV稳定和室外照明。内部脱模。Lexan MHL1110 NA
LEXAN是GE塑料集团的商标,是该集团中pc聚碳酸酯树脂的代表符号。目前该商标已转让给沙伯基础创新塑料sabic lexan
,3米宽PC耐力板已由正成企业制造成功您可能不知道它的名字,但过去50年中一些最伟大的创新都以它为基础。从人类第一次登上月球到笔记本电脑,GE的LEXAN树脂——一种全世界使用广泛的材料,对改善我们的生活起到了重要的作用。 LEXAN树脂几乎参与了每个行业的产品革新。它让我们的汽车更轻盈更安全;它让音乐和影像的数字化成为可能,让人们享受CD和DVD带来的快乐;它领导了电脑、移动电话等成百上千种产品的外形设计潮流。LEXAN树脂还应用于体育和船艇器材、建筑材料、商务及军用飞机、以及户外标牌等各个领域。 LEXAN树脂具有无与伦比的抗冲击性、卓越的尺寸稳定性和水晶般的透明度,一直以来都是聚碳酸酯产品中的佼佼者。它是一种具有优良的机械、光、电和热学特性的无定形工程热塑性材料。 LEXAN树脂的特征和优点 作为一流的热塑性塑料, LEXAN聚碳酸酯树脂是具有高性能特征的特殊化合物,避免了许多传统材料的缺陷。 一.强度 LEXAN树脂最显著的特征之一是高冲击强度。一般而言,没有其它的工程塑料能在极冷和极热的温度下承受得住猛烈撞击。用LEXAN
树脂制成的产品通常防碎,几乎牢不可破。由于LEXAN树脂增加了强度,许多产品壁还可以制得更薄、重量更轻。 二.耐用性 LEXAN树脂不但强度高,还具有下列特性: 抗热(高达100°C) 抗冷(低达零下40°C) 抗水 抗老化 抗紫外线 抗火焰 三.外观 GE塑料的LEXAN树脂使今天杰出产品设计的许多视觉特征成为可能。从几乎无限的颜色和色调,生动的表面质地、水晶般晶莹透明或半透明、金属片、斑点或散布的特殊效果。 四.光学纯度 LEXAN树脂不只表面漂亮,同时具有高纯度、杰出的透明性和一致的质量。LEXAN OQ
树脂被广泛用于满足CD、DVD和光媒体的高标准,改变我们目前欣赏视频、享受音乐和获取信息的方式。其光学特征同样有助于制成更结实、更薄、更轻的眼镜,从而保护我们的工作和游戏方式。 五.电兼容性 因为阻燃剂范围广,可在众多电子产品中发现LEXAN树脂,包括家庭和个人护理用品、仪表和保险盒、开关、插头和插座等。 LEXAN树脂的革新应用历程 GE实验室的丹尼尔.福克斯(Daniel Fox
)博士是LEXAN聚碳酸酯的发明者。1953年,在开发新型电线绝缘材料项目时,经过一系列实验之后,福克斯博士发现了一种粘性物质,它会在烧杯中逐渐变硬。他发现,无论多么努力都无法弄破或毁坏这种材料。于是,LEXAN聚碳酸酯诞生了。自此,这种“顽固”的材料不断革新着我们生活、工作和娱乐的方式。 1962年,美国宇航局开始在宇航员头盔套件和面罩中使用LEXAN树脂。 1968年,GE
开发出用LEXAN树脂制成的平板——LEXAN板材,这种材料可以用于窗户、标志、温室和其它大型应用。 1969,美国宇航员尼尔.阿姆斯特朗(Neil Armstrong )和巴斯.奥尔德林(Buzz Aldrin
)戴着用LEXAN树脂做的“气泡形”头盔登上月球。 1969年,以LEXAN树脂为材料的汽车尾灯和转向灯罩在欧洲的赛车上亮相,带来更轻质、更耐久的出色表现。LEXAN开始在汽车应用领域内崭露头角。 1972年,一种新型成型过程使LEXAN树脂可以制成体积更大的部件。这使生产大型LEXAN树脂成品成为可能。 1978年,第一套由LEXAN树脂制成的前灯系统引导出了目前坚固、多功能、流线形的前灯系统。 1980年,为减轻重量、提高安全性和性能,汽车制造商开始使用LEXAN树脂生产汽车仪表板。塑料的使用增加了设计灵活性,引导出了我们今天所使用的现代化流线型仪表板。 1983年,电脑出现在全球的办公室。越来越多的公司发现他们需要的是能随身携带,便于运输的设备。于是,计算机制造商们转而使用更坚固、耐久、轻巧的LEXAN树脂,用于便携式电脑机壳的制造。 1984年,CD技术问世。GE开发出一系列高纯度聚碳酸酯,不仅能高保真地传递数字声音,而且成本低廉。CD能在此后迅速出现在各个唱片店的货架上,全归功于LEXAN树脂。 1986年,休斯顿出现了LEXAN聚碳酸酯的新用途。LEXAN用于铺设休斯顿公园的道路,使游客有机会在无围栏的自然环境下观看动物。 1988年,当摩托罗拉使用LEXAN树脂开发出第一部轻巧、耐用的便携式电话时,移动电话便发生了巨大的飞跃。 1990年,长期用于工业安全眼镜之后,聚碳酸酯开始用于传统眼镜镜片。LEXAN树脂轻巧、透明、非常耐用。它不仅可以使眼镜安全、轻薄,还使设计者能够有机会创造独特的设计和形状。 1995年,IBM进一步采用薄壁技术,推出了ThinkPad
701C蝴蝶笔记本电脑。IBM的设计师使用LEXAN聚碳酸酯,在行业内生产出了第一款可伸展的标准尺寸键盘。 1996年,用超纯LEXAN聚碳酸酯造出的DVD,音质和画面均保持数码般的逼真。 1998年,通用GE塑料新推出了一系列新的具特殊视觉效果的LEXAN树脂,从而永远改变了日常产品的外观和触感。LEXAN树脂新系列的范围从透明到荧光,使设计者可以创造出全新的外观和产品。 2000年,外形跟随功能。GE为LEXAN产品系列增添了制作CD和DVD的全新方式,不仅性能良好,而且外形美观。“边缘闪亮”技术可以为光盘和瓶子增添明亮色调,各处的设计师对此好评如潮。 2002年,GE推出LEXAN SLX新型薄膜,它具有LEXAN树脂的坚固度,更能抗划伤,并且极其抗老化。这种材料用途多,色彩鲜艳,可替代汽车车体钢板油漆。 /LEXAN板材和薄膜有关介绍: 近日沙伯基础创新塑料宣布,新型实心聚碳酸酯(PC)板材―Lexan ULGOQ将为包括用于汽车窗--潘汉超、摩托车挡风罩和汽车的多层复合窗和成型窗在内的各种汽车和运输应用提供出众的光学品质。 新型Lexan ULGOQ板材在Lexan ULG和Margard产品组合的基础上开发,在Lexan
PC产品系列中具有最佳的光学特性。为了满足最苛刻的应用需求,沙伯基础创新塑料在设计制造流程时充分考虑了光学品质。制造工艺的改进也使随机缺陷显著减少。 带有硬涂层表面的Lexan ULG1003板材被用于世爵C8超级跑车的顶板、座舱盖和后三角窗。 Lexan ULGOQ板材目前已成功应用在荷兰世爵汽车推出的新车型―世爵C8超级跑车的顶板、座舱盖和后三角窗上。集牢不可破和高光学品质于一体的Lexan
ULGOQ板材如水晶般清澈透明,同时兼具轻巧的外观,及波动、失真和光学缺陷最小化等高附加性能特点。 Lexan板材双面专利抗UV+双面耐磨花—MR10 标准颜色:透明 标准厚度:3, 4.5, 6, 9.5, 12.7 mm
标准宽度: mm 标准长度: mm LEXAN薄膜有助于表现出高品质的性能和无限的多样性。它具有以下优点: 1、
适印性:LEXAN? 聚碳酸脂薄膜,适用于丝网印刷或胶印。与溶剂油墨、紫外线固化墨、水性墨和红外线固化墨等都有良好的相容性。 2、 光透性:LEXAN?
薄膜均有很高的透光性(86-92%)和低雾化值。 3、
热稳定性:高热阻性和尺寸稳定性,使得该产品在经历多次加热和干燥周期后,仍能保持较小的尺寸偏差。最高使用温度可达133℃,持续使用温度为 85℃。 4、 可成形性:可真空成形,模切成形、打凸、对模成形、液压成形、热成形等。还适合加工成大深度的三维部件。 5、
多样性:有镜面、纹理、阻燃和表面处理等四大类,以及各种厚度规格,满足客户各种应用。 常用型号:/8A13F/
我司主要销售原料有:PC(聚碳酸脂):台湾南亚系列、德国拜耳系列、日本三菱工程系列基础创新(原GE)系列、日本帝人系列、韩国LG系列PC/ABS合金料:基础创新(原美国GE)系列、德国拜耳系列 台湾奇美系列、日本帝人系列、韩国LG系列
东莞市海钰香塑胶原料有限公司服务承诺:我们一直对自己严格,想客户之所想,如果在销售中有任何问题请告诉我们,一次问题的解决能够让我们更好的服务客户。
关于发货鉴于塑胶原料的特性,一般我们都是发快递 速尔 联昊通(省内件)可快递代收货款 无条件退换货,广东省外,我们一般发德邦物流,批量货物,我们发物流公司,送货上门。
关于查件一般我们发货之后,都会给客户单号,如果可以的话,你可以给我们一个你们的邮箱,我们把单号发到邮箱,或者有在线工具的话!
关于产品因塑胶材料的特性。一般的包装为25KG/袋。部分的包装为20KG/袋。所以我们整包买卖,这样保证每个客户的材料都是原厂原包。如果有散货,我们可以给客户提供样板。关于收货在你购买了材料之后,收到货物,请一定要检查材料的型号是否为你所需要的,材料的包装是否破损。如果有问题请及时联系你的业务员。让他为你解决问题。
售后服务如果你在购买中,有任何的问题请及时联系。一定为你第一时间解决。
Physical Properties
Specific Gravity&
1.245&g/cc
0.04498&lb/in³
Water Absorption&
0.12 %@Time 86400 sec
0.12 %@Time 24.0 hour
Moisture Absorption at Equilibrium&
Linear Mold Shrinkage, Flow&
0.0020&-&0.0040&cm/cm@Thickness 3.20 mm
0.0020&-&0.0040&in/in@Thickness 0.126 in
SABIC Method
Melt Flow&
7.5&g/10 min@Load 1.20 kg,Temperature 300 °C
7.5&g/10 min@Load 2.65 lb,Temperature 572 °F
ASTM D1238
Mechanical Properties
Hardness, Rockwell M&
Hardness, Rockwell R&
Tensile Strength at Break&
Type I, 5 mm/ ASTM D638
Tensile Strength, Yield&
Type I, 5 mm/ ASTM D638
Elongation at Break&
Type I, 5 mm/ ASTM D638
Elongation at Yield&
Type I, 5 mm/ ASTM D638
Flexural Yield Strength&
1.3 mm/min, 50 ASTM D790
Flexural Modulus&
1.3 mm/min, 50 ASTM D790
Izod Impact, Notched&
1.99&ft-lb/in
Izod Impact, Unnotched&
21.36&J/cm
40.02&ft-lb/in
ASTM D4812
Tensile Impact Strength&
157&kJ/m²
74.7&ft-lb/in²
Type S; ASTM D1822
Dart Drop, Total Energy&
74.5&ft-lb
ASTM D3029
Taber Abrasion, mg/1000 Cycles&
CS-17, 1 ASTM D1044
Electrical Properties
Volume Resistivity&
&=&1.00e+17&ohm-cm
&=&1.00e+17&ohm-cm
Dielectric Constant&&
3.05@Frequency 1.00e+6 Hz
3.05@Frequency 1.00e+6 Hz
3.1@Frequency 50.0 - 60.0 Hz
3.1@Frequency 50.0 - 60.0 Hz
Dielectric Strength&
17.7&kV/mm@Thickness 3.20 mm
450&kV/in@Thickness 0.126 in
Dissipation Factor&
0.00080@Frequency 50.0 - 60.0 Hz
0.00080@Frequency 50.0 - 60.0 Hz
0.0075@Frequency 1.00e+6 Hz
0.0075@Frequency 1.00e+6 Hz
Arc Resistance&
0.00&-&60&sec
0.00&-&60&sec
T ASTM D495
Comparative Tracking Index&
175&-&250&V
175&-&250&V
Hot Wire Ignition, HWI&
60&-&120&sec
60&-&120&sec
High Amp Arc Ignition, HAI&
0.00&-&15&arcs
0.00&-&15&arcs
High Voltage Arc-Tracking Rate, HVTR&
&=&150&mm/min
&=&5.91&in/min
Thermal Properties
CTE, linear, Parallel to Flow&
32.4&&m/m-°C@Temperature -40.0 - 95.0 °C
18.0&&in/in-°F@Temperature -40.0 - 203 °F
ASTM E 831
Specific Heat Capacity&
1.21&J/g-°C
0.289&BTU/lb-°F
Thermal Conductivity&
0.200&W/m-K
1.39&BTU-in/hr-ft²-°F
Deflection Temperature at 0.46 MPa (66 psi)&
146&°C@Thickness 6.40 mm
295&°F@Thickness 0.252 in
Deflection Temperature at 1.8 MPa (264 psi)&
142&°C@Thickness 6.40 mm
288&°F@Thickness 0.252 in
Vicat Softening Point&
Rate B/50; ASTM D1525
UL RTI, Electrical&
UL RTI, Mechanical with Impact&
UL RTI, Mechanical without Impact&
Flammability, UL94&&
V-0@Thickness 1.52 mm
V-0@Thickness 0.0598 in
5VA@Thickness 3.04 mm
5VA@Thickness 0.120 in
Oxygen Index&
ASTM D2863
DeSCRJPTive Properties
Radiant Panel Listing
Specific Volume
UV-light, water exposure/immersion
Some of the values displayed above may have been converted from their original units and/or rounded in order to display the information in a consistent format. Users requiring more precise data for scientific or engineering calculations can click on the property value to see the original value as well as raw conversions to equivalent units. We advise that you only use the original value or one of its raw conversions in your calculations to minimize rounding error. We also ask that you refer to MatWeb's&terms of use&regarding this information.&Click here&to view all the property values for this datasheet as they were originally entered into MatWeb. Users viewing this material also viewed the following:SABIC Innovative Plastics Lexan& 500 PCSABIC Innovative Plastics Lexan& 500R PC (Asia Pacific)PTS POM-25 Acetal CopolymerLanxess Durethan& AKV 30 G HR DUS023 900116 Nylon 66, 30% Glass FiberQuadrant EPP Nylatron& GS PA66, MoS2 filled, extruded (ASTM Product Data Sheet)
诚信会员&第2&年
会员级别:
会员级别:认证类型:企业认证企业证件:已通过企业认证 认证公司:东莞市海钰香塑胶原料有限公司
价格:电议人民币
东莞市海钰香塑胶原料有限公司
价格:电议人民币
东莞市海钰香塑胶原料有限公司
价格:电议人民币
东莞市海钰香塑胶原料有限公司
价格:电议人民币
东莞市海钰香塑胶原料有限公司
价格:电议人民币
东莞市海钰香塑胶原料有限公司
价格:电议人民币
东莞市海钰香塑胶原料有限公司
您是不是在找WPF编程技术(50)
原文地址:
Introduction
I was recently working on a WPF project, and it was all about data editing and synchronization. Data was hierarchically organized, and
I had to provide a lot of different views on isolated and merged data sources based on a variety of external factors.
First of all: I 'love' data binding in WPF — it just makes a lot of things so easy! So in order to display nested data on a
TreeView control, I started with a hierarchical data template. However — I soon reached limits that proved hard to get around. While data binding had served me very well so far, I just needed more control from code when it came to that tree. Furthermore,
I faced a few other issues when the tree's data source was refreshed or replaced, which caused nasty side effects with TwoWay data binding.
Bottom line was that the purely data-driven UI didn't quite work in my case — I needed an alternative. The result was a composite control I built around
TreeView. This solution took care of my issues (at least the tree-related ones while I could still rely on the basic functionality of
TreeView without having to reinvent the wheel. The result was simple yet effective, so I decided to extend it a little in order to get a generic control which I could reuse and share with the community. Which is why I have to write that darn article
Here's the most important features at a glance:
You can tweak the tree for maximum performance, minimum memory footprint, or even a fully virtualized solution that gets data on demand and keeps it cached until you decide to remove it explicitly.
The tree provides simple and type-safe access to the underlying data (no properties of type
object here). And as opposite to the standard TreeView, the
SelectedItem property is not read-only. Simple styling and sorting. Internally, there is a clear distinction between UI (tree nodes) and bound items. This resolves reloading and focus issues with the control. You can get a tree node (UI) by a bound item (data) and vice versa, or recursively iterate through all your tree
nodes. Various extension points — a lot of code is virtual and can be overridden in order to control the behavior of the tree — down to the creation of single
TreeViewItem instances. Simplified context menu handling. The tree layout (expanded/selected nodes) can be saved and reapplied.
Pretty much everything I am going to write here is illustrated in the sample application that comes with the download. If you're already tired of reading, you might just download the sample, play around, and come back later if you need more information.
Regarding terms: Actually, this is the &hardcodet.net WPF TreeView Control,& as I published the initial version on my
. However, I won't write that all over the place because that just sounds horribly narcistic, and it doesn't really make sense here at CP anyway. As I'll refer to WPF's built-in
TreeView control a lot, I'll call it V-Tree throughout this article (which is completely random, btw).
Extending TreeViewBase&T&
All the features of V-Tree are being provided by the abstract TreeViewBase&T& class. That's abstract like in: You will have to write some code (gasp!) in order to getting started. However, chances are high that you'll stay below 10 lines of
code, as the base class just needs to know three things:
How to generate a unique identifier for a given tree node: GetItemKey
How to get a bound item's childs, if there are any available: GetChildItems
How to get a bound item's parent, if there is one: GetParentItem
There are quite a few virtual methods you can override in order to control the tree's behavior, but these three abstract methods may well be everything you'll ever need. Below is the implementation of the sample project's
CategoryTree control, which operates upon ShopCategory objects. As you can see,
CategoryTree manages with 3 lines of code:
Collapse |
public class CategoryTree : TreeViewBase&ShopCategory&
public override string GetItemKey(ShopCategory item)
return item.CategoryN
public override ICollection&ShopCategory& GetChildItems(ShopCategory parent)
return parent.SubC
public override ShopCategory GetParentItem(ShopCategory item)
return item.ParentC
Hint: Make sure your tree control class is public. Otherwise, Intellisense in Visual Studio might not work properly.
What if I want to bind items of various types to the tree?
If you want to bind heterogeneous data to the tree, chances are high that your bound items do have something in common, and having them implement a common interface or derive from a custom base class might be a good design decision anyway. However, nobody
keeps you from implementing a tree control that works on items of type object which allows you to throw pretty much everything at it. It just wouldn't be that convenient anymore:
Collapse |
public class MyObjectTree : TreeViewBase&object&
public override string GetItemKey(object item)
if (item is ShopCategory)
return ((ShopCategory) item).CategoryN
else if (item is Vendor)
return ((Vendor)item).VendorId;
public override ICollection&object& GetChildItems(object parent)
public override object GetParentItem(object item)
All code samples I am going to use refer to the sample implementation of the abstract
TreeViewBase control, the CategoryTree class. As you can see in the diagram below, the tree's
Items collection is bound to an ObservableCollection of type
ShopCategory. When it comes to rendering the bound data on the UI,
TreeViewBase uses a regular TreeView control, and creates a
TreeViewItem instance for every bound ShopCategory:
This section covers the features of the control. As a reference, below is a sample declaration of the tree. Note that some of the properties below are redundant (e.g.
IsLazyLoading, which is true by default).
Collapse |
&local:CategoryTree x:Name=&MyTree&
Items=&{Binding Source={StaticResource Shop}, Path=Categories}&
IsLazyLoading=&True&
ObserveChildItems=&True&
ClearCollapsedNodes=&True&
AutoCollapse=&True&
RootNode=&{StaticResource CustomRootNode}&
NodeContextMenu=&{StaticResource CategoryMenu}&
TreeNodeStyle=&{StaticResource SimpleFolders}&
TreeStyle=&{StaticResource SimpleTreeStyle}&
NodeSortDescriptions=&{StaticResource AscendingNames}&
PreserveLayoutOnRefresh=&True&
SelectedItem=&{Binding ElementName=Foo,
Path=Bar, Mode=TwoWay}&
SelectedItemChanged=&OnSelectedItemChanged&
In order to display any data, the tree's Items dependency property needs to be set.
Items takes an IEnumerable&T&, where T is the type of items your V-Tree implementation handles. In the sample, these are
ShopCategory objects. You can set this property in code or XAML:
Collapse |
&local:CategoryTree x:Name=&MyTree&
Items=&{Binding Source={StaticResource Shop}, Path=Categories}&
Items provides the tree with the root items to get started with. The sample application binds to a collection that contains 3
ShopCategory objects:
Books Movies Music
What happens now, is this:
For every of the three ShopCategory items, the tree creates a corresponding
TreeViewItem instance which is assigned to the internal TreeView control.
If one of the tree's nodes is being expanded (Books in the screenshot below), the control determines the child categories by invoking
GetChildItems, and renders child nodes for every item that is being returned. In the screenshot below, that's the categories Fiction, Politics, and Travel.
It doesn't look too sexy yet, but it's clearly a tree:
Selecting items was a bit cumbersome with the legacy TreeView control, as the
SelectedItem property is read-only. However, the V-Tree makes this very easy, as it provides a strongly-typed
SelectedItem property that can be set externally:
Collapse |
public virtual T SelectedItem
get { return (T) GetValue(SelectedItemProperty); }
set { SetValue(SelectedItemProperty, value); }
Next to the SelectedItem property, there's a SelectedItemChanged routed event which is being invoked as soon as the selected item changes. The
RoutedTreeItemEventArgs provides both the tree's current and the previously selected items. Again, this event makes use of the class' strong typing:
Collapse |
public void Test()
CategoryTree tree = new CategoryTree();
tree.SelectedItemChanged += Tree_SelectedItemC
private void Tree_SelectedItemChanged(object sender, RoutedTreeItemEventArgs&shopcategory /& e)
ShopCategory newCategory = e.NewI
ShopCategory oldCategory = e.OldI
Multiple Selections
Just like the built-in TreeView control, V-Tree doesn't support multiple selections.
Imagine you'd want to display hierarchical data in two different scenarios:
Data is locally available, access is very fast. A fully expanded tree contains thousands of nodes.
Data is being retrieved from an external web service — a request may take quite some time but there's not too much data.
These scenarios require fundamentally different concepts when it comes to managing tree nodes. In the first scenario, it would be desirable to start with an empty tree, and create tree nodes on demand (lazy loading): As soon as a node is being expanded.
If a tree node is being collapsed, all child nodes should be disposed and recreated again if the user re-expands the node.
While lazy loading might be an option for the second scenario as well, disposing data is nothing you would want to do if — refetching the data would be far too expensive. Data that was retrieved from the web service should be cached locally in order to prevent
repeated requests for the same data over and over again.
The control provides two dependency properties to support both scenarios:
IsLazyLoading: This property defaults to true and tells the tree not to create tree nodes until a node is being expanded. If this property is set to
false, the whole tree is being created at once. ClearCollapsedNodes: This property defaults to true as well, and instructs the control to discard nodes as soon as their parent is being collapsed. This keeps the memory footprint at a minimum, but results in
GetChildItems being re-invoked if the parent node is expanded again. This property has no effect if
IsLazyLoading is false (because this creates the whole tree at once).
Attention: Even if IsLazyLoading is true, the
GetChildItems method you implemented is being invoked for every visible node by default, even if it's not yet expanded. This is because of the default implementation of the tree's
HasChildItems method, which is invoked in order to determine whether a tree node should be rendered with or without an expander.
Collapse |
protected virtual bool HasChildItems(T parent)
return GetChildItems(parent).Count & 0;
However, this only applies for the visible nodes, and does not cause the tree to traverse the whole hierarchy. However, if
GetChildItems is really expensive, you should override it. Even just returning true in every case is an option — check the documentation of the method for further details.
AutoCollapse Dependency Property
This boolean dependency property might come in handy if you want the tree to always display the minimum amount of nodes possible. If set to true, the tree collapses all nodes that do not need to be expanded in order to display the currently selected item.
Check the sample application in order to see the feature.
The sample application allows you to set these properties independently and shows the number of tree nodes that are currently in memory at the bottom of the tree control. Below is the same tree twice after a full expansion/collapse cyle: in the first screenshot,
ClearCollapsedNodes was set to false, the second screenshot shows the tree with the property set to
true. You can imagine that with a huge tree, this makes quite a difference:
Child Collection Monitoring
Per default, the tree tries to monitor the child collections of all existing tree nodes for changes, even if they are being collapsed. This ensures that the UI always reflects the correct state (e.g. by removing the expander of a collapsed tree node if all
its child nodes are being deleted).
Important: Your implementation of GetChildItems must return a collection that implements the
INotifyCollectionChanged interface for this to work, e.g. an ObservableCollection&T&. If you return another collection (e.g. a simple list) and
ObserveChildItems is true, no exception will be thrown, but a warning will be written to the debug console.
You can explicitly disable collection monitoring by setting the tree's ObserveChildItems dependency property to
Explicitly Refreshing the Tree
If the tree can't or shouldn't update itself, you can invoke one of the V-Tree's
Refresh methods. This causes the control to completely recreate the underlying tree while optionally preserving its layout (expanded / selected nodes). As a nice side effect, you can also use this feature to apply an arbitrary layout to a tree:
Collapse |
private void CopyTreeLayout(object sender, RoutedEventArgs e)
TreeLayout layout = CategoryTree.GetTreeLayout();
SynchronizedTree.Refresh(layout);
V-Tree provides styling point on 3 levels: Bound items, Tree nodes, and the tree itself.
Data Templates
This is the classic WPF way: Rather than styling an UI element (TreeViewItem), you define a DataTemplate for the bound item that is represented by the tree node (in the sample:
ShopCategory instances). Just make sure the data template is within the scope of your tree (e.g. declared as a resource of the containing Window) and you're all set. This technique is applied to style the right-hand tree of the sample application:
Collapse |
&Window.Resources&
A data template for bound ShopCategory items:
Shows a static folder image and the category name
&DataTemplate DataType=&{x:Type shop:ShopCategory}&&
&StackPanel Orientation=&Horizontal&&
&Image Source=&/Images/WinFolder.gif& /&
&TextBlock Text=&{Binding Path=CategoryName}&
Margin=&2,0,0,0& /&
&/StackPanel&
&/DataTemplate&
&/Window.Resources&
Node Styles
You can explicitly assign a style to all your tree nodes by setting the tree's
TreeNodeStyle dependency property. This style will be assigned to every tree node that represents one of your bound item's. Tree nodes are elements of type
TreeViewItem, so this is the target type of your style. This technique is applied to style the left-hand tree of the sample application:
Collapse |
&local:CategoryTree TreeNodeStyle=&{StaticResource SimpleFolders}& /&
&Style x:Key=&SimpleFolders&
TargetType=&{x:Type TreeViewItem}&&
&Style.Resources&
&!-- override default brushes that show ugly background colors --&
&Brush x:Key=&{x:Static SystemColors.HighlightBrushKey}&&Transparent&/Brush&
&Brush x:Key=&{x:Static SystemColors.ControlBrushKey}&&Transparent&/Brush&
&/Style.Resources&
&Setter Property=&HeaderTemplate&
Value=&{StaticResource CategoryTemplate}& /&
Note that the style above still uses a data template by setting the HeaderTemplate of the
TreeViewItem: The separation between UI and data is still valid, but you have full control over both data representation 'and' your tree node.
Btw: If you want to customize some of your nodes completely differently than others, and doing it in XAML is not an option, you can override the
ApplyStyle method and style your nodes individually. This method is always invoked, even if the
TreeNodeStyle property is null:
protected override void ApplyNodeStyle(TreeViewItem treeNode, ShopCategory item)
if (IsCheckableCategory(item))
ApplyCheckBoxStyle(treeNode);
base(ApplyNodeStyle(treeNode, item);
Tree Style
Internally, the V-TreeView operates on a default TreeView control that handles most of the work (no reason to reinvent the wheel here). You can inject your own
TreeView instance through the Tree dependency property, but you'll probably just leave it to the control to create a default instance for you. Still, you might want to style the tree, which you can do by setting the V-Tree's
TreeStyle dependency property. It takes a style that targets TreeView:
&local:CategoryTree TreeStyle=&{StaticResource SimpleTreeStyle}& /&
&!-- set the tree's background and border properties --&
&Style x:Key=&SimpleTreeStyle& TargetType=&{x:Type TreeView}&&
&Setter Property=&Background& Value=&#AAA& /&
&Setter Property=&BorderThickness& Value=&4& /&
&Setter Property=&BorderBrush& Value=&#FFA6AAAB& /&
You can sort your data easily by setting an IEnumerable&SortDescription& to V-Tree's
NodeSortDescriptions dependency property. The default value of the property is
null, which causes the tree to render items in the order they were received.
&local:CategoryTree NodeSortDescriptions=&{StaticResource AscendingNames}& /&
The sample application allows you to toggle between two collections which are both declared in XAML. Both sort the tree's
ShopCategory items by their CategoryName property in either ascending or descending order. Note that the
PropertyName attributes of the declared SortDescriptions contain a Header prefix. This is because sorting happens on the UI layer (TreeViewItem instances), not the underlying items. In order to get to the bound
ShopCategory instances, you need to get over the nodes' Header properties:
&cm:SortDescriptionCollection x:Key=&AscendingNames&&
&cm:SortDescription PropertyName=&Header.CategoryName&
Direction=&Ascending& /&
&/cm:SortDescriptionCollection&
&cm:SortDescriptionCollection x:Key=&DescendingNames&&
&cm:SortDescription PropertyName=&Header.CategoryName&
Direction=&Descending& /&
&/cm:SortDescriptionCollection&
As with styles, there is a virtual method you can override to customize sorting of specific nodes. The example below would skip sorting of the bound root items:
protected override void ApplySorting(TreeViewItem node, ShopCategory item)
if (item.ParentCategory != null)
base.ApplySorting(node, item);
The tree provides a RootNode dependency property (defaults to
null) which takes an arbitrary TreeViewItem. You can set this property if you don't want your items to be rendered directly under the tree but a root node that provides some information. Note that this root node does not represent a bound
item, and it's not affected by the TreeNodeStyle or NodeContextMenu dependency properties. The screenshot below shows the sample tree with and without a root node:
&TreeViewItem x:Key=&CustomRootNode&&
&TreeViewItem.Header&
&/TreeViewItem.Header&
&/TreeViewItem&
&local:CategoryTree Items=&{Binding Source={StaticResource Shop}, Path=Categories}&
RootNode=&{StaticResource CustomRootNode}& /&
If you want to display a specific context menu on all your nodes, you can set the tree's
NodeContextMenu dependency property. This causes the tree to display the menu as soon as one of the tree's nodes is being right-clicked.
&local:CategoryTree NodeContextMenu=&{StaticResource CategoryMenu}& /&
You'll probably use WPF's command system to trigger menu click events. The sample application provides a context menu that allows the user to add new categories or delete existing ones, if they aren't root categories. For the sample, I used the built-in
application commands New and Delete.
(In case you're new to WPF commands, here's a good introduction: )
&Window.Resources&
&!-- the context menu for the tree --&
&ContextMenu x:Key=&CategoryMenu&&
&MenuItem Header=&Add Subcategory&
Command=&New&&
&MenuItem.Icon&
&Image Source=&/Images/Add.png& /&
&/MenuItem.Icon&
&/MenuItem&
&MenuItem Header=&Remove Category&
Command=&Delete&&
&MenuItem.Icon&
&Image Source=&/Images/Remove.png& /&
&/MenuItem.Icon&
&/MenuItem&
&/ContextMenu&
&/Window.Resources&
In order to handle commands, MainWindow.xaml (not the tree control!) declares event handlers for both commands:
&mandBindings&
&!-- bindings for context menu commands --&
&CommandBinding Command=&New&
Executed=&AddCategory& /&
&CommandBinding Command=&Delete&
CanExecute=&EvaluateCanDelete&
Executed=&DeleteCategory& /&
&/mandBindings&
And here's the code. The important thing here is GetCommandItem(), which has to take into account that there are two possibilities:
The command has been triggered by a clicked menu item of the context menu. However, the right-clicked tree node might not be the one that is currently selected on the tree, so just taking V-Tree's SelectedItem could be wrong. However, if a menu item was
clicked, the menu's IsVisible property is true, and V-Tree assigned the clicked node to the menu's
PlacementTarget property. The command has been triggered through a shortcut (e.g. by clicking the Delete k key). In this case, the context menu has not been involved at all. The menu's
IsVisible property is false, but we can be sure that the command refers to the tree's currently selected item.
/// Determines the item that is the source of a given command.
private ShopCategory GetCommandItem()
ContextMenu menu = CategoryTree.NodeContextM
if (menu.IsVisible)
TreeViewItem treeNode = (TreeViewItem) menu.PlacementT
return (ShopCategory) treeNode.H
return CategoryTree.SelectedI
private void AddCategory(object sender, ExecutedRoutedEventArgs e)
ShopCategory parent = GetCommandItem();
e.Handled = true;
private void EvaluateCanDelete(object sender, CanExecuteRoutedEventArgs e)
ShopCategory item = GetCommandItem();
e.CanExecute = item.ParentCategory != null;
e.Handled = true;
private void DeleteCategory(object sender, ExecutedRoutedEventArgs e)
ShopCategory item = GetCommandItem();
item.ParentCategory.SubCategories.Remove(item);
e.Handled = true;
Selecting Items before Displaying a Context Menu
If you want the tree to automatically select nodes that are being right-clicked, you can set the
SelectNodesOnRightClick dependency property to true. In this case, you never have to evaluate
ContextMenu.PlacementTarget as the clicked item is selected in every case.
This is the first control I've written for WPF, and I'm sure that there will be a few bugs to squash as well as a few nice improvements, both hopefully based on your critical feedback (after all, it's all about learning). So check back for updates and keep
the suggestions coming
Future releases of the control will be available here at CodeProject, and I'll also post about them on my
. If you want to get automatically notified of relevant updates, you can subscribe to a specific newsletter here:
. Just register, then select the control from the list of available newsletters.
I hope you'll find that the control makes a useful addition to your toolbox - have fun!
1.0.5 Initial public release ()
1.0.6 Added designer attributes to properties and events, fixed a few article issues. Switched to
This article, along with any associated source code and files, is licensed under
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:596099次
积分:8159
积分:8159
排名:第1634名
原创:183篇
转载:290篇
评论:160条
(3)(1)(2)(2)(2)(2)(4)(1)(9)(1)(1)(11)(47)(45)(5)(14)(15)(15)(8)(8)(11)(30)(10)(23)(40)(3)(2)(15)(2)(2)(16)(38)(15)(21)(33)(7)(5)(4)(2)(4)(1)(1)(2)(3)}

我要回帖

更多关于 阴部长了一个包痘痘 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信