https://github.com/jpoon/rotarywheel
☸ .NET Rotary Wheel user control
https://github.com/jpoon/rotarywheel
dotnet usercontrol
Last synced: about 2 months ago
JSON representation
☸ .NET Rotary Wheel user control
- Host: GitHub
- URL: https://github.com/jpoon/rotarywheel
- Owner: jpoon
- License: mit
- Created: 2015-08-25T00:16:52.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-08-29T10:33:05.000Z (almost 8 years ago)
- Last Synced: 2025-04-08T20:07:00.271Z (about 2 months ago)
- Topics: dotnet, usercontrol
- Language: C#
- Homepage: https://www.nuget.org/packages/RotaryWheelUserControl
- Size: 9.28 MB
- Stars: 16
- Watchers: 2
- Forks: 8
- Open Issues: 3
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Rotary Wheel User Control
This is a .NET rotary wheel/spinner/knob/wheel-of-fortune-thingy user control built using C#/XAML.
The user control targets Windows 10 apps but can be used across all .NET applications.
Here's a stylized version that was used in [@HeavenFresh's](https://twitter.com/heavenfresh) app.
Given the labels of each slice, the user control will automatically create the necessary number of slices.
Both touch and mouse events are supported, and when the user finishes manipulation of the wheel, the wheel will animate back to the center of the selected slice.Out-of-the-box, what you'll get is something more along the lines of:

## Installation
To install, run the following command in the [Package Manager Console](http://docs.nuget.org/docs/start-here/using-the-package-manager-console)
```
PM> Install-Package RotaryWheelUserControl
```## Usage
### Configurations:
| Property | |
| ------------------|----------------------------------------------------------------------------|
| BackgroundColor | color of starting slice with each subsequent slice being a lighter version |
| ForegroundColor | color of labels |
| Size | size of the rotary wheel |
| HideLabels | boolean value denoting whether to show or hide the labels |
| Slices | array of strings of the value/label for each slice |
| SelectedItemValue | read-only value denoting the currently selected slice || Callback | |
| ------------------|-----------------------------------------------------------|
| PropertyChanged | event that is raised when the `SelectedItemValue` changes |We can instantiate a rotary wheel like so:
XAML:
```xml
```C# (code-behind):
```c#
rotaryWheelDemo.Slices = new[]
{
"Auto",
"Quiet",
"Low",
"Medium",
"High",
};rotaryWheel.PropertyChanged += ;
```Take a look at the [demo project](https://github.com/jpoon/RotaryWheel/tree/master/RotaryWheelDemo) for a closer look.
## How
If you are curious of how this all works, check out the accompanying blog [post](http://jasonpoon.ca/2015/08/29/building-a-rotary-wheel-control/).
## License
Copyright (c) Microsoft Corporation, licensed under [The MIT License (MIT)](https://raw.githubusercontent.com/jpoon/RotaryWheel/master/LICENSE).