How do I set the background-/text color of a callout in ArcGIS runtime 100.2 (WPF) ?

1549
3
05-24-2018 09:50 PM
ThomasLindegaard
New Contributor

Hi, we are working with callout's in the map control. In the examples I see regarding this, the background color is white and the text is black. When I use a callout the background is white, but the text is also white (with a slightly different shade, so I'm able to tell that the correct text is there). How do I set the colors used in a callout?

kindly,

Thomas

Tags (1)
0 Kudos
3 Replies
ThomasAriston
New Contributor II

I know this doesn't exactly answer your question, but if you want more control over your Callout, you can use the following:

public void ShowCalloutAt(MapPoint location, UIElement calloutContent, Point leaderOffset = default(Point));

This allows you to define your own UIElement, the appropriate bindings, etc, and can be used like this:

ShowCalloutAt(location, new MyFancyCalloutView()
{
    DataContext = new MyFancyCalloutViewModel(feature, _featureTable),
    // Obviously you can style this in xaml
    Background = Brushes.PaleGoldenrod,
    BorderBrush = Brushes.OliveDrab,
    BorderThickness = new Thickness(2)
});
0 Kudos
dotMorten_esri
Esri Notable Contributor

Did you set a global style on TextBlock? That could be what's happening here. You can use the Live Visual Tree explorer in Visual Studio 2017 to see what's really being rendered and where styles are coming from: https://blogs.msdn.microsoft.com/visualstudio/2015/02/24/introducing-the-ui-debugging-tools-for-xaml...

0 Kudos
ThomasLindegaard
New Contributor

Hi Morten,

I used Snoop to get the value and edit it runtime, since I don't have VS2017 just yet. Anyway, your tip did lead me back on track - thanks a lot for the fast response

-

Thomas

0 Kudos