Select to view content in your preferred language

Frosted Tab Example 'SetLayerAction' error

1139
1
11-02-2010 11:14 AM
JayKappy
Frequent Contributor
I am using a template for some code example adn having soem issues.
I am trying to use the Frosted Tab Example from here:
http://help.arcgis.com/en/webapi/silverlight/samples/TemplateGalleryWeb/start.htm


This is the code section I am trying to add:
I am getting errors on this
actions:SetLayerUrlAction

Error:
Error 9 The type 'actions:SetLayerUrlAction' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.

I added these references in the mainpage.xaml file: The tried to add them as references
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:ei="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"
xmlns:actions="clr-namespace:ESRI.ArcGIS.SilverlightMapApp.Actions"


Is there a piece of the example that I have not added? I cant see this option as an option to add in the Add Reference dialog window.
I noticed that there are a few calls to additional CS files, but I dont know how to add the CS code to my VB app. I can convert the code but dont know where to add them or the reference.

I noticed that this name space is written in the additional CS pages....

HOW do I get this namespace in my VB page?
OR am I totally off here?

Do I just add the code from the CS page (after convertign to VB) into my mainpage.xaml.vb?????

          <Grid Height="60" Width="400" VerticalAlignment="Top" Margin="0,10,10,0" >
                <Border x:Name="ViewOptionsBorder" Background="{StaticResource PanelGradient}" VerticalAlignment="Top" BorderBrush="#66FFFFFF" BorderThickness="1" CornerRadius="0,0,5,5" Effect="{StaticResource dropShadow}" Height="Auto" >
                    <StackPanel Orientation="Vertical" VerticalAlignment="Top" >
                        <Grid x:Name="ViewOptionsHeaderGrid" Cursor="Hand" MouseLeftButtonUp="ViewOptionsHeaderGrid_MouseLeftButtonUp" ToolTipService.ToolTip="Toggle View Options Tab" >
                            <Rectangle Fill="#00FFFFFF"  />
                            <TextBlock HorizontalAlignment="Left" Margin="5,3,5,3" Foreground="White" Text="{Binding Text, Mode=OneWay, ElementName=ViewOptionsText}" VerticalAlignment="Top">
                                <TextBlock.Effect>
                                    <BlurEffect />
                                </TextBlock.Effect>
                            </TextBlock>
                            <TextBlock x:Name="ViewOptionsText" HorizontalAlignment="Left" Margin="5,3,5,3" Foreground="Black" Text="View Options" VerticalAlignment="Top" Effect="{StaticResource miniDropShadow}" />
                        </Grid>

                        <Grid x:Name="ViewOptionsGrid" Height="0" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5"  >
                            <Grid.RenderTransform>
                                <ScaleTransform x:Name="ViewOptionsScaleTransform" ScaleX="0" ScaleY="0" />
                            </Grid.RenderTransform>
                            <Border Background="{StaticResource WhiteGradient}" Padding="5" >
                                <StackPanel Orientation="Vertical">
                                    <!-- Map Style -->
                                    <Button Style="{StaticResource RibbonButton}" Margin="5,0,5,0" Cursor="Hand" ToolTipService.ToolTip="Toggle Map Rotation" VerticalAlignment="Top"  HorizontalAlignment="Center"  Padding="5,10,5,10" >
                                        <Grid HorizontalAlignment="Center" Margin="0,-10,0,0">
                                            <StackPanel Orientation="Horizontal" Margin="5,14,5,0" HorizontalAlignment="Center" VerticalAlignment="Center" Effect="{StaticResource miniDropShadow}" >
                                                <RadioButton Content="Streets" IsChecked="True" ToolTipService.ToolTip="Worldwide Street Map" GroupName="BaseLayer" Margin="0" FontSize="11" >
                                                    <i:Interaction.Triggers>
                                                        <i:EventTrigger EventName="Checked">
                                                            <actions:SetLayerUrlAction TargetName="Map" LayerID="BaseLayer" Url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"/>
                                                        </i:EventTrigger>
                                                    </i:Interaction.Triggers>
                                                </RadioButton>
                                                <RadioButton Content="Topo" GroupName="BaseLayer" ToolTipService.ToolTip="United States Topographic Map" Margin="5,0,0,0" FontSize="11" >
                                                    <i:Interaction.Triggers>
                                                        <i:EventTrigger EventName="Checked">
                                                            <actions:SetLayerUrlAction TargetName="Map" LayerID="BaseLayer" Url="http://services.arcgisonline.com/ArcGIS/rest/services/NGS_Topo_US_2D/MapServer"/>
                                                        </i:EventTrigger>
                                                    </i:Interaction.Triggers>
                                                </RadioButton>
                                                <RadioButton Content="Imagery" ToolTipService.ToolTip="Worldwide Satellite Imagery Map" GroupName="BaseLayer" Margin="5,0,0,0" FontSize="11" >
                                                    <i:Interaction.Triggers>
                                                        <i:EventTrigger EventName="Checked">
                                                            <actions:SetLayerUrlAction TargetName="Map" LayerID="BaseLayer" Url="http://services.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer"/>
                                                        </i:EventTrigger>
                                                    </i:Interaction.Triggers>
                                                </RadioButton>
                                            </StackPanel>
                                            <TextBlock Text="Map Style" Foreground="Black" VerticalAlignment="Top" HorizontalAlignment="Center" TextAlignment="Center"  Margin="0" FontSize="10" />
                                        </Grid>
                                    </Button>
                                    <!-- Map Rotation Button -->
                                    <Button Style="{StaticResource RibbonButton}" Margin="5,0,5,0" Cursor="Hand" ToolTipService.ToolTip="Toggle Map Rotation" VerticalAlignment="Center"  HorizontalAlignment="Left"  Padding="5" >
                                        <i:Interaction.Triggers>
                                            <i:EventTrigger EventName="Click" >
                                                <actions:ToggleCollapseAction TargetName="MapRotationPanel" />
                                            </i:EventTrigger>
                                        </i:Interaction.Triggers>
                                        <StackPanel Orientation="Horizontal" Effect="{StaticResource miniDropShadow}" >
                                            <Grid  HorizontalAlignment="Left" VerticalAlignment="Top" Margin="5,0,0,0" >
                                                <Image Style="{StaticResource compassImage}" Height="22"  />
                                            </Grid>
                                            <TextBlock Text="Rotate Map" Foreground="Black" VerticalAlignment="Center" HorizontalAlignment="Left" TextAlignment="Left"  Margin="5,0,5,0" FontSize="11" />
                                        </StackPanel>
                                    </Button>
                                    <!-- Full Screen Toggle Button -->
                                    <Button Style="{StaticResource RibbonButton}" Margin="5,0,5,0" Cursor="Hand" ToolTipService.ToolTip="Toggle Full Screen" VerticalAlignment="Center"  HorizontalAlignment="Left"  Padding="5" >
                                        <i:Interaction.Triggers>
                                            <i:EventTrigger EventName="Click" >
                                                <actions:ToggleFullScreenAction />
                                            </i:EventTrigger>
                                        </i:Interaction.Triggers>
                                        <StackPanel Orientation="Horizontal" Effect="{StaticResource miniDropShadow}" >
                                            <Grid  HorizontalAlignment="Left" VerticalAlignment="Top" Margin="5,0,0,0" >
                                                <Image Style="{StaticResource fullScreenImage}" Height="24"  />
                                            </Grid>
                                            <TextBlock Text="Full Screen" Foreground="Black" VerticalAlignment="Center" HorizontalAlignment="Left" TextAlignment="Left"  Margin="5,0,5,0" FontSize="11" />
                                        </StackPanel>
                                    </Button>

                                </StackPanel>

                            </Border>
                        </Grid>

                    </StackPanel>
                </Border>
            </Grid>
0 Kudos
1 Reply
JayKappy
Frequent Contributor
I know this is probably not makign any sense...

What I am trying to do is grab the section from the top of the Frosted Tab example and put it in my vb app.  I am trying to figure out how to take the cod efrom the CS pages nad incorporate it into mine.  I created a few modules in my application adn named them the same, converted the code to VB and added it to the vb pages.  I grabbed the code from the mainpage.xaml and put that in mine...I then get the error explained above....soemthign about not having the ACTIONS reference?

There has to be an easy way to create the extra vb pages, grab the code and add references...
Am I missing something?

Is this some reference I can add in the add reference dialog?  Or is it dependant on another vb page or reference code?

    xmlns:actions="clr-namespace:ESRI.ArcGIS.SilverlightMapApp.Actions"

THANKS
0 Kudos