Search code examples
c#wpfcolorsbing-mapspushpin

Changing the color of Bing Map pushpins


How can I set the color of a pushpin programmatically through C# rather than XAML? How can I set font and size of a string associated with a pushpin through Content property? I'm not sure how to use ContentStringFormat property to achieve this.


Solution

  • pushpin.Background = new SolidColorBrush(Color.FromArgb(100,100,100,100)); 
    

    Pushpin has inherited FontFamily and FontSize properties, they should have effect on the associated text.

    pushpin.FontFamily = new FontFamily("Arial");
    pushpin.FontSize = 20.0;