Provides the ability to perform a method or a constructor call declaratively in XAML,
with explicit control of the moment when the call should be performed.
Namespace:
C1.WPF.C1ScheduleAssembly: C1.WPF.C1Schedule (in C1.WPF.C1Schedule.dll)
Syntax
C# |
---|
public class MethodCaller : FrameworkElement, IWeakEventListener |
Visual Basic (Declaration) |
---|
Public Class MethodCaller _ Inherits FrameworkElement _ Implements IWeakEventListener |
Remarks
The MethodCaller class provides the behavior that is similar
to the standard ObjectDataProvider class, but defines its properties as
DependencyProperties, which allows you to conveniently bind to them and use them in
Triggers Setters. This class is derived from the FrameworkElement class,
thus it can be placed in the XAML visual tree which allows bindings to the class
properties to work correctly.
In addition to a functionality provided by the ObjectDataProvider class, the MethodCaller provides the following features:
- The MethodParameters0, MethodParameters1 and so on dependency properties (instead of a collection of parameters in the ObjectDataProvider class) that allow you to define method parameters via binding.
- The Boolean Call dependency property. A method or a constructor call is performed by the MethodCaller object when this property changes its value from False to True. It can be set from within a trigger or, for example, bound to the Button.IsPressed property - that is, a time when the method called is fully controlled.
- The Boolean PermanentCall property, which is being set to True forces the MethodCaller to work in the same manner as the ObjectDataProvider does - that is, perform a call each time one of its properties has been changed.
Inheritance Hierarchy
System..::..Object
System.Windows.Threading..::..DispatcherObject
System.Windows..::..DependencyObject
System.Windows.Media..::..Visual
System.Windows..::..UIElement
System.Windows..::..FrameworkElement
C1.WPF.C1Schedule..::..MethodCaller
System.Windows.Threading..::..DispatcherObject
System.Windows..::..DependencyObject
System.Windows.Media..::..Visual
System.Windows..::..UIElement
System.Windows..::..FrameworkElement
C1.WPF.C1Schedule..::..MethodCaller