Skip to content

Latest commit

 

History

History
114 lines (81 loc) · 6.95 KB

README.md

File metadata and controls

114 lines (81 loc) · 6.95 KB

FancyPrimitives WPF library FancyPrimitives

FancyPrimitives is a WPF library containing some commonly used controls.

It is an open source library and is completely free for commercial use.


FancyPrimitives contains the folowing controls:

CircleWaitIndicator

Allows to notify the user that he needs to wait.
The CircleWaitIndicator class is derived from the UserControl class.

WPF wait indicator

Set the IsRunning property to start or stop the animation.

XAML Example:

    <fp:CircleWaitIndicator xmlns:fp="clr-namespace:FancyPrimitives;assembly=FancyPrimitives"
                            Width="35" Height="35" 
                            Fill="RoyalBlue" 
                            IsRunning="True"/>

StandardColorPicker

Allows to select a color from the standard set of Predefined .NET Colors.
The StandardColorPicker class is derived from the UserControl class.

WPF wait indicator

Use the SelectedColor property to set or get the selected color. For cases where you set the SelectedColor property to a value that is not in the Colors list, StandardColorPicker have one last cell to store a custom color. This last cell will automatically be set to your custom color.

XAML Example:

    <fp:StandardColorPicker xmlns:fp="clr-namespace:FancyPrimitives;assembly=FancyPrimitives"
                            SelectedColor="Red"/>

StandardColorPickerWithAChannel

The same as the StandardColorPicker control, but additionally allows to specify the transparency of selected color.
The StandardColorPickerWithAChannel class is derived from the UserControl class.

WPF wait indicator

XAML Example:

    <fp:StandardColorPickerWithAChannel xmlns:fp="clr-namespace:FancyPrimitives;assembly=FancyPrimitives"
                                        SelectedColor="Orange"/>

PenSelector

Allows to select a Pen with a specified color from the Colors list, transparency of the color, and Thickness of the pen.
The PenSelector class is derived from the UserControl class.

WPF wait indicator

Use the SelectedPen property to set or get the selected Pen value.

XAML Example:

    <fp:PenSelector xmlns:fp="clr-namespace:FancyPrimitives;assembly=FancyPrimitives">
        <fp:PenSelector.SelectedPen>
            <Pen>
                <Pen.Brush>Crimson</Pen.Brush>
                <Pen.Thickness>1</Pen.Thickness>
            </Pen>
        </fp:PenSelector.SelectedPen>
    </fp:PenSelector>

UpDownButtonBlock

Contains a pair of arrow buttons that the user can click to increment or decrement the value of some integer property of some another control, such as an integer TextBox.
The UpDownButtonBlock class is derived from the Control class.

WPF wait indicator

You have to bind the UpButtonPressedCommand and DownButtonPressedCommand properties of this control to Commands that implement incrementation and decrementation of something. Therefore, if you need to increment and decrement some property of some control, it's reasonable to make this this control expose such a Commands as properties. The FancyPrimitives library contains the IntegerTextBox control (derived from TextBox) that has the IncrementValueCommand and DecrementValueCommand properties, and can be used in conjunction with the UpDownButtonBlock control (see example below).

XAML Example:

    <StackPanel Orientation="Horizontal">
        <fp:IntegerTextBox xmlns:fp="clr-namespace:FancyPrimitives;assembly=FancyPrimitives"
                           x:Name="intTextBox" 
                           Text="0" 
                           Width="30"/>

        <fp:UpDownButtonBlock xmlns:fp="clr-namespace:FancyPrimitives;assembly=FancyPrimitives"
                              Width="20" Height="{Binding ElementName=intTextBox, Path=ActualHeight}" 
                              UpButtonPressedCommand="{Binding ElementName=intTextBox, Path=IncrementValueCommand}"
                              DownButtonPressedCommand="{Binding ElementName=intTextBox, Path=DecrementValueCommand}"/>
    </StackPanel>

IntegerTextBox

A TextBox derived control intended for storing integer values. This control is useful mostly in pair with the UpDownButtonBlock control. The Commands returned by the IncrementValueCommand and DecrementValueCommand properties increment and decrement the Text property value respectively. Set the MinValue and MaxValue properties to bound the Text property value.

XAML Example:

    <fp:IntegerTextBox xmlns:fp="clr-namespace:FancyPrimitives;assembly=FancyPrimitives"
                       MinValue="0" MaxValue="100"
                       Text="0"/>

Got questions?

If you have any questions or suggestions, don't hesitate to submit a new GitHub issue.

License

MIT license.