This project is read-only.

The page has been moved to GitHub

SingleEvent

Package: MyToolkit.Extended
Platforms: WP7SL, WP8SL, WinRT(Universal), SL5, WPF

Provides methods to register an event callback which is called only once.

Methods:
  • Register: Registers an event which is called only once and then deregistered:
SingleEvent.Register(element,
	(e, h) => e.LostFocus += h,
	(e, h) => e.LostFocus -= h,
	OnLostFocus);

// TODO: Implement OnLostFocus method which is called only once and deregistred automatically. 
  • WaitForEventAsync (WinRT only): Used to wait for an event:
var args = await SingleEvent.WaitForEventAsync(element,
	(element, handler) => element.LostFocus += handler,
	(element, handler) => element.LostFocus -= handler);

Last edited Jun 3, 2015 at 11:01 PM by rsuter, version 15