2.3 KiB
2.3 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |
|---|---|---|---|---|---|
|
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, raisesToggleButton.CheckedEvent; whenfalse, raisesToggleButton.UncheckedEvent; whennull, raisesToggleButton.IndeterminateEvent.
IsThreeStateProperty
public static readonly DependencyProperty IsThreeStateProperty
- Type:
bool - Default Value:
false - Description: Determines whether the control supports three states. When
true,IsLockedcan cycle throughnullas a third state.
IsVirtualToggleButtonProperty
public static readonly DependencyProperty IsVirtualToggleButtonProperty
- Type:
bool - Default Value:
false - Description: When set to
trueon an element implementingIInputElement, 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