HandyControl Documentation

repository·develop·Indexed 23 days ago

https://github.com/ghost1372/handycontrols

An extended version of the HandyControl library for .NET developers (requiring .NET 4.0 or higher). It provides enhanced UI controls, additional styles, and specialized support for Persian calendars and dates. The toolkit includes various attached properties for UI customization, such as BackgroundSwitchElement for interaction effects, BorderElement for rounded corners, and IconElement for adding geometric icons to elements.

Tokens
95.2K
Snippets
254
Records
457
Agent score
80%

What's inside HandyControl

  1. Overview of HandyControl

    develop

    HandyControl is a collection of UI controls and features for .NET applications. It is based on the original HandyControl project but extends it with additional capabilities, including:

    • Support for Persian Calendar and PersianDate.
    • Additional controls and expanded styles.

    It requires .NET 4.0 or higher.

  2. Use the NumericUpDown control

    develop

    The NumericUpDown control is a combination of arrow buttons and a TextBox that allows users to select or input a numeric Value. Users can adjust the value by clicking the up/down arrows or by typing directly into the text box.

    <!-- XAML -->
    <hc:NumericUpDown Value="100"/>
    
    <!-- C# -->
    var numericUpDown = new NumericUpDown();
    numericUpDown.Value = 100;
  3. Use Loading controls for time-consuming operations

    develop

    HandyControl provides loading animations to indicate progress during time-consuming operations. The library currently supports two types of loading indicators:

    1. LoadingLine: A linear loading bar.
    2. LoadingCircle: A circular loading animation.

    Both types inherit from LoadingBase and are used to provide visual feedback to the user.

    <!-- Example of using both types in a layout -->
    <StackPanel>
        <hc:LoadingLine/>
        <hc:LoadingCircle/>
    </StackPanel>
  4. Use GlowWindow for windows with glowing borders

    develop

    The GlowWindow is a specialized Window implementation that provides a glowing border effect around the window frame. The implementation logic is inspired by Visual Studio. You can customize the glow color for both active and inactive states using the ActiveGlowColor and InactiveGlowColor properties.

    <hc:GlowWindow x:Class="HandyControlDemo.Window.GlowWindow"
                   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                   xmlns:hc="https://handyorg.github.io/handycontrol"
                   Style="{StaticResource WindowGlow}"
                   ActiveGlowColor="{DynamicResource PrimaryColor}"
                   Height="450" 
                   Width="800">
        <Border Background="{DynamicResource MainContentForegroundDrawingBrush}"/>
    </hc:GlowWindow>
  5. Use CirclePanel for circular layouts

    develop

    The CirclePanel is a specialized Panel designed to arrange child elements in a circular pattern. It is commonly used as a container for directional buttons or functional icon buttons arranged around a center point.

    Inherits from: public class CirclePanel : Panel

    <hc:CirclePanel Margin="64" Diameter="170">
        <Button Style="{StaticResource CirclePanelButton}"/>
        <Button Style="{StaticResource CirclePanelButton}"/>
        <Button Style="{StaticResource CirclePanelButton}"/>
        <Button Style="{StaticResource CirclePanelButton}"/>
        <Button Style="{StaticResource CirclePanelButton}"/>
        <Button Style="{StaticResource CirclePanelButton}"/>
        <Button Style="{StaticResource CirclePanelButton}"/>
        <Button Style="{StaticResource CirclePanelButton}"/>
    </hc:CirclePanel>
  6. Use PreviewSlider to display status information

    develop

    The PreviewSlider is an extension of the standard Slider that allows you to provide visual feedback to users about state information at different positions along the slider track. It uses PreviewContent to render custom UI elements that follow the slider's position.

    <hc:PreviewSlider Name="PreviewSliderHorizontal" Width="300" Value="500" Maximum="1000">
        <hc:PreviewSlider.PreviewContent>
            <Label Style="{StaticResource LabelPrimary}" 
                    Content="{Binding Path=(hc:PreviewSlider.PreviewPosition), RelativeSource={RelativeSource Self}}" 
                    ContentStringFormat="#0.00"/>
        </hc:PreviewSlider.PreviewContent>
    </hc:PreviewSlider>
  7. Use the RunningBlock control for scrolling content

    develop

    The RunningBlock control is used to create a continuous carousel or marquee effect for scrolling content. It inherits from ContentControl and can contain text or complex layouts like a StackPanel containing images.

    <hc:RunningBlock>
        <StackPanel Orientation="Horizontal">
            <!-- Your scrolling content here -->
        </StackPanel>
    </hc:RunningBlock>