Skip to content

Forge.Forms.FormBuilding

redbaty edited this page Feb 16, 2018 · 1 revision

BindingOptions

public class Forge.Forms.FormBuilding.BindingOptions

Properties

Type Name Summary
CultureInfo ConverterCulture
Int32 Delay
String StringFormat
UpdateSourceTrigger UpdateSourceTrigger
Boolean ValidatesOnDataErrors
Boolean ValidatesOnExceptions
Boolean ValidatesOnNotifyDataErrors

Methods

Type Name Summary
void Apply(Binding binding)

BindingProvider

Default implementation of Forge.Forms.FormBuilding.IBindingProvider.

public abstract class Forge.Forms.FormBuilding.BindingProvider
    : Control, IResource, IAnimatable, IInputElement, IFrameworkInputElement, ISupportInitialize, IHaveResources, IQueryAmbient, IBindingProvider

Properties

Type Name Summary
IResourceContext Context Gets the context associated with the form control.
IDictionary<String, IValueProvider> FieldResources Gets the field resources identified by name.
IDictionary<String, IValueProvider> FormResources Gets the form resources identified by name.
BindingProxy Item Returns a Forge.Forms.DynamicExpressions.BindingProxy bound to the value returned by Forge.Forms.FormBuilding.BindingProvider.ProvideValue(System.String).
Boolean ThrowOnNotFound Gets whether this object will throw when a resource is not found.

Methods

Type Name Summary
void BindingCreated(BindingExpressionBase expression, String resource)
Object ProvideValue(String name) Resolves the value for the specified resource. The result may be a System.Windows.Data.BindingBase or a literal value.

ContentElement

public abstract class Forge.Forms.FormBuilding.ContentElement
    : FormElement

Properties

Type Name Summary
IValueProvider Content
IValueProvider Icon
IValueProvider IconPadding

Methods

Type Name Summary
void Freeze()

ConversionCulture

public static class Forge.Forms.FormBuilding.ConversionCulture

Static Fields

Type Name Summary
Dictionary<String, CultureInfo> CustomCultures Stores custom cultures which can be used for date and number conversion.

Static Methods

Type Name Summary
CultureInfo Get(String name)
void Set(String name, CultureInfo cultureInfo)

DataFormField

Base class for all input fields.

public abstract class Forge.Forms.FormBuilding.DataFormField
    : FormField

Properties

Type Name Summary
BindingOptions BindingOptions
Boolean CreateBinding
IValueProvider DefaultValue Gets or sets the default value for this field.
Boolean IsDirectBinding
IValueProvider IsReadOnly
Type PropertyType
IValueProvider SelectOnFocus
List<IValidatorProvider> Validators

Methods

Type Name Summary
void Freeze()
Object GetDefaultValue(IResourceContext context)

Deserializers

public static class Forge.Forms.FormBuilding.Deserializers

Static Methods

