Standalone NHaml
Quite a few people have asked me how to use NHaml outside of ASP.NET MVC. Here’s how to do it:
1) Create your project and add a reference to MvcContrib.NHamlViewEngine
2) Use code like the following to compile and render a template.
var templateCompiler = new TemplateCompiler(); var viewType = templateCompiler.Compile("MyTemplate.haml"); var view = (ICompiledView)Activator.CreateInstance(viewType); string output = view.Render();
In this case the haml template is located in the same folder as the application.
As always, a good way to figure this stuff out is to take a look at the unit tests. In this case I copied the code verbatim from the NHaml TestFixtureBase class.
Announcing WPF Elements
Today we were proud to announce the release of WPF Elements, a collection of foundational WPF components, missing from the built-in controls that ship with WPF, but no less essential in the toolbox of any self-respecting WPF developer.
The controls, crafted with care by our resident WPF guru and C# MVP, include:
- WPF Multicolumn TreeView control (aka WPF TreeListView)
- WPF Currency Text box (supports cultures too, passes the Turkey test)
- WPF Integer Text box
- WPF Numeric Text box
- WPF Masked Text box
- WPF DateTimePicker
- WPF DropDownDatePicker
- WPF MonthCalendar
- WPF Spin control (aka up-down control)
- WPF SpinDecorator
- WPF DropDownEditBox
- WPF ProportionalStackPanel
So download the trial and enjoy.


