Back to Devexpress

ShapeTitleOptions.Pattern Property

wpf-devexpress-dot-xpf-dot-map-dot-shapetitleoptions-e2e15d84.md

latest2.9 KB
Original Source

ShapeTitleOptions.Pattern Property

Gets or sets a pattern that is used to specify a name for each shape title.

Namespace : DevExpress.Xpf.Map

Assembly : DevExpress.Xpf.Map.v25.2.dll

NuGet Package : DevExpress.Wpf.Map

Declaration

csharp
public string Pattern { get; set; }
vb
Public Property Pattern As String

Property Value

TypeDescription
String

A String value that defines the text of shape titles.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to Pattern
MapShapeBase

.TitleOptions .Pattern

| | VectorLayer |

.ShapeTitleOptions .Pattern

|

Remarks

Attributes can be used to specify the title pattern of a map shape. To use an attribute in the pattern, specify its value in braces. For instance, to use an attribute with the name Name , set {Name} to the Pattern property.

Example

The following example demonstrates how to customize the map shape title.

To customize a title, do the following.

xaml
<dxm:ShapeTitleOptions x:Key="titleOptions" 
                       Pattern="{}{Name}" Visible="True">
    <dxm:ShapeTitleOptions.Template>
        <DataTemplate>
            <TextBlock Text="{Binding Text}"
                       Foreground="Blue" Margin="0,0,0,20"/>
        </DataTemplate>
    </dxm:ShapeTitleOptions.Template>
</dxm:ShapeTitleOptions>
                    <dxm:MapDot Location="51.507222, -0.1275" Size="10" Fill="Red" 
                                TitleOptions="{StaticResource titleOptions}">
                        <dxm:MapDot.Attributes>
                            <dxm:MapItemAttribute Name="Name" Value="London"/>
                        </dxm:MapDot.Attributes>
                    </dxm:MapDot>

See Also

ShapeTitleOptions Class

ShapeTitleOptions Members

DevExpress.Xpf.Map Namespace