Change Border, Background, Leader Line of Callout

1776
3
05-03-2019 10:23 AM
DJurgella
New Contributor III

Runtime SDK 100.5.

I'm using callouts to show information after a user clicks on the map (MyMapView.ShowCalloutAt), and I've set the content as a custom element, but the callout still has a white border around it, and the leader line is white.  How can I customize the border and leader line of the callout?

0 Kudos
3 Replies
ThadTilton
Esri Contributor

Hi!

You can't set the properties of the callout shown using GeoView.ShowCalloutAt. You can, however, create a Callout object, set its display properties, and add it to the map view. Here's an example:

// Create a Callout (FrameworkElement), set its content and appearance.
Callout customCallout = new Callout
{
    Background = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.CornflowerBlue),
    BorderBrush = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.PaleVioletRed),
    BorderThickness = new System.Windows.Thickness(5,5,5,3),
    Content = "Custom content goes here"
};
// Set the callout location on the display using an attached property on GeoView.
GeoView.SetViewOverlayAnchor(customCallout, mapLocation);

// Add the callout to the map view overlay collection.
MyMapView.Overlays.Items.Add(customCallout);

I hope that helps! -Thad

DJurgella
New Contributor III

Thanks for the info. I'll give that a shot.

0 Kudos
JoeHershman
MVP Regular Contributor

Morten Nielsen‌ showed in this thread Popups in ArcGIS Runtime SDK for .NET how to make changes in Xaml

Thanks,
-Joe
0 Kudos