i have code:
.xaml:
<datatrigger binding="{binding path=typeitem}" value="{x:static local:clistboxitem+etypeitem.file}"> ... </datatrigger>
.cs:
public clistboxitem(etypeitem _type) { this.typeitem = _type; initializecomponent(); } ... public enum etypeitem { file, directory } ... public static readonly dependencyproperty typeitemproperty = dependencyproperty.register("typeitem", typeof(etypeitem), typeof(clistboxitem), new propertymetadata(etypeitem.directory)); public etypeitem typeitem { { return (etypeitem) getvalue(typeitemproperty); } set { setvalue(typeitemproperty, value); } }
when run app style don't work. when use:
<datatrigger binding="{binding path=typeitem}" value="{x:null}"> ... </datatrigger>
then work.. how make typeitem load own style?
if clistboxitem
class derived listboxitem
or control
try trigger
instead of datatrigger
(and static value value="{x:static local:clistboxitem+etypeitem.file}"
). datatrigger search property in datacontext , not in object itself.
Comments
Post a Comment