Files
DP44/docs/ai/DTS Viewer/DTS.Viewer.Modules/DTS.Viewer.GraphList/Classes.md
2026-04-17 14:55:32 -04:00

2.3 KiB

source_files, generated_at, model, schema_version, sha256
source_files generated_at model schema_version sha256
DTS Viewer/DTS.Viewer.Modules/DTS.Viewer.GraphList/Classes/VirtualToggleButton.cs
2026-04-17T15:59:03.091690+00:00 zai-org/GLM-5-FP8 1 b9f03ca53fe295ee

VirtualToggleButton Documentation

1. Purpose

VirtualToggleButton is a static utility class that provides attached dependency properties to imbue any WPF element with toggle button behavior. It allows arbitrary DependencyObject instances (specifically those implementing IInputElement) to respond to mouse and keyboard input as if they were ToggleButton controls, raising the standard Checked, Unchecked, and Indeterminate routed events. This enables toggle-style interactions on elements that cannot inherit from ToggleButton directly, such as TreeViewItem or custom controls in the DTS.Viewer.GraphList module.


2. Public Interface

Attached Properties

IsLockedProperty

public static readonly DependencyProperty IsLockedProperty
  • Type: Nullable<bool>
  • Default Value: false
  • Metadata Flags: BindsTwoWayByDefault | Journal
  • Description: Represents the toggle state of the virtual button. When set to true, raises ToggleButton.CheckedEvent; when false, raises ToggleButton.UncheckedEvent; when null, raises ToggleButton.IndeterminateEvent.

IsThreeStateProperty

public static readonly DependencyProperty IsThreeStateProperty
  • Type: bool
  • Default Value: false
  • Description: Determines whether the control supports three states. When true, IsLocked can cycle through null as a third state.

IsVirtualToggleButtonProperty

public static readonly DependencyProperty IsVirtualToggleButtonProperty
  • Type: bool
  • Default Value: false
  • Description: When set to true on an element implementing IInputElement, attaches mouse and keyboard handlers to enable toggle button behavior.

Getter/Setter Methods

public static Nullable<bool> GetIsLocked(DependencyObject d)
public static void SetIsLocked(DependencyObject d, Nullable<bool> value)

public static bool GetIsThreeState(DependencyObject d)
public static void SetIsThreeState(DependencyObject d, bool value)

public static bool GetIsVirtualToggleButton(DependencyObject d)
public static void SetIsVirtualToggleButton(DependencyObject