XamlTimers 1.2.1

.NET 6.0
dotnet add package XamlTimers --version 1.2.1
NuGet\Install-Package XamlTimers -Version 1.2.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="XamlTimers" Version="1.2.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add XamlTimers --version 1.2.1
#r "nuget: XamlTimers, 1.2.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install XamlTimers as a Cake Addin
#addin nuget:?package=XamlTimers&version=1.2.1

// Install XamlTimers as a Cake Tool
#tool nuget:?package=XamlTimers&version=1.2.1

XamlTimers

WPF behaviors that update bindings or execute a callback method on a configurable interval.
You can toggle the timers at any time; or even bind the EnableTimer property to another control, such as a CheckBox.

Usage

Requires Microsoft's WPF Behaviors NuGet package:

To use the above package in XAML, add this namespace to your Window:
http://schemas.microsoft.com/xaml/behaviors

Namespace

C#

using XamlTimers;

XAML

xmlns:behavior="clr-namespace:XamlTimers;assembly=XamlTimers"

Behaviors

Properties that don't have default values are required!

IntervalUpdateBinding

Properties
Property Type Default Value Description
EnableTimer bool true When true, the timer is enabled & the specified binding is updated every time the Interval has elapsed;<br/>When false, the timer is disabled & no updates occur.
Interval double The timer interval, in milliseconds.
Property DependencyProperty Specifies the target property of the attached object to update the databinding on.<br/>This should be specified in the form "{x:Static <CONTROL>.<PROPERTYNAME>Property}", where the <CONTROL> is the control that defines the property, not the control that inherits it.<br/> (i.e. Slider.ValueRangeBase.ValueProperty)
ThrowWhenPropertyIsNull bool true When true, an ArgumentNullException is thrown by the update method when Property is null; when false, no exception is thrown and the binding update silently fails.
ThrowWhenPropertyIsMissing bool true When true, an ArgumentNullException is thrown by the update method when Property doesn't exist on the attached object; when false, no exception is thrown and the binding update silently fails.

IntervalCallback

Properties
Property Default Description
EnableTimer true When true, the timer is enabled & TimerCallback is called every time the Interval has elapsed;<br/>When false, the timer is disabled & TimerCallback is not called.
Interval The timer interval, in milliseconds. (type double)
TimerCallback A callback delegate of type System.Timers.ElapsedEventHandler that will be invoked every time the timer is triggered.

BaseIntervalBehavior

If you want to create your own timer class, you can inherit from the abstract base class with your own implementation.
See the source code for implementation details & examples.

Product Compatible and additional computed target framework versions.
.NET net6.0-windows was computed.  net6.0-windows7.0 is compatible.  net7.0-windows was computed.  net7.0-windows7.0 was computed. 
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.1 354 9/6/2022
1.2.0 319 9/6/2022
1.1.1 324 8/12/2022
1.1.0 318 8/12/2022
1.0.0 323 8/12/2022