MapPolygon Styling

2 posts, 0 answers
  1. Nicholas
    Nicholas avatar
    1 posts
    Member since:
    Feb 2012

    Posted 09 Apr 2012 Link to this post

    Hi,

    I am having an issue with styling MapPolygons. I am able to style some settings such as the tooltip but am unsuccessful in styling other aspects like the border.

    What I am trying to do is apply an Effect to a MapPolygon when the mouse is over it. Below is a Xaml snippet of my style, which doesn't work with or without the trigger. 

    <Style x:Key="zoneStyle" TargetType="telerik:MapPolygon">
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Effect">
                    <Setter.Value>
                        <DropShadowEffect ShadowDepth="3" BlurRadius="3" Color="Purple"/>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>

    Applying a BorderBrush in the style doesn't work either. Is there something I am missing?

    Thanks in advance.

    Nick
  2. Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 12 Apr 2012 Link to this post

    Hello Nicholas,

    The map shape objects use regular Silverlight shapes for visualization. The map shapes provide the same set of the painting properties as the regular Silverlight shapes provide (Fill, Stroke, StrokeThikness and so on). These properties are combined in the MapShapeFill object. So you always can refer to the MSDN as well as to the Telerik documentation for detailed information about painting properties:
     
    http://msdn.microsoft.com/en-us/library/cc189073(v=vs.95).aspx
    http://msdn.microsoft.com/en-us/library/system.windows.shapes.shape(v=vs.95).aspx
    http://www.telerik.com/help/silverlight/allmembers_t_telerik_windows_controls_map_mapshapefill.html
     
    For example, the MapPolygon shape can use Fill, Stroke and StrokeThikness properties:

    <Style x:Key="zoneStyle" TargetType="telerik:MapPolygon">
        <Setter Property="Fill" Value="Azure" />
        <Setter Property="Stroke" Value="Red" />
        <Setter Property="StrokeThickness" Value="2" />
    </Style>

    Unfortunately triggers and effects aren't supported for map shape objects.

    Regards,
    Andrey Murzov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top