However, I can't seem to use master layouts in this scenario; my view
renders, but without the content from the master.
Am I doing something wrong, or can I not use "<use master ...'>" when
the templates are sourced from embedded resources?
------ myview.spark ------
<use master="master.spark" />
My view goes here
------ master.spark ------
<div>Start of Master</div>
<use content="view" />
<div>End of Master</div>
------ myRenderer.cs------
var view = (SparkView)m_engine.CreateInstance(
new SparkViewDescriptor()
.AddTemplate("master.spark")
.AddTemplate("myview.spark")
);
using (var writer = new StringWriter()) {
view.RenderView(writer);
return writer.ToString();
}
Also - try changing the order of the templates. IIRC they should be
innermost-first.
Allowing views to specify their own master via the <use> element is a
better fit for my requirements, but I can't get it to work that way
regardless of whether or not I programmatically add the master
template to the view descriptor. Is there any reason that <use> just
won't work in a direct-usage scenario? If not, where should I begin
troubleshooting?
Thanks!