May 2004 - Posts

  • What Happened to SimpleText?

    Amit Bahree asks :

    I was curious as to what happeend to the class SimpleText in the WinHEC build? If I have any code that ran on the earlier build - now does now and I get an exception on SimpleText.

    We removed SimpleText from the builds a short while after the PDC. You should use the Text element instead. We introduced the Text.TextContent property (of type String) after the PDC to provide easy support for binding (we also provide some storage optimizations when displaying a simple string of text.

    We already see a significant amount of user confusion between Text and TextPanel, having a third text control was a bit much (we'd like to only have one, but there are some performance and implementation issues that make that difficult to achieve). SimpleText was introduced as a stopgap to provide good performance and databinding capabilities for displaying text before the PDC, once the functionality was made available in Text, we removed SimpleText.

  • DockPanel.Dock

    Filed under: ,

    Karsten's Avalon Gotcha Quiz (and answer) points to a common source of confusion for DockPanel users:

    When Avalon encounters the "Fill" command, it does just that -- filling the entirety of the given element no matter what follows that element. So though I logically expected the placement of the following TextPanel to carve its location, it gets overriden by the earlier Fill command.

    DockPanel lays all of its children out in markup order (i.e. the order in which they appear on the Children collection), so if you tell a child to Fill it will take up all the remaining space, even though other children still remain.

    Another strategy (which other toolkits have done) is to go in a fixed order when docking, i.e. first layout all children that are docked top, then bottom, then left, etc. This makes some scenarios impossible without nesting DockPanels (e.g. Left, Top, Right), and did not provide clear gains for developers.

    Docking Fill children last would be inconsistent with the behavior of other values, but it seems to be what many users expect.

    We've been considering this change, any thoughts (pro or con)?