https://github.com/dansav/coroutines-for-wpf
Influenced by coroutines in Unity
https://github.com/dansav/coroutines-for-wpf
coroutines dotnet dotnet-core wpf
Last synced: 26 days ago
JSON representation
Influenced by coroutines in Unity
- Host: GitHub
- URL: https://github.com/dansav/coroutines-for-wpf
- Owner: dansav
- License: mit
- Created: 2019-08-28T18:28:34.000Z (almost 6 years ago)
- Default Branch: develop
- Last Pushed: 2020-08-15T11:48:59.000Z (almost 5 years ago)
- Last Synced: 2025-04-12T22:35:23.846Z (about 2 months ago)
- Topics: coroutines, dotnet, dotnet-core, wpf
- Language: C#
- Homepage:
- Size: 76.2 KB
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Coroutines for WPF
[](https://www.nuget.org/packages/CoroutinesForWpf/)
Influenced by coroutines in Unity3D. Giving the ability to sequentially declare animations and other time dependent tasks.
## Compatibility
The WPF specific parts requires one of:
* .NET Framework 3.5 or later
* .NET Core 3.0With a custom event pump, you can use any .NET version compatible with .NET Standard 1.1 or .NET Framework 3.5 or newer.
## Example code
```C#
private void OnClick()
{
var routine = Coroutine.Start(GreetTheWorld());// To abort the coroutine, just call Dispose()
//routine.Dispose();
}private IEnumerator GreetTheWorld()
{
TextBlock1.Text = "Hello ...";yield return new WaitForSeconds(2.0);
TextBlock1.Text = "Hello World!";
}
```More example code can be found in the source code.
* Main WPF example: [CoroutinesForWpf.Example](Source/CoroutinesForWpf.Example/)
* Custom event pump example: [CoroutinesDotNet.CustomPumpExample](Source/CoroutinesDotNet.CustomPumpExample/)