WPF Databound Bulleted List

How do I create a databound, bulleted list of hyperlinks in WPF?

I've got this:

<ItemsControl Name="lstScripts">
    <ItemsControl.ItemTemplate>
        <DataTemplate>
            <TextBlock>
                <Hyperlink>
                    <TextBlock Text="{Binding Path=Name}" />
                </Hyperlink>
            </TextBlock>
        </DataTemplate>
    </ItemsControl.ItemTemplate>
</ItemsControl>

But I can't figure out how to turn the items into bullets. I see the BulletDecorator, but I don't want to specify my own bullet image, I just want standard bullets.

Unfortunately there are no "standard bullets"... Here's an example of a simple Ellipse bullet :

        <ItemsControl Name="lstScripts">
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <BulletDecorator Width="Auto">
                        <BulletDecorator.Bullet>
                            <Ellipse Fill="White" Stroke="Black" StrokeThickness="1" Width="8" Height="8"/>
                        </BulletDecorator.Bullet>
                        <TextBlock>
                            <Hyperlink>
                                <TextBlock Text="{Binding Path=Name}" />
                            </Hyperlink>
                        </TextBlock>
                    </BulletDecorator>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>

The ListBox control, Data binding the ListBox. Manually defining items for the ListBox makes for a fine first example, but most of the times, your ListBox controls will be filled with� Hi all This is probably fairly basic. I know the BulletedList control can bind itself to a datasource but when bound it there a way to easily override the DataValue field to say include a URL &#43;

Just to extend @Thomas Levesque's answer a bit, Make it into a UserControl so you can reuse it, e.g.:

<Reporting:BulletedItem BulletText="Bullet Item 1" />
<Reporting:BulletedItem BulletText="Bullet Item 2" />

Create a UserControl:

<UserControl x:Class="MyNameSpace.Reporting.BulletedItem"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" >
    <Grid>
        <ItemsControl >
            <BulletDecorator Width="Auto" Margin="10, 0, 0, 0">
                <BulletDecorator.Bullet>
                    <Ellipse Fill="Black" Stroke="Black" StrokeThickness="1" Width="5" Height="5"/>
                </BulletDecorator.Bullet>
                <TextBlock Margin="5, 0, 0, 0">
                    <TextBlock Text="{Binding BulletText}" />
                </TextBlock>
            </BulletDecorator>
        </ItemsControl>
    </Grid>
</UserControl>

In the code:

public partial class BulletedItem : UserControl
{
    public static readonly DependencyProperty TextProperty = DependencyProperty.Register("BulletText", typeof(string), typeof(BulletedItem));

    public string BulletText
    {
        get { return (string)GetValue(TextProperty); }
        set { SetValue(TextProperty, value); }
    }

    public BulletedItem()
    {
        InitializeComponent();
        this.DataContext = this;
    }
}

WPF Databound Bulleted List, Purtroppo non ci sono "proiettili standard" Ecco un esempio di un semplice proiettile Ellisse: <ItemsControl Name="lstScripts"> <ItemsControl.ItemTemplate> � Renders the bulleted text for each list item in a BulletedList control. RenderChildren(HtmlTextWriter) Outputs the content of a server control's children to a provided HtmlTextWriter object, which writes the content to be rendered on the client.

For all sorts of list you can use the FlowDocument and List. This has a MarkerStyle of "Disc" and one of "Circle."

<FlowDocument>
  <List MarkerStyle="Disc">
    <ListItem>
      <Paragraph>Boron</Paragraph>
    </ListItem>
    <ListItem>
      <Paragraph>Carbon</Paragraph>
    </ListItem>
</<FlowDocument>

There are more details here: https://msdn.microsoft.com/library/aa970909(v=vs.100).aspx

BulletDecorator Class (System.Windows.Controls.Primitives , Represents a layout control that aligns a bullet and another visual object. XAML Copy. <BulletDecorator Grid.Row="1" Grid.Column="0" Margin="0,5,0,0" Gets or sets the data context for an element when it participates in data binding. I am working on a web site and I have included a bulleted list control which I have databound to a xml file to display a list of links. I would like to dress up the links so they look more in accordance to my page theme but in stead what I get is a boring, simple, plain list of links which show as bullet items.

Dressing Up Your Data with WPF DataTemplates, The WPF architects planned for templates in lists just as they did in every other corner See my article, “Flexible and Powerful Data Binding with WPF” in CODE Bread Crumb: Add some hyperlinks and bullets to your template and you have � In this article, we going to implement bullet list as LinkButton. For the data, I am using LINQ TO SQL (DBML). Logic of Implemenation As you know in most list collections, some types of control have DataBound event. What is DataBound Event ? I am using this for: Step by Step Implementation Table Structure

Lists | WPF Controls, The RichEditControl supports numbered, bulleted and multilevel lists. This topic shows how to create and format each list type in code and from� Dim listx As New List() ' Set the space between the markers and list content to 25 DIP. listx.MarkerOffset = 25 ' Use uppercase Roman numerals. listx.MarkerStyle = TextMarkerStyle.UpperRoman ' Start list numbering at 5. listx.StartIndex = 5 ' Create the list items that will go into the list.

Wpf image list, Does anyone know how to databind the . The BulletDecorator control is used to display a single item and bullet in a bulleted list in WPF. NET; Rotating Text in� Possible workaround can be to determine the newly added paragraphs with assigned bulleted list style and apply them the needed spacing. This can be done by attaching to the CommandExecuted event of the RadRichTextBox. You can manipulate the lists using the RadDocument.ListManager. Here is an article explaining the lists in RadRichTextBox.

Comments
  • There are standard bullets in a way. You could use a TextBlock as Bullet to show the Unicode bullet U+2022.