From 71bd0fc99a634243eb2abe30b35dfd0375923eff Mon Sep 17 00:00:00 2001 From: SlimeNull Date: Sat, 25 May 2024 11:03:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EleCho.WpfSuite/EleCho.WpfSuite.csproj | 2 +- README.md | 112 +++++++++++++++++++------ 2 files changed, 89 insertions(+), 25 deletions(-) diff --git a/EleCho.WpfSuite/EleCho.WpfSuite.csproj b/EleCho.WpfSuite/EleCho.WpfSuite.csproj index 0f6f9ba..7257d76 100644 --- a/EleCho.WpfSuite/EleCho.WpfSuite.csproj +++ b/EleCho.WpfSuite/EleCho.WpfSuite.csproj @@ -8,7 +8,7 @@ true EleCho.WpfSuite - 0.2.1 + 0.3.0 EleCho Copyright © 2024 EleCho diff --git a/README.md b/README.md index 1108f97..54f1a45 100644 --- a/README.md +++ b/README.md @@ -53,42 +53,103 @@ Enjoy! ## Features +The following is a summary of the features of WPF Suite. -Layout panels: + +### Layout panels: - StackPanel: Origin stack panel with `Spacing` property - WrapPanel: Origin wrap panel with `HorizontalSpacing` and `VerticalSpacing` property - FlexPanel: Flex layout implementation with `HorizontalSpacing` and `VerticalSpacing` property +- MasonryPanel: Masonry layout implementation with `FlowSpacing` and `ItemSpacing` property + +### Controls: + +The WPF Suite has overridden many native controls, added some properties, or optimized their logic. +You can directly access the corresponding controls via the WPF Suite namespace. + +Almost all controls have added the CornerRadius property, so now if you need to adjust the corner radius of a certain control, +you just need to set this property instead of changing the control template. + +```xml + +``` + +If a corresponding control has multiple states, such as "mouse hover" and "mouse press", +WPF Suite also exposes certain values corresponding to these states directly through properties, +such as "HoverBackground" which represents the background color used by the control in the hover state. +Therefore, if you need to change the style of certain controls in different states, +you just need to set the corresponding properties. + + +```xml + +``` + +When using the default Border in WPF, it allows the content to exceed the bounds of the Border. +Even if you set a CornerRadius and ClipToBounds, it won't be able to clip the content to fit within the rounded corners. +However, when using the Border provided by the WPF Suite, +you can achieve automatic clipping by binding the content's Clip property to the Border's ContentClip property. + +```xml + + + + + + + +``` + +TransitioningContentControl can be understood as a ContentControl with added transition effects. +After setting the transition effects, the specified transition effect will be executed when the content changes. + +```xml + + + + + +``` + +WPF Suite has also made several optimizations for ScrollViewer. +For example, it now supports smooth scrolling with the mouse and allows for finer scrolling using touchpad, +which was not available in the original ScrollViewer. + +```xml + + + + + + +``` + +> The enhanced features of ScrollViewer can be disabled via its properties. -Controls: -- Image: Simple image control with `CornerRadius` property -- SlicedImage: Simple image control for drawing '9SliceSprite' -- Button: Origin button with `CornerRadius` property -- ToggleButton: Origin toggle button with `CornerRadius` property -- ScrollViewer: Origin scroll viewer with 'MouseWheelDelta' based scrolling and scroll smoothing feature -- ConditionalControl: Display the control based on the condition -- TextBox: Origin text box with `Placeholder` and `CornerRadius` property -- ListBox: Origin list box with `CornerRadius` property -- ListBoxItem: Origin list box item with `CornerRadius` property -- TransitioningContentControl: ContentControl that allows you to set transitions -- Frame: Frame that allows you to set transitions -- ProgressBar: Origin progress bar with `CornerRadius` property -- Border: Origin border with `ContentClip` property for binding -Transitions: +### Transitions: -- SlideTransition: Moves the old page out of view, and the new page into view -- FadeTransition: Fades out the current page and fades in the new page by animating the opacity -- SlideFadeTransition: SlideTransition and FadeTransition -- ScaleTransition: Scale the old page to smaller and fade out, and scale the new page from a larger zoom to 1 and fade in +- FadeTransition: Fades out the current content and fades in the new content by animating the opacity +- SlideTransition: Moves the old content out of view, and the new content into view +- SlideFadeTransition: Composite of SlideTransition and FadeTransition +- ScaleTransition: Scale the old content to smaller and fade out, and scale the new content from a larger zoom to 1 +- ScaleFadeTransition: Composite of ScaleTransition and FadeTransition +- RotateTransition: Rotate the old content and new content by specified angle +- RotateFadeTransition: Composite of RotateTransition and FadeTransition -Value converters: +### Value converters: - AddNumberConverter: Mathematical calculations, addition - SubtractNumberConverter: Mathematical calculations, subtraction - MultiplyNumberConverter: Mathematical calculations, multiplication - DivideNumberConverter: Mathematical calculations, division +- ClampNumberConverter: Clamps the given value between the given minimum float and maximum values - NumberCompareConverter: Compare between numbers, support `equal`, `not equal`, `greator than`, `greator or equal`, `less than`, `less or equal` - EqualConverter: Check if the value equals converter parameter - NotEqualConverter: Check if the value not equal to converter parameter @@ -105,8 +166,9 @@ Value converters: - StringToImageSourceConverter: Convert any valid URI string to image source - NumberToThicknessConverter: Convert number to uniform thickness - NumberToCornerRadiusConverter: Convert number to uniform corner radius +- InvertThicknessConverter: Invert the given thickness value -Markup extensions: +### Markup extensions: - String: Represents text as a sequence of UTF-16 code units. (returns System.String) - Char: Represents a character as a UTF-16 code unit. (returns System.Char) @@ -120,11 +182,13 @@ Markup extensions: - Decimal: Represents a decimal floating-point number. (returns System.Decimal) - HsvColor: Represents a color from HSV color space values (returns System.Windows.Media.Color) -Animations: +### Animations: - CornerRadiusAnimation: Animates the value of a CornerRadius property between two target values using linear interpolation over a specified Duration. +- QuadraticBezierEase: Quadratic bezier curve easing function +- CubicBezierEase: Cubic bezier curve easing function -Utilities: +### Utilities: - BindingProxy: A utility class for binding, commonly used when a collection element has property to be bound to a page DataContext - ScrollViewerUtils: Utilities for set vertical offset and horizontal offset of scroll viewer and scroll content presenter