Question

I want to create a recipe application. I would like the input to look and feel like you are editing a document. If I were doing this in word, I'd create a template form for the user to use for the imput.

The form will look something like:


{Categoty} {Title}
{Image} {yield / nutrition info}

Ingredients
{bulleted list goes here}

Directions
{Numbered list goes here}

Notes / Comments
{Free form text goes here}

I tried doing this with a FlowDocument embedded im a RichTextBox, but could not figure it out. I can store the info and populate the FlowDocument parts easy enough, but I could not figure out how to control editing to force bullets or numbering at certain places / keeping the user from changing the format, etc.

Can this be done in a FlowDocument? If not, how can I create the bulleted / numbered list areas?

Was it helpful?

Solution 2

I ended up creating custom controls for the lists (custom grid supporting bulleted or numbered editable lists and using other controls for the various document parts to give me the control I want - I use an XML file for storing the pieces of the document and how to generate the FlowDocument (I hope this gives me the ease of updating the templates when I am asked to add something new)... I only generate a FlowDocument for printing purposes.

I did not get all the functionality I wanted, but I made it work. Now for my next project..

OTHER TIPS

Flow Documents are editable as long as you use RichTextBox as opposed to Page.

you might want to take a look at this or this or even this

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top