Skip to main content
A newer version of this page is available. .

MapPie.Segments Property

Gets or sets segments of a map pie.

Namespace: DevExpress.Xpf.Map

Assembly: DevExpress.Xpf.Map.v21.2.dll

NuGet Package: DevExpress.Wpf.Map

Declaration

public PieSegmentCollection Segments { get; set; }

Property Value

Type Description
PieSegmentCollection

A PieSegmentCollection object that is a collection of map path segments.

Example

The MapPie class contains the following properties that allow customizing the appearance.

View Example

<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        xmlns:dxm="http://schemas.devexpress.com/winfx/2008/xaml/map" 
        xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" 
        x:Class="MapPieExample.MainWindow"
        Title="MainWindow" Height="350" Width="525">
    <Window.Resources>
        <ObjectDataProvider x:Key="rotationDirections" 
                            ObjectType="{x:Type sys:Enum}" MethodName="GetValues">
            <ObjectDataProvider.MethodParameters>
                <x:Type TypeName="dxm:RotationDirection"/>
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>
    </Window.Resources>

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>

        <dxm:MapControl Grid.Column="0">
            <dxm:MapControl.ScrollButtonsOptions>
                <dxm:ScrollButtonsOptions Visible="False"/>
            </dxm:MapControl.ScrollButtonsOptions>
            <dxm:MapControl.CoordinatesPanelOptions>
                <dxm:CoordinatesPanelOptions Visible="False"/>
            </dxm:MapControl.CoordinatesPanelOptions>
            <dxm:VectorLayer>
                <dxm:VectorLayer.Colorizer>
                    <dxm:KeyColorColorizer>
                        <dxm:KeyColorColorizer.ItemKeyProvider>
                            <dxm:IdItemKeyProvider/>
                        </dxm:KeyColorColorizer.ItemKeyProvider>
                        <dxm:KeyColorColorizer.Colors>
                            <Color A="100" R="100" G="100" B="100"/>
                            <Color A="200" R="200" G="200" B="200"/>
                        </dxm:KeyColorColorizer.Colors>
                    </dxm:KeyColorColorizer>
                </dxm:VectorLayer.Colorizer>
                <dxm:MapItemStorage>
                    <dxm:MapPie Size="100" HoleRadiusPercent="{Binding ElementName=seHoleRadius, Path=Value}"
                                RotationDirection="{Binding ElementName=cbRotationDirection, Path=SelectedValue}"
                                RotationAngle="{Binding ElementName=seRotationAngle, Path=Value}">
                        <dxm:MapPie.Segments>
                            <dxm:PieSegment SegmentId="A" Value="10"/>
                            <dxm:PieSegment SegmentId="B" Value="8"/>
                        </dxm:MapPie.Segments>
                    </dxm:MapPie>
                </dxm:MapItemStorage>
            </dxm:VectorLayer>
            <dxm:MapControl.ScalePanelOptions>
                <dxm:ScalePanelOptions Visible="False"/>
            </dxm:MapControl.ScalePanelOptions>
            <dxm:MapControl.ZoomTrackbarOptions>
                <dxm:ZoomTrackbarOptions Visible="False"/>
            </dxm:MapControl.ZoomTrackbarOptions>
        </dxm:MapControl>

        <GroupBox Grid.Column="1" Header="MapPie settings:" Margin="4">
            <Grid >
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>

                <Label Grid.Row="0" Grid.Column="0" Margin="4,4,2,2" Content="Hole Radius (percents):"/>
                <dxe:SpinEdit Name="seHoleRadius" Grid.Row="0" Grid.Column="1" Margin="2,4,4,2"
                          MaxValue="100" MinValue="0" Value="30" />
                <Label Grid.Row="1" Grid.Column="0" Margin="4,2,2,2"  Content="Rotation Direction:"/>
                <ComboBox Name="cbRotationDirection"  Grid.Row="1" Grid.Column="1" Margin="2,2,4,2" 
                      SelectedIndex="0"
                      ItemsSource="{Binding Source={StaticResource rotationDirections}}"/>
                <Label Grid.Row="2" Grid.Column="0" Margin="4,2,2,4" Content="Rotation Angle:"/>
                <dxe:SpinEdit Name="seRotationAngle" Grid.Row="3" Grid.Column="1" Margin="2,2,4,4"
                          MinValue="0" MaxValue="360" Value="0"/>
            </Grid>
        </GroupBox>
    </Grid>
</Window>
See Also