This is a migrated thread and some comments may be shown as answers.

Custom MapPinPoints

3 Answers 106 Views
Map
This is a migrated thread and some comments may be shown as answers.
Esther
Top achievements
Rank 1
Esther asked on 07 Feb 2011, 06:14 PM
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

Sort by
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:

<Style TargetType="telerik:MapPinPoint">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="telerik:MapPinPoint">
                <Border Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}" 
                        BorderThickness="1" 
                        CornerRadius="3"
                        Padding="2,2,2,2">
                    <Grid Name="PART_Panel">
                        <Image Name="PART_Image" 
                               Stretch="None" 
                               Source="{TemplateBinding ImageSource}" 
                               Width="32" 
                               Height="32" />
                        <TextBlock Name="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>>
0
Esther
Top achievements
Rank 1
answered on 09 Feb 2011, 01:23 PM
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>>
Tags
Map
Asked by
Esther
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Esther
Top achievements
Rank 1
Share this question
or