locked
Using XML data source for Button content in Sketchflow RRS feed

  • Question

  • I have a simple XML file that I want to use to populate my the Button Content for a series of buttons in my Sketchflow prototype project.

    I have added the XML to the project and can data bind the correct node to the content of a button but it always displays the first node in the XML.  How do I get it to walk the XML and use each node for each button's content?

    This is just a prototype so I don't want to build a lot of code behind if I don't have to.   Is there a simple way when data binding to the Content of the button to say which record I want to use?

    The XML file is very simple and looks something like this

    <MyXMLData>

    <Process Name="Test1"/>

    <Process Name="Test2"/>

    <Process Name="Test3"/>

    <Process Name="Test4"/>

    </MyXMLData>

    I want to populate 4 defined buttons content with the text from the Name attribute.

    <Button  Style="{DynamicResource Button-Sketch}" Content="{Binding XPath=/MyXMLData/Process/@Name}" />

    <Button  Style="{DynamicResource Button-Sketch}" Content="{Binding XPath=/MyXMLData/Process/@Name}" />

    <Button  Style="{DynamicResource Button-Sketch}" Content="{Binding XPath=/MyXMLData/Process/@Name}" />

    <Button  Style="{DynamicResource Button-Sketch}" Content="{Binding XPath=/MyXMLData/Process/@Name}" />


    Jeff Davis

    Friday, February 15, 2013 11:45 PM

All replies

  • This is part of a larger questions about building a data driven UI.   I want to create a stack of customized buttons with a slider and textbox within the button.  The number of buttons is based on the XML.  When a button is pressed a slideout displays with another variable stack of buttons.   Something like this picture.

       


    Jeff Davis

    Saturday, February 16, 2013 1:43 AM