### Install HandyControls NuGet Package
Source: https://github.com/ghost1372/handycontrols/blob/develop/README.md
Use this command to install the HandyControls NuGet package into your project.
```powershell
Install-Package HandyControls
```
--------------------------------
### Install NexT Theme
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/themes/next/README.md
Clone the NexT theme repository into your Hexo project's themes directory to install it.
```sh
cd hexo
git clone https://github.com/theme-next/hexo-theme-next themes/next
```
--------------------------------
### Loading Control Usage Example
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/extend_controls/loading/index.md
Demonstrates how to use LoadingLine and LoadingCircle controls in XAML, including styling and layout.
```xml
```
--------------------------------
### Basic TreeView Example
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/native_controls/treeView/index.md
A basic example demonstrating the structure of a TreeView with nested TreeViewItems. This style is based on TreeViewBaseStyle.
```xml
```
--------------------------------
### Basic StepBar Example
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/extend_controls/stepBar/index.md
Demonstrates a basic StepBar with predefined steps. It uses data binding to control the current step and includes navigation buttons.
```xml
```
--------------------------------
### Start Screenshot Capture
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/extend_controls/screenshot/index.md
Initiates the screenshot capture process. This is the primary method to call for taking a screenshot.
```cs
new Screenshot().Start();
```
--------------------------------
### TransitioningContentControl Examples
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/extend_controls/transitioningContentControl/index.md
Demonstrates the use of TransitioningContentControl with various built-in transition modes and custom storyboards. A ToggleButton controls the visibility of the content grid.
```xml
```
--------------------------------
### Configure Fancybox Plugin
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/themes/next/README.md
Enable the fancybox plugin in NexT config and refer to its dependency repository for installation instructions.
```yaml
fancybox: false
```
--------------------------------
### CoverView Basic Usage Example
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/extend_controls/coverView/index.md
Demonstrates the basic usage of CoverView with item templates and data binding. Ensure the String2BrushConverter is available and DataList is bound to a collection of items with ImgPath and BackgroundToken properties.
```xml
```
--------------------------------
### Basic RichTextBox Implementation
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/native_controls/richTextBox/index.md
A basic example of how to implement a RichTextBox control in XAML. This snippet shows the minimal configuration required to display the control.
```xml
```
--------------------------------
### TabControl Example
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/extend_controls/tabControl/index.md
Demonstrates the usage of the TabControl with various properties enabled, including animation, close buttons, draggable tabs, and fill enabled.
```xml
```
--------------------------------
### GlowWindow XAML Implementation
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/extend_controls/glowWindow/index.md
Example of how to implement GlowWindow in XAML. This includes setting window properties, glow colors, and background. It demonstrates the usage of custom attached properties and dynamic resources.
```xml
```
--------------------------------
### PinBox Usage Example
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/extend_controls/pinBox/index.md
Demonstrates how to use the PinBox control in XAML, configuring its length, initial password, and password masking character. The 'Completed' event is also shown.
```xml
```
--------------------------------
### Pagination Usage Example
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/extend_controls/pagination/index.md
Demonstrates how to use the Pagination control in XAML with custom properties for maximum page count, current page index, and jump enabled.
```xml
```
--------------------------------
### Info Button Style
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/native_controls/button/index.md
Demonstrates the ButtonInfo style for informational buttons, with examples of corner radius and icon usage.
```XAML
```
--------------------------------
### ContextMenu Usage Example
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/native_controls/contextMenu/index.md
This XAML snippet shows how to use the ContextMenu by binding its ItemsSource to a data list and defining a HierarchicalDataTemplate for the items. It's an example of how to apply the default context menu styling.
```xaml
```
--------------------------------
### ProgressButton Usage Examples
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/extend_controls/progressButton/index.md
Demonstrates various ways to use the ProgressButton in XAML, including binding to IsUploading and Progress properties, and applying different styles for visual feedback.
```xml
```
--------------------------------
### Using Tokens for Specific StackPanel Containers
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/extend_controls/growl/index.md
Guide on how to use tokens to direct Growl notifications to specific StackPanel containers.
```APIDOC
## Displaying Information Notifications in Any StackPanel Container
### Description
This method allows you to direct Growl notifications to a specific `StackPanel` container by assigning it a unique token. This is useful when you have multiple notification areas or want to categorize notifications.
### Step 1: Assign a Token to the StackPanel
Use the `controls:Growl.Token` attached property to assign a unique identifier (token) to your `StackPanel`.
```xml
```
### Step 2: Display Message Using the Token
When calling Growl methods, provide the token as the second argument to direct the message to the corresponding `StackPanel`.
```csharp
Growl.Success("文件保存成功!", "SuccessMsg");
```
**Note:** The message "文件保存成功!" will now only be sent to the `StackPanel` container that has the "SuccessMsg" token.
```
--------------------------------
### Icon Button Style
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/native_controls/button/index.md
Demonstrates the ButtonIcon style, recommended for buttons that only display a geometry, with examples of styling and corner radius.
```XAML
```
--------------------------------
### Boolean to Visibility Converter Example
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/basic_xaml/converters/index.md
Demonstrates how to use the Boolean2VisibilityConverter to bind a boolean property to a UI element's visibility.
```xaml
Visibility="{Binding ShowButton,Converter={StaticResource Boolean2VisibilityConverter}}"
```
--------------------------------
### BlurWindow XAML Integration
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/extend_controls/blurWindow/index.md
Example of how to integrate the BlurWindow control in XAML. It sets basic window properties and applies a specific style.
```xml
```
--------------------------------
### Ask Method Example
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/extend_controls/growl/index.md
The Ask method uses a Func callback to handle user confirmation. Returning true closes the notification, while false keeps it open.
```csharp
Growl.Ask(Properties.Langs.Lang.GrowlAsk, isConfirmed =>
{
Growl.Info(isConfirmed.ToString());
return true;
});
```
--------------------------------
### TextBlock Styles Example
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/native_controls/textBlock/index.md
Demonstrates the usage of various predefined TextBlock styles such as TextBlockLargeBold, TextBlockLarge, TextBlockHeaderBold, and others. These styles are applied using the Style property within a StackPanel.
```XML
```
--------------------------------
### RangeSlider Examples
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/extend_controls/rangeSlider/index.md
Demonstrates various configurations of the RangeSlider control, including horizontal and vertical orientations, snapping to ticks, disabled states, and tooltip customization.
```XML
```
--------------------------------
### CircleProgressBar Usage Example
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/extend_controls/circleProgressBar/index.md
Demonstrates how to use CircleProgressBar with different configurations for size, text visibility, arc thickness, and styles. It binds the Value property to a Slider.
```xml
```
--------------------------------
### ImageSelector Usage Examples
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/extend_controls/imageSelector/index.md
Demonstrates various configurations of the ImageSelector control within a UniformGrid, showcasing different border styles, corner radii, and stroke properties.
```xml
```
--------------------------------
### Troubleshoot 'hexo-util' Module Error
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/themes/next/README.md
For NPM versions greater than 3, remove node_modules and reinstall. For versions less than 3, explicitly install hexo-util.
```sh
npm install --save-dev hexo-util
```
--------------------------------
### ToolBar Base Style Example
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/native_controls/toolBar/index.md
Demonstrates the basic structure and usage of the ToolBar control with various child elements like Buttons, ToggleButtons, and CheckBoxes. This style is intended to be inherited.
```xml
```
--------------------------------
### CirclePanel Usage Example
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/extend_controls/circlePanel/index.md
Demonstrates how to use the CirclePanel to arrange multiple buttons in a circular layout. The Diameter property controls the size of the circle.
```xml
```
--------------------------------
### Rate Control XAML Examples
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/extend_controls/rate/index.md
Demonstrates various configurations of the Rate control in XAML, including setting values, counts, read-only mode, allowing half selections, clearing, custom icons, and showing text.
```xml
```
--------------------------------
### ImageBlock Usage Example
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/extend_controls/imageBlock/index.md
Demonstrates how to use the ImageBlock control in XAML to display an animated sequence from a sprite sheet. Configure properties like Source, Interval, Columns, Rows, and playback range.
```xml
```
--------------------------------
### Card ViewModel for Data Binding
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/extend_controls/card/index.md
Provides a ViewModel with a collection of CardModel objects for use in data binding scenarios. This example is for demonstration purposes and not a strict MVVM implementation.
```csharp
public class CardDemoViewModel
{
private IList _dataList;
public CardDemoViewModel()
{
DataList = GetCardDataList();
}
internal ObservableCollection GetCardDataList()
{
return new ObservableCollection
{
new CardModel
{
Header = "Atomic",
Content = "1.jpg",
Footer = "Stive Morgan"
},
new CardModel
{
Header = "Zinderlong",
Content = "2.jpg",
Footer = "Zonderling"
},
new CardModel
{
Header = "Busy Doin' Nothin'",
Content = "3.jpg",
Footer = "Ace Wilder"
},
new CardModel
{
Header = "Wrong",
Content = "4.jpg",
Footer = "Blaxy Girls"
},
new CardModel
{
Header = "The Lights",
Content = "5.jpg",
Footer = "Panda Eyes"
},
new CardModel
{
Header = "EA7-50-Cent Disco",
Content = "6.jpg",
Footer = "еяхат музыка"
},
new CardModel
{
Header = "Monsters",
Content = "7.jpg",
Footer = "Different Heaven"
},
new CardModel
{
Header = "Gangsta Walk",
Content = "8.jpg",
Footer = "Illusionize"
},
new CardModel
{
Header = "Won't Back Down",
Content = "9.jpg",
Footer = "Boehm"
},
new CardModel
{
Header = "Katchi",
Content = "10.jpg",
Footer = "Ofenbach"
}
};
}
public IList DataList { get => _dataList; set => _dataList = value; }
}
```
--------------------------------
### Create a TimePicker Instance
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/extend_controls/timePicker/index.md
Demonstrates how to create a basic TimePicker control in XAML and C#.
```XML
```
```C#
var timePicker = new TimePicker();
```
--------------------------------
### Create PasswordBox Instance
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/extend_controls/passwordBox/index.md
Demonstrates how to create an instance of the PasswordBox control using XAML and C#.
```XML
```
```C#
var passwordBox = new PasswordBox();
```
--------------------------------
### Basic TimeBar Usage
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/extend_controls/timeBar/index.md
Demonstrates the basic instantiation of a TimeBar control in XAML.
```xml
```
--------------------------------
### Danger Button Style
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/native_controls/button/index.md
Illustrates the ButtonDanger style for dangerous operations, with examples of corner radius and icon customization.
```XAML
```
--------------------------------
### Set Initial Password
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/extend_controls/passwordBox/index.md
Shows how to set an initial password for the PasswordBox either in XAML or through C# code.
```XML
```
```C#
passwordBox.Password = "123456";
```
--------------------------------
### Basic Image Usage
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/native_controls/image/index.md
Demonstrates how to display images using the Image control with different sources and rendering options.
```XAML
```
--------------------------------
### Create DatePicker Instance
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/extend_controls/datePicker/index.md
Demonstrates how to create a new instance of the DatePicker control in XAML and C#.
```XML
```
```C#
var datePicker = new DatePicker();
```
--------------------------------
### Set Title and Placeholder
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/extend_controls/passwordBox/index.md
Illustrates how to set a title and placeholder text for the PasswordBox using attached properties.
```XML
```
--------------------------------
### GlowWindow Class Definition
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/extend_controls/glowWindow/index.md
The basic class definition for GlowWindow, inheriting from Window. This snippet shows the starting point for the custom window control.
```cs
public class GlowWindow : Window
```
--------------------------------
### StackPanelVerticalListBox Usage Example
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/native_controls/listBox/index.md
Demonstrates how to use the StackPanelVerticalListBox style with a ListBox. It shows binding to an ItemsSource and defining a custom ItemTemplate with a Border, DockPanel, Path, and TextBlock.
```XAML
```
--------------------------------
### Basic WaveProgressBar Usage
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/extend_controls/waveProgressBar/index.md
Demonstrates how to use the WaveProgressBar with basic customization. It binds the Value property to a slider.
```xml
```
--------------------------------
### Display Growl Messages
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/extend_controls/growl/index.md
Call static methods on the Growl class to display different types of notifications. For example, use Growl.Success() to show a success message.
```csharp
Growl.Success("文件保存成功!");
```
--------------------------------
### Basic Card Usage in XAML
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/extend_controls/card/index.md
Demonstrates how to use the Card control in XAML, including setting properties like MaxWidth, BorderThickness, Effect, and Margin. The content and footer sections are also shown.
```xml
```
--------------------------------
### Create DateTimePicker Instance
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/extend_controls/dateTimePicker/index.md
Shows how to create a new instance of the DateTimePicker control in XAML and C#.
```XML
```
```C#
var dateTimePicker = new DateTimePicker();
```
--------------------------------
### Adding and Jumping in CoverFlow
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/extend_controls/coverFlow/index.md
Demonstrates how to add multiple image resources to the CoverFlow control using URIs and then jump to a specific page index.
```csharp
CoverFlowMain.AddRange(new []
{
new Uri(@"pack://application:,,,/Resources/Img/Album/1.jpg"),
new Uri(@"pack://application:,,,/Resources/Img/Album/2.jpg"),
new Uri(@"pack://application:,,,/Resources/Img/Album/3.jpg"),
new Uri(@"pack://application:,,,/Resources/Img/Album/4.jpg"),
new Uri(@"pack://application:,,,/Resources/Img/Album/5.jpg"),
new Uri(@"pack://application:,,,/Resources/Img/Album/6.jpg"),
new Uri(@"pack://application:,,,/Resources/Img/Album/7.jpg"),
new Uri(@"pack://application:,,,/Resources/Img/Album/8.jpg"),
new Uri(@"pack://application:,,,/Resources/Img/Album/9.jpg"),
new Uri(@"pack://application:,,,/Resources/Img/Album/10.jpg")
});
CoverFlowMain.JumpTo(2);
```
--------------------------------
### Growl Control Usage
Source: https://github.com/ghost1372/handycontrols/blob/develop/doc/source/handycontrol/extend_controls/growl/index.md
Demonstrates how to set up a StackPanel as a Growl container and display success messages.
```APIDOC
## Basic Usage
### Description
This section explains how to designate a `StackPanel` as a container for Growl notifications and how to display success messages using the `Growl.Success` method.
### Step 1: Set StackPanel as Growl Container
Add the `controls:Growl.GrowlParent="True"` attached property to your `StackPanel` within a `ScrollViewer`.
```xml
```
### Step 2: Display Success Message
Call the `Growl.Success` method with the message content.
```csharp
Growl.Success("文件保存成功!");
```
```