https://github.com/diyari-kurdi/shimmerui
Shimmer effect control for WPF to indicate loading state.
https://github.com/diyari-kurdi/shimmerui
csharp shimmer shimmer-effect ui ux windows-presentation-foundation wpf
Last synced: 10 months ago
JSON representation
Shimmer effect control for WPF to indicate loading state.
- Host: GitHub
- URL: https://github.com/diyari-kurdi/shimmerui
- Owner: Diyari-Kurdi
- License: mit
- Created: 2025-06-25T04:47:12.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-06-27T09:42:12.000Z (about 1 year ago)
- Last Synced: 2025-08-24T21:55:37.099Z (11 months ago)
- Topics: csharp, shimmer, shimmer-effect, ui, ux, windows-presentation-foundation, wpf
- Language: C#
- Homepage:
- Size: 31.3 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README

# Shimmer.Wpf
**Shimmer.Wpf** is a customizable WPF control that displays a shimmer loading effect to enhance the user experience during data loading.
 
## β¨ Features
- β‘ **Fast & Lightweight** β Optimized for smooth WPF performance.
- π¨ **Fully Customizable** β Shimmer color, speed, width, opacity, duration, and corner radius.
- π **MVVM-Friendly** β `IsShimmering` is a bindable dependency property.
- π **Auto-Start Support** β Automatically starts shimmer on load if enabled.
- π₯οΈ **Design-Time Support** β Preview shimmer directly in XAML designer.
- π§© **Group Control** β Manage grouped shimmer controls via `StartGroup`, `StopGroup`, and `ToggleGroup`.
- π **Global Control** β Control all shimmer instances using static methods: `StartAll`, `StopAll`, `ToggleAll`.
- π‘ **Event Hooks** β React to shimmer lifecycle events at instance, group, or global level.
## π¦ Installation
```sh
Install-Package Shimmer.Wpf
```
or with .NET CLI:
```sh
dotnet add package Shimmer.Wpf
```
### π Example Usage
#### β
**1. Content with its own CornerRadius**
```xml
```
> β
The control detects `CornerRadius` from the content if present.
---
#### β
**2. ShimmerControl with CornerRadius**
```xml
```
> β
Use this when your content (e.g., `TextBlock`) doesnβt support `CornerRadius`.
---
#### β
**3. Compact placeholder bars (often for skeleton loaders)**
```xml
```
---
## π§© Usage
### XAML Binding
Bind the shimmer state to your view model:
```xml
```
### Automatic Start
Use `AutoStart` to shimmer immediately when the control loads:
```xml
```
### Controlling Shimmer Programmatically
You can control shimmer effects globally, by group, or individually using static methods:
- **StartAll()** β Starts shimmer on all existing `ShimmerControl` instances.
```csharp
ShimmerControl.StartAll();
```
- **StopAll()** β Stops shimmer on all instances.
```csharp
ShimmerControl.StopAll();
```
- **ToggleAll()** β Toggles shimmer state on all instances.
```csharp
ShimmerControl.ToggleAll();
```
- **StartGroup(string groupName)** β Starts shimmer on all controls in the specified group.
```csharp
ShimmerControl.StartGroup("LoadingCards");
```
- **StopGroup(string groupName)** β Stops shimmer on all controls in the specified group.
```csharp
ShimmerControl.StopGroup("LoadingCards");
```
- **ToggleGroup(string groupName)** β Toggles shimmer on all controls in the specified group.
```csharp
ShimmerControl.ToggleGroup("LoadingCards");
```
### Individual Control Methods
You can also start, stop or toggle shimmer on individual controls:
```csharp
myShimmerControl.StartShimmering();
myShimmerControl.StopShimmering();
myShimmerControl.ToggleShimmering();
```
### Events
Subscribe to static events to react to shimmer changes globally or per group:
```csharp
ShimmerControl.ShimmeringGroupStarted += (s, e) => {
string group = e.GroupName;
int count = e.Count;
// handle group started
};
ShimmerControl.ShimmeringGroupStopped += (s, e) => {
string group = e.GroupName;
int count = e.Count;
// handle group stopped
};
ShimmerControl.ShimmeringGroupToggled += (s, e) => {
string group = e.GroupName;
int count = e.Count;
// handle group toggled
};
ShimmerControl.AllShimmeringStarted += (s, e) => {
int count = e.Count;
// handle all shimmer started
};
ShimmerControl.AllShimmeringStopped += (s, e) => {
int count = e.Count;
// handle all shimmer stopped
};
ShimmerControl.AllShimmeringToggled += (s, e) => {
int count = e.Count;
// handle all shimmer toggled
};
```
## π₯ Preview
The recording is from the included `WPF_Demo` project, showcasing various usages of the control.
https://github.com/user-attachments/assets/a18bda0a-75df-4751-952e-8366c51554a4
## π Properties
| Property | Description |
|--------------------------|----------------------------------------------|
| `IsShimmering` | Starts or stops the shimmer animation |
| `AutoStart` | Starts shimmering automatically on load |
| `ShimmerColor` | Highlight color of the shimmer |
| `ShimmerWidth` | Width of the shimmer band |
| `ShimmerOpacity` | Opacity of the shimmer effect |
| `ShimmerDuration` | Total animation cycle duration |
| `CornerRadius` | Rounding of shimmer border |
| `ShimmerGroup` | Optional group identifier for group control |
| `ShimmerEasingFunction` | Easing function for animation |
| `DesignModeShimmering` | Enables shimmer effect in design view |
## π License
This project is licensed under the [MIT License](https://github.com/Diyari-Kurdi/ShimmerUI/blob/master/LICENSE.txt).
Β© 2025 Diyari Ismael