Type Name Summary
Object Boolean(String expression)
Object Boolean(String expression, CultureInfo culture)
Object Byte(String expression)
Object Byte(String expression, CultureInfo culture)
Object Char(String expression)
Object Char(String expression, CultureInfo culture)
Object CultureInvariantBoolean(String expression, CultureInfo culture)
Object CultureInvariantByte(String expression, CultureInfo culture)
Object CultureInvariantChar(String expression, CultureInfo culture)
Object CultureInvariantDateTime(String expression, CultureInfo culture)
Object CultureInvariantDecimal(String expression, CultureInfo culture)
Object CultureInvariantDouble(String expression, CultureInfo culture)
Object CultureInvariantInt16(String expression, CultureInfo culture)
Object CultureInvariantInt32(String expression, CultureInfo culture)
Object CultureInvariantInt64(String expression, CultureInfo culture)
Object CultureInvariantNullableBoolean(String expression, CultureInfo culture)
Object CultureInvariantNullableByte(String expression, CultureInfo culture)
Object CultureInvariantNullableChar(String expression, CultureInfo culture)
Object CultureInvariantNullableDateTime(String expression, CultureInfo culture)
Object CultureInvariantNullableDecimal(String expression, CultureInfo culture)
Object CultureInvariantNullableDouble(String expression, CultureInfo culture)
Object CultureInvariantNullableInt16(String expression, CultureInfo culture)
Object CultureInvariantNullableInt32(String expression, CultureInfo culture)
Object CultureInvariantNullableInt64(String expression, CultureInfo culture)
Object CultureInvariantNullableSByte(String expression, CultureInfo culture)
Object CultureInvariantNullableSingle(String expression, CultureInfo culture)
Object CultureInvariantNullableUInt16(String expression, CultureInfo culture)
Object CultureInvariantNullableUInt32(String expression, CultureInfo culture)
Object CultureInvariantNullableUInt64(String expression, CultureInfo culture)
Object CultureInvariantSByte(String expression, CultureInfo culture)
Object CultureInvariantSingle(String expression, CultureInfo culture)
Object CultureInvariantUInt16(String expression, CultureInfo culture)
Object CultureInvariantUInt32(String expression, CultureInfo culture)
Object CultureInvariantUInt64(String expression, CultureInfo culture)
Object DateTime(String expression)
Object DateTime(String expression, CultureInfo culture)
Object Decimal(String expression)
Object Decimal(String expression, CultureInfo culture)
Object Double(String expression)
Object Double(String expression, CultureInfo culture)
Func<String, Object> Enum()
Func<String, Object> Enum(Type enumType)
Func<String, Object> Enum(Type enumType, Boolean ignoreCase)
Object Int16(String expression)
Object Int16(String expression, CultureInfo culture)
Object Int32(String expression)
Object Int32(String expression, CultureInfo culture)
Object Int64(String expression)
Object Int64(String expression, CultureInfo culture)
Object NullableBoolean(String expression)
Object NullableBoolean(String expression, CultureInfo culture)
Object NullableByte(String expression)
Object NullableByte(String expression, CultureInfo culture)
Object NullableChar(String expression)
Object NullableChar(String expression, CultureInfo culture)
Object NullableDateTime(String expression)
Object NullableDateTime(String expression, CultureInfo culture)
Object NullableDecimal(String expression)
Object NullableDecimal(String expression, CultureInfo culture)
Object NullableDouble(String expression)
Object NullableDouble(String expression, CultureInfo culture)
Object NullableInt16(String expression)
Object NullableInt16(String expression, CultureInfo culture)
Object NullableInt32(String expression)
Object NullableInt32(String expression, CultureInfo culture)
Object NullableInt64(String expression)
Object NullableInt64(String expression, CultureInfo culture)
Object NullableSByte(String expression)
Object NullableSByte(String expression, CultureInfo culture)
Object NullableSingle(String expression)
Object NullableSingle(String expression, CultureInfo culture)
Object NullableUInt16(String expression)
Object NullableUInt16(String expression, CultureInfo culture)
Object NullableUInt32(String expression)
Object NullableUInt32(String expression, CultureInfo culture)
Object NullableUInt64(String expression)
Object NullableUInt64(String expression, CultureInfo culture)
Object SByte(String expression)
Object SByte(String expression, CultureInfo culture)
Object Single(String expression)
Object Single(String expression, CultureInfo culture)
Object String(String expression)
Object UInt16(String expression)
Object UInt16(String expression, CultureInfo culture)
Object UInt32(String expression)
Object UInt32(String expression, CultureInfo culture)
Object UInt64(String expression)
Object UInt64(String expression, CultureInfo culture)

DynamicProperty

public class Forge.Forms.FormBuilding.DynamicProperty
    : IFormProperty

Properties

Type Name Summary
Boolean CanWrite
Type DeclaringType
String Name
Type PropertyType

Methods

Type Name Summary
T GetCustomAttribute()
IEnumerable<T> GetCustomAttributes()

FormBindingExtension

Markup extension for creating deferred bindings.

public class Forge.Forms.FormBuilding.FormBindingExtension
    : MarkupExtension

Properties

Type Name Summary
String Converter
String Name

Methods

Type Name Summary
Object ProvideValue(IServiceProvider serviceProvider)

FormBuilder

Configurable object responsible for creating form definitions from types.

public class Forge.Forms.FormBuilding.FormBuilder
    : IFormBuilder

Properties

Type Name Summary
List<IFieldInitializer> FieldInitializers
Dictionary<Type, IFormDefinition> Primitives Contains prebuilt definitions for primitive types. Types stored here will bypass form generation process. Initially, value types and strings are stored here.
List<IFieldBuilder> PropertyBuilders Gets the list of registered field builders which are queried first.
Dictionary<Type, List<IFieldBuilder>> TypeBuilders Gets the mapping of types to respective field builders. These are queried if no field builder from Forge.Forms.FormBuilding.FormBuilder.PropertyBuilders succeeds in creating an element.
Dictionary<Type, Func<String, Object>> TypeDeserializers Stores functions to parse string representations of types.
Dictionary<String, Type> TypeNames

Methods

Type Name Summary
void ClearCache() Clears cached form definitions. This may be necessary when current configuration has changed.
Boolean ClearCached()
IFormDefinition GetDefinition(Type type) Gets the Forge.Forms.FormBuilding.FormDefinition for the provided type. The cache is looked up first before generating the form.
IFormDefinition GetDefinition(String xml) Gets the Forge.Forms.FormBuilding.FormDefinition for the provided type. The cache is looked up first before generating the form.

Static Fields

Type Name Summary
FormBuilder Default Default instance of Forge.Forms.FormBuilding.FormBuilder.

Static Methods

Type Name Summary
List<IFieldBuilder> <.ctor>g__AsList 2_0(IFieldBuilder[] builders)
void g__AddRow 22_0(FormElement formElement, <>c__DisplayClass22_0& = null)

FormDefinition

public class Forge.Forms.FormBuilding.FormDefinition
    : IFormDefinition

Properties

Type Name Summary
List<FormRow> FormRows
Double[] Grid
Type ModelType
IDictionary<String, IValueProvider> Resources

Methods

Type Name Summary
Object CreateInstance(IResourceContext context)
void Freeze()

FormElement

Represents a form element, which is not necessarily an input field.

public abstract class Forge.Forms.FormBuilding.FormElement

Properties

Type Name Summary
IValueProvider InitialFocus Gets or sets the bool resource that determines whether this element will receive initial focus.
IValueProvider IsVisible Gets or sets the bool resource that determines whether this element will be visible.
Position LinePosition
IDictionary<String, IValueProvider> Resources

Methods

Type Name Summary
IBindingProvider CreateBindingProvider(IResourceContext context, IDictionary<String, IValueProvider> formResources)
void Freeze()
FormElement FreezeResources()

FormElementContainer

public class Forge.Forms.FormBuilding.FormElementContainer

Properties

Type Name Summary
Int32 Column
Int32 ColumnSpan
List<FormElement> Elements

FormElementsAlignment

public enum Forge.Forms.FormBuilding.FormElementsAlignment
    : Enum, IComparable, IFormattable, IConvertible

Enum

Value Name Summary
0 Stretch
1 Left
2 Right

FormField

Base class for all form field definitions.

public abstract class Forge.Forms.FormBuilding.FormField
    : FormElement

Properties

Type Name Summary
IValueProvider Icon Gets or sets the field's PackIconKind resource. Not all controls may display an icon.
String Key Gets or sets the unique name of this field.
IValueProvider Name Gets or sets the string expression of the field's title.
IValueProvider ToolTip Gets or sets the string expression of the field's tooltip.

Methods

Type Name Summary
void Freeze() Finalizes the field state by adding all appropriate values as resources. Changing properties after this method has been called is strongly discouraged.

FormRow

public class Forge.Forms.FormBuilding.FormRow

Properties

Type Name Summary
List<FormElementContainer> Elements
Int32 RowSpan
Boolean StartsNewRow

IBindingProvider

Provides bindings by resource name.

public interface Forge.Forms.FormBuilding.IBindingProvider

Properties

Type Name Summary
BindingProxy Item Returns a Forge.Forms.DynamicExpressions.BindingProxy bound to the value returned by Forge.Forms.FormBuilding.IBindingProvider.ProvideValue(System.String).

Methods

Type Name Summary
void BindingCreated(BindingExpressionBase expression, String resource) Gets called when a binding expression is resolved.
Object ProvideValue(String name) Resolves the value for the specified resource. The result may be a System.Windows.Data.BindingBase or a literal value.

IDataBindingProvider

public interface Forge.Forms.FormBuilding.IDataBindingProvider
    : IBindingProvider

Methods

Type Name Summary
void ClearBindings()
IEnumerable<BindingExpressionBase> GetBindings()

IDynamicForm

public interface Forge.Forms.FormBuilding.IDynamicForm

Properties

Type Name Summary
Object Context
Object Model
Object Value

Events

Type Name Summary
EventHandler<ActionEventArgs> OnAction

IEnvironment

public interface Forge.Forms.FormBuilding.IEnvironment
    : IEnumerable<String>, IEnumerable

Properties

Type Name Summary
Boolean Item Returns whether the specified key is contained in this environment.

Methods

Type Name Summary
Int32 Add(IEnumerable<String> values) Adds multiple flags to the environment. Offers a performance benefit for bulk insertions.
Boolean Add(String value) Adds multiple flags to the environment. Offers a performance benefit for bulk insertions.
void Clear() Clears all flags from the environment.
Boolean Has(String key) Returns true if the flag exists in the environment.
Int32 Remove(IEnumerable<String> values) Remove multiple flags from the environment. Offers a performance benefit for bulk deletions.
Boolean Remove(String value) Remove multiple flags from the environment. Offers a performance benefit for bulk deletions.

IFieldBuilder

Intercepts properties and builds form elements if conditions are met.

