BackgroundSwitchElement Attach - AdarshRise/HandyControl GitHub Wiki

An attached property is intended to be used as a type of global property that is settable on any object.

BackgroundSwitchElement Contains

Property Description
MouseHoverBackground Gets or sets the background color of the Controls.
MouseDownBackground Gets or sets the background color of the Controls.

Usage in Xaml

First add HandyControl NameSpace

xmlns:hc="https://handyorg.github.io/handycontrol"

Now

<Button hc:BackgroundSwitchElement.MouseHoverBackground="Red"/>

Usage in Code-Behind

BackgroundSwitchElement.SetMouseHoverBackground(control, Brushes.Red);
BackgroundSwitchElement.SetMouseDownBackground(control, Brushes.Red);

BackgroundSwitchElement.GetMouseHoverBackground(control);
BackgroundSwitchElement.GetMouseDownBackground(control);
⚠️ **GitHub.com Fallback** ⚠️