diff --git a/mocha-dotnet/src/lib/Mocha.Core.UI.Server/Commands/ElementCommand.cs b/mocha-dotnet/src/lib/Mocha.Core.UI.Server/Commands/ElementCommand.cs index 18e772a..9f89b65 100644 --- a/mocha-dotnet/src/lib/Mocha.Core.UI.Server/Commands/ElementCommand.cs +++ b/mocha-dotnet/src/lib/Mocha.Core.UI.Server/Commands/ElementCommand.cs @@ -75,6 +75,15 @@ public class ElementCommand : InstanceCommand obj2.Add("widget", JsonValue.Create("root")); obj2.Add("body", widget.ToJSONObject(ctx)); + JsonObject objTitle = new JsonObject(); + string label = oms.GetAttributeValue(widget.ParentInstance, oms.GetInstance(KnownAttributeGuids.Text.Label)); + if (label == null) + { + label = oms.GetInstanceText(widget.ParentInstance); + } + objTitle.Add("label", label); + obj2.Add("title", objTitle); + JsonObject obj = new JsonObject(); obj.Add("result", "success"); obj.Add("value", obj2);