public interface Forge.Forms.FormBuilding.IFieldBuilder

Methods

Type Name Summary
FormElement TryBuild(IFormProperty property, Func<String, Object> deserializer)

IFieldInitializer

Initializes built form fields.

public interface Forge.Forms.FormBuilding.IFieldInitializer

Methods

Type Name Summary
void Initialize(FormElement element, IFormProperty property, Func<String, Object> deserializer)

IFormBuilder

public interface Forge.Forms.FormBuilding.IFormBuilder

Methods

Type Name Summary
IFormDefinition GetDefinition(Type type)

IFormDefinition

public interface Forge.Forms.FormBuilding.IFormDefinition

Properties

Type Name Summary
IReadOnlyList<FormRow> FormRows
Double[] Grid
Type ModelType
IDictionary<String, IValueProvider> Resources

Methods

Type Name Summary
Object CreateInstance(IResourceContext context)

IFormProperty

public interface Forge.Forms.FormBuilding.IFormProperty

Properties

Type Name Summary
Boolean CanWrite
Type DeclaringType
String Name
Type PropertyType

Methods

Type Name Summary
T GetCustomAttribute()
IEnumerable<T> GetCustomAttributes()

IFrameworkResourceContext

public interface Forge.Forms.FormBuilding.IFrameworkResourceContext
    : IResourceContext

Methods

Type Name Summary
FrameworkElement GetOwningElement()

IResourceContext

Bridges form elements with the control that contains them.

public interface Forge.Forms.FormBuilding.IResourceContext

Properties

Type Name Summary
IEnvironment Environment Gets the Forge.Forms.FormBuilding.IResourceContext.Environment for current context.

Methods

Type Name Summary
void AddResource(Object key, Object value) Adds a resource to the control's resources.
Binding CreateContextBinding(String path) Creates a new binding to the form context object.
Binding CreateDirectModelBinding() Creates a binding to the raw model.
Binding CreateModelBinding(String path) Creates a new binding to the form model object.
Object FindResource(Object key) Locates a resource from the control's resources.
BindingExpressionBase[] GetBindings() Gets all bindings for the current model
Object GetContextInstance() Gets current context instance.
Object GetModelInstance() Gets current model instance.
void OnAction(IActionContext actionContext) Notifies that an action has occurred.
Object TryFindResource(Object key) Tries to locate a resource from the control's resources.

IValueProvider

public interface Forge.Forms.FormBuilding.IValueProvider

Methods

Type Name Summary
BindingBase ProvideBinding(IResourceContext context)
Object ProvideValue(IResourceContext context)

RegexReplacement

public class Forge.Forms.FormBuilding.RegexReplacement

Properties

Type Name Summary
IValueProvider Pattern
IValueProvider RegexOptions
IValueProvider Replacement

Methods

Type Name Summary
CompiledRegexReplacement Compile(IResourceContext context)

ReplacementPipe

public class Forge.Forms.FormBuilding.ReplacementPipe

Methods

Type Name Summary
Func<String, CultureInfo, Object> CreateDeserializer(IResourceContext context)

StringTypeConverter

public class Forge.Forms.FormBuilding.StringTypeConverter
    : IValueConverter

Methods

Type Name Summary
Object Convert(Object value, Type targetType, Object parameter, CultureInfo culture)
Object ConvertBack(Object value, Type targetType, Object parameter, CultureInfo culture)

ValueBindingProvider

Single source data binding provider that captures resources with name "Value".

public class Forge.Forms.FormBuilding.ValueBindingProvider
    : BindingProvider, IResource, IAnimatable, IInputElement, IFrameworkInputElement, ISupportInitialize, IHaveResources, IQueryAmbient, IBindingProvider, IDataBindingProvider

Properties

Type Name Summary
BindingExpressionBase CurrentBindingExpression

Methods

Type Name Summary
void BindingCreated(BindingExpressionBase expression, String resource)
void ClearBindings()
IEnumerable<BindingExpressionBase> GetBindings()

ValueProviderExtensions

public static class Forge.Forms.FormBuilding.ValueProviderExtensions

Static Methods

Type Name Summary
IProxy GetBestMatchingProxy(this IValueProvider valueProvider, IResourceContext context)
BoolProxy GetBoolValue(this IValueProvider valueProvider, IResourceContext context)
StringProxy GetStringValue(this IValueProvider valueProvider, IResourceContext context)
StringProxy GetStringValue(this IValueProvider valueProvider, IResourceContext context, Boolean setKey)
BindingProxy GetValue(this IValueProvider valueProvider, IResourceContext context)
IValueProvider Wrap(this IValueProvider valueProvider, String valueConverter)
Clone this wiki locally