Giter Club home page Giter Club logo

xamltimers's Introduction

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;
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.
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.
(i.e. Slider.Value => RangeBase.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;
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.

xamltimers's People

Contributors

radj307 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.