locked
RichTextBlock Bullet list

    Question

  • I'm sure there is a simple answer to this, but I haven't found it yet.

    I'm building a c#/XAML Windows Store app and I need to display a screen of hard coded text.

    How do I use a RichTextBlock to display a few paragraphs with occasional bullet points?  The equivalent of the HTML <ul> tag?

    Thanks in advance,

    Shane Michelon


    Shane Michelon

    Monday, October 8, 2012 7:10 AM

Answers

  • I think I have answered my own question! It isn't as tidy as HTML, but here is what I have done:

           <RichTextBlock 
                HorizontalAlignment="Left" 
                Margin="50,276,0,0" 
                VerticalAlignment="Top" 
                MaxWidth="507" 
                MinWidth="300"
                FontSize="18" Height="480"
                
                >
                <Paragraph FontSize="24" Margin="0,0,0,16"  >
                    Welcome to <Bold>XXX</Bold>
                </Paragraph>
                <Paragraph Margin="0,0,0,16" >
                    Blah Blah Blah!            </Paragraph>
                <Paragraph Margin="0,0,0,16" >
                    MOre Blah:
                </Paragraph>
                <Paragraph Margin="25,0,0,16" TextIndent="-25" >
                    &#x27A4; Bullet point 1            </Paragraph>
                <Paragraph  Margin="25,0,0,16" TextIndent="-25">
                    &#x27A4; Bullet point 2            </Paragraph>
             
                
            </RichTextBlock>


    Shane Michelon

    • Proposed as answer by ulcer Monday, October 8, 2012 11:53 AM
    • Marked as answer by Jesse Jiang Tuesday, October 16, 2012 8:36 AM
    Monday, October 8, 2012 8:02 AM

All replies

  • Select marcket style from TextMarkerStyle Enumeration
    <List MarkerStyle="Disc">
        <ListItem>
            <Paragraph>First</Paragraph>
        </ListItem>
        <ListItem>
            <Paragraph>Second</Paragraph>
        </ListItem>
        <ListItem>
            <Paragraph>etc</Paragraph>
        </ListItem>
    </List>

    Monday, October 8, 2012 8:00 AM
  • I think I have answered my own question! It isn't as tidy as HTML, but here is what I have done:

           <RichTextBlock 
                HorizontalAlignment="Left" 
                Margin="50,276,0,0" 
                VerticalAlignment="Top" 
                MaxWidth="507" 
                MinWidth="300"
                FontSize="18" Height="480"
                
                >
                <Paragraph FontSize="24" Margin="0,0,0,16"  >
                    Welcome to <Bold>XXX</Bold>
                </Paragraph>
                <Paragraph Margin="0,0,0,16" >
                    Blah Blah Blah!            </Paragraph>
                <Paragraph Margin="0,0,0,16" >
                    MOre Blah:
                </Paragraph>
                <Paragraph Margin="25,0,0,16" TextIndent="-25" >
                    &#x27A4; Bullet point 1            </Paragraph>
                <Paragraph  Margin="25,0,0,16" TextIndent="-25">
                    &#x27A4; Bullet point 2            </Paragraph>
             
                
            </RichTextBlock>


    Shane Michelon

    • Proposed as answer by ulcer Monday, October 8, 2012 11:53 AM
    • Marked as answer by Jesse Jiang Tuesday, October 16, 2012 8:36 AM
    Monday, October 8, 2012 8:02 AM
  • Thanks for the reply

    I am not sure how you would use this.  There is no xaml control called List.  I get an error if I try to add a <List> element to the RichTextBlock control.  Are you sure this is part of the XAML language for Windows Store Apps?

    I have just done some more reading and I think you are referring to the FlowDocument of WPF rather than Windows Store Apps. Is that correct?


    Shane Michelon


    Monday, October 8, 2012 8:10 AM
  • Sorry, FlowDocument not supported in windows 8.
    Monday, October 8, 2012 9:15 AM
  • Hey 'll u please tell me whether u got answer for this or not... ryt now i'm searching for this.... please reply me.... waiting for ur reply
    Tuesday, November 6, 2012 7:31 AM