WPF more dynamic views and DataAnnotations
Posted
by
Ingó Vals
on Programmers
See other posts from Programmers
or by Ingó Vals
Published on 2012-02-08T16:18:54Z
Indexed on
2012/11/05
17:17 UTC
Read the original article
Hit count: 420
Comparing WPF and Asp.Net Razor/HtmlHelper I find WPF/Xaml to be somewhat lacking in creating views.
With HtmlHelpers you could define in one place how you wan't to represent specific type of data and include elements set from the DataAnnotations of the property.
In WPF you can also define DataTemplates for data but it seems much more limited then EditorTemplates. It doesn't use information from DataAnnotations.
Also the layout of elements can be bothersome. I hate having to constantly add RowDefinitions and update the Grid.Row attribute of lot of elements when I add a new property somewhere in line.
I understand that GUI programming can be a lot of grunt work like this but as Asp.Net MVC has shown there are ways around that.
What solutions are out there to make view creation in WPF a little bit cleaner, maintainable and more dynamic?
© Programmers or respective owner