Hello,
I´ve some PinPoints that are represented by a png image. I´d like to draw a number in the middle of the image. If I use the property Text of the MapPinPoint the text is drawn on the right side of the image.
Is there any simple way of doing that?
Thank you very much,
Esther
3 Answers, 1 is accepted
0
Andrey
Telerik team
answered on 09 Feb 2011, 10:24 AM
Hello Esther,
You can create your own template for the MapPinPoint control. For example:
<StyleTargetType="telerik:MapPinPoint">
<SetterProperty="Template">
<Setter.Value>
<ControlTemplateTargetType="telerik:MapPinPoint">
<BorderBackground="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="1"
CornerRadius="3"
Padding="2,2,2,2">
<GridName="PART_Panel">
<ImageName="PART_Image"
Stretch="None"
Source="{TemplateBinding ImageSource}"
Width="32"
Height="32"/>
<TextBlockName="PART_Text"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Text="{TemplateBinding Text}"/>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
I hope this helps.
Kind regards,
Andrey Murzov
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Thank you,
But, where do I have to declare exactly that custom style? in another file? in the map xaml?
And then, How do I assign this style to the PinPoints I want?
Thanks again,
Esther
0
Accepted
Andrey
Telerik team
answered on 14 Feb 2011, 09:17 AM
Hi Esther,
Like any other styles in WPF this one can be declared in many different places in your application: App.xaml, XAML wich uses RadMap, external resource dictionary and so on. When the style is defined without x:Key attribute it is applied to all controls of this type authomatically.
Kind regards,
Andrey Murzov
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>