Class DynamicObjectExtension
Can be used to create dynamic objects via markup. This can be used to create data-bound objects purely from Markup. E.g. for the ComboBoxItemDisplayBehavior.EmptyItem.
Namespace: Sartorius.SAF.Presentation.Extensions
Assembly: Sartorius.SAF.Presentation.dll
Syntax
public class DynamicObjectExtension : MarkupExtension
Examples
The following XAML-markup creates an dynamic object with the signature below.
<SAF:DynamicObject x:Key="DynamicEmptyItem">
<SAF:DynamicObject.Members>
<system:String x:Key="Name">Empty Dynamic Item</system:String>
<system:Int32 x:Key="Value">-1</system:Int32>
</SAF:DynamicObject.Members>
</SAF:DynamicObject>
</code>
<code language="C#">
public class DynamicObject
{
public string Name { get; set; }
public int Value { get; set; }
}
Constructors
View SourceDynamicObjectExtension()
Creates a new Instance of DynamicObjectExtension
Declaration
public DynamicObjectExtension()
Properties
View SourceMemberName
Declaration
public string MemberName { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
MemberValue
Declaration
public object MemberValue { get; set; }
Property Value
| Type | Description |
|---|---|
| object |
Members
Declaration
public Dictionary<string, object> Members { get; set; }
Property Value
| Type | Description |
|---|---|
| Dictionary<string, object> |
Methods
View SourceProvideValue(IServiceProvider)
When implemented in a derived class, returns an object that is provided as the value of the target property for this markup extension.
Declaration
public override object ProvideValue(IServiceProvider serviceProvider)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceProvider | serviceProvider | A service provider helper that can provide services for the markup extension. |
Returns
| Type | Description |
|---|---|
| object | The object value to set on the property where the extension is applied. |