Support for custom dialog content

Quick hack to support custom dialog content.
Example added in DialogTest.