DevExpress v24.2 Update — Your Feedback Matters
Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.
Take the survey
Not interested
MapCustomElement.ContentProperty Field
Namespace : DevExpress.Xpf.Map
Assembly :
DevExpress.Xpf.Map.v24.2.dll
NuGet Package :
DevExpress.Wpf.Map
# Declaration
# Field Value
# Example
To customize MapCustomElement , it contains the following properties.
using System ;
using System.Windows ;
namespace MapCustomElement {
public partial class MainWindow : Window {
public MainWindow ( ) {
InitializeComponent();
}
}
class ShipwreckInformation {
public Uri ImageUri { get ; set ; }
public String Name { get ; set ; }
public Int32 Year { get ; set ; }
public String Description { get ; set ; }
}
}
<Window
xmlns ="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x ="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local ="clr-namespace:MapCustomElement"
xmlns:dxm ="http://schemas.devexpress.com/winfx/2008/xaml/map"
x:Class ="MapCustomElement.MainWindow"
Title ="MainWindow" Height ="350" Width ="525" >
<Window.Resources >
<ControlTemplate x:Key ="pushpinTemplate" >
<Border Name ="border" BorderThickness ="2" Padding ="4"
BorderBrush ="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}"
Background ="{DynamicResource {x:Static SystemColors.ControlLightBrushKey}}" >
<ContentControl Content ="{Binding MapItem.Content}"
ContentTemplate ="{Binding MapItem.ContentTemplate}" />
</Border >
<ControlTemplate.Triggers >
<EventTrigger RoutedEvent ="Mouse.MouseEnter" >
<BeginStoryboard >
<Storyboard >
<ColorAnimation Storyboard.TargetProperty ="BorderBrush.Color"
Storyboard.TargetName ="border"
To ="{x:Static SystemColors.HotTrackColor}"
Duration ="0:0:0" />
<ColorAnimation Storyboard.TargetProperty ="Background.Color"
Storyboard.TargetName ="border"
To ="{x:Static SystemColors.HighlightColor}"
Duration ="0:0:0" />
</Storyboard >
</BeginStoryboard >
</EventTrigger >
<EventTrigger RoutedEvent ="Mouse.MouseLeave" >
<BeginStoryboard >
<Storyboard >
<ColorAnimation Storyboard.TargetProperty ="BorderBrush.Color"
Storyboard.TargetName ="border"
To ="{x:Static SystemColors.ControlDarkDarkColor}"
Duration ="0:0:0" />
<ColorAnimation Storyboard.TargetProperty ="Background.Color"
Storyboard.TargetName ="border"
To ="{x:Static SystemColors.ControlLightColor}"
Duration ="0:0:0" />
</Storyboard >
</BeginStoryboard >
</EventTrigger >
</ControlTemplate.Triggers >
</ControlTemplate >
<DataTemplate x:Key ="pushpinContentTemplate" >
<StackPanel Orientation ="Horizontal" >
<Image Source ="{Binding ImageUri}" Width ="32" Height ="32" />
<StackPanel Orientation ="Vertical" >
<TextBlock Text ="{Binding Name}" />
<TextBlock Text ="{Binding Year}" />
</StackPanel >
</StackPanel >
</DataTemplate >
</Window.Resources >
<Grid >
<dxm:MapControl CenterPoint ="-34.5, 151" ZoomLevel ="7" >
<dxm:ImageTilesLayer >
<dxm:BingMapDataProvider BingKey ="YourBingKey" />
</dxm:ImageTilesLayer >
<dxm:VectorLayer >
<dxm:MapItemStorage >
<dxm:MapCustomElement Location ="-34.042876,151.206777"
Template ="{StaticResource pushpinTemplate}"
ContentTemplate ="{StaticResource pushpinContentTemplate}" >
<dxm:MapCustomElement.Content >
<local:ShipwreckInformation
Name ="Koonya" Year ="1898" ImageUri ="Images/Ship.png"
Description ="A steamboat that ran aground off Cronulla Beach." />
</dxm:MapCustomElement.Content >
</dxm:MapCustomElement >
</dxm:MapItemStorage >
</dxm:VectorLayer >
</dxm:MapControl >
</Grid >
</Window >
Imports System
Imports System.Windows
Namespace MapCustomElement
Partial Public Class MainWindow
Inherits Window
Public Sub New ()
InitializeComponent()
End Sub
End Class
Friend Class ShipwreckInformation
Public Property ImageUri() As Uri
Public Property Name() As String
Public Property Year() As Int32
Public Property Description() As String
End Class
End Namespace
See Also