Dumping direction is intrinsically vertical (top -> down), so everything works as expected (remove dcMain and you will get the same result). It you need horizontal dump, use Util.HorizontalRun as you did.
PS Could you please post code for code and not screenshots?
var dcMain = new DumpContainer().Dump();
var dc1 = new DumpContainer();
var dc2 = new DumpContainer();
dcMain.AppendContent(dc1, true);
dcMain.AppendContent(dc2, true);
dc1.AppendContent("Container1 111");
dc1.AppendContent("Container1 222");
dc1.AppendContent("COntainer1 333");
dc2.AppendContent("Container2 AAA");
dc2.AppendContent("Container2 BBB");
dc2.AppendContent("Container2 CCC");
dc2.AppendContent("Container2 DDD");
Code 2 My tricky way
var dcMain = new DumpContainer().Dump();
var dc1 = new DumpContainer();
var dc2 = new DumpContainer();
dcMain.AppendContent(Util.HorizontalRun(null, dc1, dc2));
dc1.AppendContent("Container1 111");
dc1.AppendContent("Container1 222");
dc1.AppendContent("COntainer1 333");
dc2.AppendContent("Container2 AAA");
dc2.AppendContent("Container2 BBB");
dc2.AppendContent("Container2 CCC");
dc2.AppendContent("Container2 DDD");
because by document, DumpContainer.AppendContent() set second parameter to true will make inline dump.
and it work for other object.
But while object is DumpContainer, it's not work.
DumpContainer dc = new DumpContainer().Dump();
dc.AppendContent("abc",true);
dc.AppendContent(new Button("Run"),true);
dc.AppendContent("def",true);
which is correct because container itself is a block element (div), and not inline (span). You can change it by modifying the Style property. However, I think that using Util.HorizontalRun is better solution than this one.
var dcMain = new DumpContainer().Dump();
var dc1 = new DumpContainer { Style = "vertical-align: top; display: inline-block" };
var dc2 = new DumpContainer { Style = "vertical-align: top; display: inline-block" };
dcMain.AppendContent(dc1, true);
dcMain.AppendContent(dc2, true);
dc1.AppendContent("Container1 111");
dc1.AppendContent("Container1 222");
dc1.AppendContent("COntainer1 333");
dc2.AppendContent("Container2 AAA");
dc2.AppendContent("Container2 BBB");
dc2.AppendContent("Container2 CCC");
dc2.AppendContent("Container2 DDD");
Comments
Dumping direction is intrinsically vertical (top -> down), so everything works as expected (remove
dcMain
and you will get the same result). It you need horizontal dump, useUtil.HorizontalRun
as you did.PS Could you please post code for
code
and not screenshots?Code 1 which not work
Code 2 My tricky way
because by document, DumpContainer.AppendContent() set second parameter to true will make inline dump.
and it work for other object.
But while object is DumpContainer, it's not work.
This
renders to
which is correct because container itself is a block element (
div
), and not inline (span
). You can change it by modifying theStyle
property. However, I think that usingUtil.HorizontalRun
is better solution than this one.