Select to view content in your preferred language

SetLayerUrlAction in VB

424
1
06-21-2010 02:02 PM
GuyDuke
Deactivated User
Hello - any chance someone has written VB code to toggle layer visibility with a button click / radio button similar to the C# code in the showcase template (SetLayerUrlAction.cs)?
0 Kudos
1 Reply
GuyDuke
Deactivated User
Obvisously I'm new to this stuff...:o

All you need is this XAML (as explained in "concepts").

<Button Name="Button1" Content="Toggle Hopper Layer" Height="23" HorizontalAlignment="Left" Margin="12,0,0,0" VerticalAlignment="Center" Width="175">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="Click">
                        <guy:ToggleLayerAction LayerID="Hopper" TargetName="MyMap" />
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </Button>

After doing:

SEE CONCEPTS SECTION
    Steps:
    1) Add reference to System.Windows.Interactivity
    2) Add xmlns "i"
    3) Add reference to ESRI.ArcGIS.Client.Behaviors
    4) Add xmlns "guy"

xmlns:guy="clr-namespace:ESRI.ArcGIS.Client.Actions;assembly=ESRI.ArcGIS.Client.Behaviors"
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"

It's still all very cool.  Looking forward to getting over this initial learning curve.  One of you guys should write a book!
0 Kudos