Toggle Feature Layer

2508
3
04-23-2010 09:56 AM
KevinCoetzee
New Contributor
I'm struggling to toggle FEATURE layers with their visibility. i.e. having a button that switches the feature layer on and off
0 Kudos
3 Replies
KevinCoetzee
New Contributor
Silly Mistype: For others heres the solution :

            <Button x:Name="myMenuItem1"
                            Style="{StaticResource MenuItem}"
                            ToolTipService.ToolTip="Toggle Region Layer" Content="Toggle Region">
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="Click">
                               <esriBehavior:ToggleLayerAction 
                                    LayerID="RegionFeatureLayer"
                                    TargetName="Map"/>
                            </i:EventTrigger>
                        </i:Interaction.Triggers>

                    </Button>
0 Kudos
JasonCleaver
Occasional Contributor
What if I have a dynamic map service and I want to toggle an specific feature  in the service?
0 Kudos
RobertRoyall
New Contributor
What if I have a dynamic map service and I want to toggle an specific feature  in the service?


For that your best bet is to use an ArcGISDynamicMapLayer and set layers on and off using the VisibleLayers property.
0 Kudos