Select to view content in your preferred language

<esri:FillSymbol x:Key="ResultsFillSymbol">

796
3
04-11-2013 09:31 AM
Labels (1)
FrancoisGilbert
Deactivated User
Hello,

I have looked at the WFP SDK example where a query to a layer shows the selected graphic and at the same time you see the graphic that are selected in the attribute table. That example works with a polygone feature layer. In the example the "ResultsFillSymbol" is used to define how the poygone will appear when "Normal", "Selected", "mouse move". I would like to use that example and make it work for Marker and Lines. Is it possible to use a more generic FillSymbol to work with the 3 types of features and if so, do you have an example.

Regards
François Gilbert
0 Kudos
3 Replies
BrianLocke
Frequent Contributor
VisualStateManager, or maybe even use a Converter???
0 Kudos
FrancoisGilbert
Deactivated User
Hello in the SDK for WPF,

I have picked-up an example that defines how the polygones are displayed after they are queried. The definition is in the example below. I would like to apply the same definition for polylines and points but I do not know how to do it in XAML. To simplify, I would have like to have one definition for the plygone, polylines and points. Is there an example that shows how to define points and lines.

<esri:FillSymbol x:Key="ResultsFillSymbol">
                <esri:FillSymbol.ControlTemplate>
                    <ControlTemplate x:Name="CustomPolygonTemplate">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal">
                                        <Storyboard>
                                            <ColorAnimation Storyboard.TargetName="Element"
                                                Storyboard.TargetProperty="(Fill).(Color)"
                                                To="#880000FF" Duration="0:0:0.1" />
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Selected">
                                        <Storyboard>
                                            <ColorAnimation Storyboard.TargetName="Element"
                                                Storyboard.TargetProperty="(Fill).(Color)"
                                                To="#8800FFFF" Duration="0:0:0.1" />
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Path x:Name="Element" Stroke="Blue" Fill="#880000FF"
                                StrokeStartLineCap="Round" StrokeThickness="2"
                                StrokeLineJoin="Round" StrokeEndLineCap="Round" />
                        </Grid>
                    </ControlTemplate>
                </esri:FillSymbol.ControlTemplate>
            </esri:FillSymbol>

            <Style x:Key="MyCustomRow" TargetType="{x:Type DataGridRow}">
                <Setter Property="IsTabStop" Value="False" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type DataGridRow}">
                            <Border x:Name="DGR_Border"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                SnapsToDevicePixels="True">
                                <SelectiveScrollingGrid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="*"/>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <DataGridCellsPresenter Grid.Column="1"
                                         ItemsPanel="{TemplateBinding ItemsPanel}"
                                         SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                                    <DataGridDetailsPresenter
                                        SelectiveScrollingGrid.SelectiveScrollingOrientation="{Binding RelativeSource={RelativeSource AncestorType={x:Type DataGrid}},
                                        Path=AreRowDetailsFrozen, Converter={x:Static DataGrid.RowDetailsScrollingConverter}, ConverterParameter={x:Static SelectiveScrollingOrientation.Vertical}}"
                                            Grid.Column="1" Grid.Row="1" Visibility="{TemplateBinding DetailsVisibility}" />
                                    <DataGridRowHeader SelectiveScrollingGrid.SelectiveScrollingOrientation="Vertical"  Grid.RowSpan="2"
                                    Visibility="{Binding RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}, Path=HeadersVisibility, Converter={x:Static DataGrid.HeadersVisibilityConverter}, ConverterParameter={x:Static DataGridHeadersVisibility.Row}}"/>
                                </SelectiveScrollingGrid>
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
Hi,

Unfortunately it's not possible to have one symbol for point, polyline and polygon geometries since they are all different geometry types and have associated symbols relevant to their particular display needs.

Point: SimpleMarkerSymbol, PictureMarkerSymbol, TestSymbol
Polyline: SimpleLineSymbol
Polygon: SimpleFillSymbol, PictureFillSymbol

I'd recommend avoiding the use of custom ControlTemplates as in your example below - they're not supported in the accelerated display mode.

Cheers

Mike
0 Kudos