![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Dynamic Form in WPF Hi there - I need to build a WPF form dynamically based on a collection of objects. This collection is of varying length and the objects vary also - sometimes there may be several bits of text that need their textboxes (and corresponding labels) created; sometimes there may be a date that needs a datebox. I've made progress using StackPanel.Children.Add(obj), and adding the label item to the "label side" stackpanel and the object to the element side, but that seems like a very code-heavy approach -- WinForms-ish, even (though admittedly I'm not much of a Win dev, and I'm a WPF rookie). So my question is this: it seems like everything I've seen from WPF indicates that I should be able to databind on that collection and use some sort of binding templates to, say, call up the textbox template when I need a textbox, the datepicker when I have a date, radio for boolean, etc. Ideally, those templates would also contain validation templates for each control type.But I can't find examples of this or very clear guidance. There are many different questions here, and too many variables for a clear, succinct answer, but any help would be very much appreciated. I've tried the heavy backend coding to just make progress and get the elements on the page, and I've even considered analyzing the collection and using XSLT to dynmically create an entire XAML page (if it's possible to process that page after a transformation). But again, it seems like there's something simple and elegant and built-in that I must be missing. Again, I'm a WPF rookie over from the web/SQL world. ![]() Thanks very much, Sean |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| VB.NET: dynamic css | .NET General | |||
| dynamic loaded ascx delegate event not firing in parent form | .NET General | |||
| Can't set up Dynamic Drive | Vista installation & setup | |||
| Dynamic Backgrounds | Live Messenger | |||