Blob Method Call
Table of Contents
A Blob Method Call is a Method Call that returns a Blob Expression.
- See Methods for explanations of the basics and for Code examples and for the declaration of Method Calls.
See How to use Method Calls for general information on using Method Calls.
Code Example
private IntegerProperty Number => IntegerProperty(null, IntegerDefinition.GetInstance(IntegerSize.Integer, false, maxValue:10));
private ReadOnlyBlobProperty ComposedBlob => CalculatedBlobProperty(ComposeTheBlob);
protected override IUIElement CreateGui()
{
return new VBox
{
new HBox(alignH:AlignH.Fill, alignV:AlignV.Fill)
{
new GroupBox("example")
{
new VBox(2)
{
new Label("number (1 till 10):"),
new TextBox(Number),
new Label("calculated string:"),
new PictureEdit(ComposedBlob, PictureBoxSize.FixedXLarge),
},
},
CodeContent
},
new HBox(alignH:AlignH.Fill)
{
EmptySpace.FillH,
new Button(Close())
}
};
}
private BlobMethodCall ComposeTheBlob()
{
return BlobMethod(() => new Body
{
new If(Number.IsEqualTo(1))
{
new Return(Images.Label.ConvertToBlob())
},
...
new ElseIf(Number.IsEqualTo(10))
{
new Return(Images.Valid.ConvertToBlob())
},
new Else
{
new Return(Images.ByteArray.ConvertToBlob())
}
});
}
Explanation of the code example
- In this example, in line 2, the private property
ComposedBlobis filled with the return value of the Blob Method Call with the nameComposeTheBlob(). - This private property is then in line 19 displayed in a form, using
new Label. - This method is defined in lines 34-54.
Example of the result
A form like the one defined above, could look like this.
When nothing has been entered:

When 10 has been entered:
