简体   繁体   中英

Bullets in a Xaml Tooltip

Everything is in the title. I'd like to be able to add some bullet list in a Tooltip but so far haven't found any simple way.

thanks in advance!

You want to use the BulletDecorator as part of the ToolTip . Example:

      <ToolTip>
        <BulletDecorator>
          <BulletDecorator.Bullet>
            <Ellipse Height="10" Width="10" Fill="Blue"/>
          </BulletDecorator.Bullet>
          <TextBlock>Text with a bullet!</TextBlock>
        </BulletDecorator>
      </ToolTip>

For more information, see http://msdn.microsoft.com/en-us/library/system.windows.controls.primitives.bulletdecorator(v=vs.100).aspx

you must have a custom tooltip for this

a nice blog example http://stevenhollidge.blogspot.co.il/2012/04/custom-tooltip-and-popup.html

microsoft info http://msdn.microsoft.com/en-us/library/ms745107.aspx

just put somekind of rich textbox or listbox in the content...

Just a guess:
Why don't use unicode characters (0x2981 for example) and \\r\\n for lie breaks?

I got it displaying correctly with the following:

<ListView
        x:Name="listView"
        Margin="0,-5,0,0"
        BackgroundColor="Transparent"
        HasUnevenRows="True"
        HeightRequest="50"
        HorizontalOptions="CenterAndExpand"
        ItemsSource="{Binding TradingHoursList}"
        SeparatorColor="Transparent">
    <ListView.ItemTemplate>
        <DataTemplate>
            <ViewCell>
                <RelativeLayout>
                    <Label Text="&#x2022;"/>
                    <Label
                            Margin="10,0,0,0"
                            FontAttributes="Italic"
                            FontFamily="Arial Black"
                            FontSize="15"
                            HorizontalOptions="Start"
                            Text="{Binding}"
                            VerticalOptions="Start"/>
                </RelativeLayout>
            </ViewCell>
        </DataTemplate>
    </ListView.ItemTemplate>
</ListView>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM