locked
Best way to separate UI content from application code RRS feed

  • Question

  • Hi,

    I'm designing an application that is mainly a data capture UI, where the question set is complex with a lot of validation and dynamic content (e.g. if user replies 'no' to a question rather than yes, different controls should be displayed).

    The question set is also liable to change over time, as it is related to lists of values generated by third parties and the addition or deletion of questions.

    My initial thought was to have all the UI held in versioned XAML files - once a day, at a scheduled time, the application will contact a server to check whether there is a newer version of the UI/question set and download content where necessary.

    Validation and other fuctionality would be compiled into the code of the application - it's the questions and the validation values that need to be easily updated via a downloadable format.

    As a WPF newbie, does this look like a good idea for doing this? Or is downloading all the XAML each time a bit redundant? I thought about just downloading the question/validation data as a custom XML format and then using a stylesheet to transform it into XAML on the client - is that a better way to go?

    Any tips or suggestions would be hugely appreciated!

    Monday, August 9, 2010 9:43 AM

Answers

  • Hi Hypercubic,

    Yes, I also agree that put the question/validation data in a xml file would be a better choice, and we can even bind xml data to our WPF application.

    There’s a solution about Binding to XML in the link as follows:
    http://joshsmithonwpf.wordpress.com/2007/06/04/binding-to-xml/

    Hope this helps.

    Best regards,
    Kevin Pan


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by Kevin Pan Monday, August 16, 2010 2:01 AM
    Wednesday, August 11, 2010 1:18 PM

All replies

  • Hi Hypercubic,

    Yes, I also agree that put the question/validation data in a xml file would be a better choice, and we can even bind xml data to our WPF application.

    There’s a solution about Binding to XML in the link as follows:
    http://joshsmithonwpf.wordpress.com/2007/06/04/binding-to-xml/

    Hope this helps.

    Best regards,
    Kevin Pan


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by Kevin Pan Monday, August 16, 2010 2:01 AM
    Wednesday, August 11, 2010 1:18 PM
  • Hi Kevin,

    Many thanks for that link! I will read it and try and do some experiments with the concepts.


    Regards,

    Matt

    Friday, August 13, 2010 2:05 PM