Version

XamCalculationManager Class

Provides formula calculation functionality to controls.
Syntax
'Declaration
 
Public Class XamCalculationManager 
   Inherits System.Windows.FrameworkElement
   Implements ICalculationManager 
public class XamCalculationManager : System.Windows.FrameworkElement, ICalculationManager  
Remarks

The XamCalculationManager creates a calculation network of objects and controls that provide source values for formula calculations as well as can be targets of formula calculation results.

  • A NamedReference specified via XamCalculationManager's NamedReferences collection lets you define a value that can then be referred to in formulas of other objects using its name. A NamedReference can also have a formula associated with it in which case its value will be the formula calculation result.
  • A control like a TextBox (or any DependencyObject) can be a source of values for other formulas as well as target of a formula calculation result. By default the control's Name (FrameworkElement.Name) is used to refer to it in formulas of other objects. To include a control in calculation network you need to specify XamCalculationManager's CalculationManagerProperty and ControlSettingsProperty attached properties on the control.
  • XamDataPresenter's and XamDataGrid's fields/columns and their summaries can participate in calculation network. A field/column/summary can be assigned a formula that derives its values from other field/column/summary values, as well as values of external controls and named references.

Note that formulas of objects in the calculation network can refer to values of other objects (even those objects that are also targets of other formula calculations) using their reference path, which usually is the name of the control or named reference or the name of the field/column/summary. The path used in formulas is referred to as reference path, which can be a relative path or an absoluate path. Relative path of controls and named references take the form of "[Name]" and absolute path takes the form of "[//Name]". In case of field/column/summary, relative path is again just the "[Name]" where as the absolute path includes name of the data presenter/grid along with other parts that fully identify a particular field/column/summary.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also