HandyControl Documentation

repository·master·Indexed 27 days ago

https://github.com/handyorg/handycontrol

A UI control library for WPF (Windows Presentation Foundation) development that provides enhanced controls and syntactic sugar to improve development efficiency. It includes a variety of attached properties via Element and Attach suffix classes for styling borders, icons, and backgrounds, and is available as a NuGet package for .NET 4.0 or higher and Visual Studio 2022.

Tokens
80.4K
Snippets
226
Records
443
Agent score
92%

What's inside HandyControl

  1. Understand the HandyControl Project Structure

    master

    The source code is organized into several solutions (.sln) within the src folder, categorized by .NET version (e.g., Net_GE45 for .NET version $\ge$ 4.5).

    Key Folders

    • Shared: Contains shared project code used across different versions.
    • Sub-folders: Each main folder contains two sub-folders:
      • One for the Control Source Code.
      • One for the Control Demo/Example Source Code.

    Running Demos

    To view the controls in action, set the corresponding demo project (e.g., HandyControlDemo_Net_GE45) as the Startup Project in Visual Studio.

  2. Understand the Attach property pattern in HandyControl

    master

    HandyControl uses two naming conventions for extending control functionality via attached properties:

    1. Element suffix classes: These classes provide common attached properties that can be applied to all controls (e.g., properties that affect general element behavior).
    2. Attach suffix classes: These classes provide specialized attached properties that are intended for use with a specific type of control only.

    You can find the source code for these properties in the Controls / Attach directory of the repository.

  3. Use the FloatingBlock control for special click effects

    master

    The FloatingBlock control (inheriting from Control) allows you to implement special visual click effects, such as elements that float away from a control when it is interacted with. You can customize the animation destination, duration, and the content that floats using attached properties.

    public class FloatingBlock : Control