Click or drag to resize

AttachedPropertiesContainer class

Static container for attached properties.
Inheritance hierarchy
SystemObject
  Vishnu.WPF_UI.DependencyPropertiesAttachedPropertiesContainer

Namespace: Vishnu.WPF_UI.DependencyProperties
Assembly: Vishnu.WPF_UI (in Vishnu.WPF_UI.dll) Version: 1.0.0+df0404e911d6c38eaed3bb1bb1acfc482d417643
Syntax
public static class AttachedPropertiesContainer

The AttachedPropertiesContainer Type exposes the following members.

Methods
 NameDescription of the
Public MethodStatic MemberGetHasParent WPF getter for the HasParentProperty.
Public MethodStatic MemberGetLastNotNullLogical WPF getter for the LastNotNullLogicalProperty.
Public MethodStatic MemberGetParentChildOrientation WPF getter for the ParentChildOrientationProperty.
Public MethodStatic MemberSetHasParent WPF setter for the HasParentProperty.
Public MethodStatic MemberSetLastNotNullLogical WPF setter for the LastNotNullLogicalProperty.
Public MethodStatic MemberSetParentChildOrientation WPF setter for the ParentChildOrientationProperty.
Back to the top
Fields
 NameDescription of the
Public FieldStatic MemberHasParentProperty In True, the node has a parent node, if False, it is the root.
Public FieldStatic MemberLastNotNullLogicalProperty Attached property for a nullable Boolean for passing on the logical state of the checker assigned to the control (is used, for example, for dependent colouring (false=red, true=green) of a superordinate border in a ControlTemplate): After various failed attempts, the following procedure has proven to be the only viable solution has crystallised: a control superordinate to the ControlTemplate or DataTemplate is assigned the AttachedProperty "LastNotNullLogical": <Expander Name="Exp" Template="{StaticResource ExpanderStyleHeaderCentered}" ... attached:AttachedPropertiesContainer.LastNotNullLogical="{Binding LastNotNullLogical, diag:PresentationTraceSources.TraceLevel=High}" > The AttachedProperty "LastNotNullLogical" is directly linked to "LastNotNullLogical" from is bound to the DataContext, in this case "LogicalNodeViewModel". In the subordinate ControlTemplate, here <ControlTemplate TargetType="ToggleButton"> in LogicalTaskTreeControlStaticResourceDictionary.xaml, DataTriggers are passed to the higher-level Control with Path bound to the AttachedProperty "LastNotNullLogical": <DataTrigger Binding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Expander}}, Path=(attached:AttachedPropertiesContainer.LastNotNullLogical)}" Value="True"> <Setter Property = "Border.BorderBrush" TargetName="ToggleButtonBorder" Value="{StaticResource ItemBorderBrushGreen}" /> </DataTrigger> <DataTrigger Binding = "{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Expander}}, Path=(attached:AttachedPropertiesContainer.LastNotNullLogical)}" Value="False"> <Setter Property = "Border.BorderBrush" TargetName = "ToggleButtonBorder" Value = "{StaticResource ItemBorderBrushRed}" /> </ DataTrigger> Important note: other solution approaches failed at the latest when the tree orientation was switched.
Public FieldStatic MemberParentChildOrientationProperty Alignment of the child nodes, horizontal or vertical.
Back to the top
Attached properties
 NameDescription of the
Public PropertyHasParent Attached property (bool). If true, the node has child nodes.
Public PropertyLastNotNullLogical Attached property for a nullable Boolean for passing on the logical state of the checker assigned to the control (is used, for example, for dependent colouring (false=red, true=green) of a superordinate border in a ControlTemplate): After various failed attempts, the following procedure has proven to be the only viable solution has crystallised: a control superordinate to the ControlTemplate or DataTemplate is assigned the AttachedProperty "LastNotNullLogical": <Expander Name="Exp" Template="{StaticResource ExpanderStyleHeaderCentered}" ... attached:AttachedPropertiesContainer.LastNotNullLogical="{Binding LastNotNullLogical, diag:PresentationTraceSources.TraceLevel=High}" > The AttachedProperty "LastNotNullLogical" is directly linked to "LastNotNullLogical" from is bound to the DataContext, in this case "LogicalNodeViewModel". In the subordinate ControlTemplate, here <ControlTemplate TargetType="ToggleButton"> in LogicalTaskTreeControlStaticResourceDictionary.xaml, DataTriggers are passed to the higher-level Control with Path bound to the AttachedProperty "LastNotNullLogical": <DataTrigger Binding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Expander}}, Path=(attached:AttachedPropertiesContainer.LastNotNullLogical)}" Value="True"> <Setter Property = "Border.BorderBrush" TargetName="ToggleButtonBorder" Value="{StaticResource ItemBorderBrushGreen}" /> </DataTrigger> <DataTrigger Binding = "{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Expander}}, Path=(attached:AttachedPropertiesContainer.LastNotNullLogical)}" Value="False"> <Setter Property = "Border.BorderBrush" TargetName = "ToggleButtonBorder" Value = "{StaticResource ItemBorderBrushRed}" /> </ DataTrigger> Important note: other solution approaches failed at the latest when the tree orientation was switched.
Public PropertyParentChildOrientation Attached Property (Orientation), Horizontal or Vertical.
Back to the top
Remarks
File: AttachedPropertiesContainer.cs Author: Erik Nagel 22/07/2013 Erik Nagel: created 28.11.2022 Erik Nagel: LastNotNullLogicalProperty.
See also