Can anyone give me information on how the setvalue on a textblock works? Can't find good information about it. definitions used in this code:
//sourcenode definition
public DependencyProperty SourceNode =
Constants.HierarchyNodeProperty;
//HierarchyNodeProperty definition
public static DependencyProperty HierarchyNodeProperty = DependencyProperty.RegisterAttached("SourceNode", typeof(HierarchyNode), typeof(Constants));
//textblock setvalue
this.TextBlock.SetValue(SourceNode, this);
Any information that makes sense might help. Like links etc.
SetValue is a function available to DependencyObjects which sets the value of a DependencyProperty to the provided value.
What your code seems to do is set the SourceNode DP of a property (named TextBlock and of unknown type) to this.
TextBlock is a poor name for a property and SourceNode is a poor name for a DP.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.