xmlns:usercontrols="clr-namespace:ESRI.ArcGIS.SilverlightMapApp" xmlns:actions="clr-namespace:ESRI.ArcGIS.SilverlightMapApp.Actions"
<UserControl x:Class="Test5.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:esri="http://schemas.esri.com/arcgis/client/2009" xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:ei="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions" xmlns:UserControls="clr-namespace:ESRI.ArcGIS.SilverlightMapApp" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400"> <Grid x:Name="LayoutRoot" Background="White"> <!--Map/Layers--> <esri:Map x:Name="MyMap" WrapAround="True" Extent="-8449438,5093446,-8136352,5276656"> <!--ESRI Street Map--> <esri:ArcGISTiledMapServiceLayer ID="ESRI_Street" Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" /> <!--Constrain the extent--> <i:Interaction.Behaviors> <esri:ConstrainExtentBehavior ConstrainedExtent="-8449438,5093446,-8136352,5276656" /> </i:Interaction.Behaviors> </esri:Map> <!--Top Left Pop Up Menu--> <Grid HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10"> <UserControls:CollapsiblePanel x:Name="MainMenu"> </UserControls:CollapsiblePanel> </Grid> </Grid> </UserControl>
Imports Microsoft.VisualBasic
Imports System
Imports System.Net
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Documents
Imports System.Windows.Ink
Imports System.Windows.Input
Imports System.Windows.Media
Imports System.Windows.Media.Animation
Imports System.Windows.Shapes
Imports System.Windows.Controls.Primitives
Imports ESRI.ArcGIS.Client
Imports ESRI.ArcGIS.Client.Map
Namespace ESRI.ArcGIS.SilverlightMapApp
<TemplateVisualState(GroupName:="ViewStates", Name:="Collapsed")>
<TemplateVisualState(GroupName:="ViewStates", Name:="Expanded")>
Public Class CollapsiblePanel
Inherits Control
Public Sub New()
Me.DefaultStyleKey = GetType(CollapsiblePanel)
End Sub
#Region "Dependency Properties"
Public Property IsExpanded()
Get
Return GetValue(IsExpandedProperty)
End Get
Set(value)
SetValue(IsExpandedProperty, value)
End Set
End Property
Public Shared IsExpandedProperty As DependencyProperty = _
DependencyProperty.Register("IsExpanded", GetType(Boolean), GetType(CollapsiblePanel), _
New PropertyMetadata(True, New PropertyChangedCallback(AddressOf OnIsExapandedChanged)))
Private Shared Sub OnIsExapandedChanged(ByVal sender As DependencyObject, ByVal e As DependencyPropertyChangedEventArgs)
TryCast(sender, CollapsiblePanel).ChangeVisualState(True)
End Sub
#End Region
Public Overrides Sub OnApplyTemplate()
MyBase.OnApplyTemplate()
ChangeVisualState(False)
End Sub
Private Sub ChangeVisualState(useTransitions As Boolean)
If IsExpanded = True Then
VisualStateManager.GoToState(Me, "Expanded", useTransitions)
Else
VisualStateManager.GoToState(Me, "Collapsed", useTransitions)
End If
End Sub
End Class
End Namespace<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
xmlns:local="clr-namespace:ESRI.ArcGIS.SilverlightMapApp">
<Style TargetType="local:CollapsiblePanel">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:CollapsiblePanel">
<Grid x:Name="LayoutRoot" RenderTransformOrigin="{TemplateBinding RenderTransformOrigin}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="ViewStates">
<VisualState x:Name="Expanded">
<Storyboard>
<DoubleAnimation BeginTime="00:00:00" Duration="00:00:0.3" Storyboard.TargetName="CollapsiblePanelScale" Storyboard.TargetProperty="ScaleY" To="1" />
<DoubleAnimation BeginTime="00:00:00" Duration="00:00:0.3" Storyboard.TargetName="CollapsiblePanelScale" Storyboard.TargetProperty="ScaleX" To="1" />
<DoubleAnimation BeginTime="00:00:00" Duration="00:00:0.3" Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="Opacity" To="1" />
</Storyboard>
</VisualState>
<VisualState x:Name="Collapsed">
<Storyboard>
<DoubleAnimation BeginTime="00:00:00" Duration="00:00:0.2" Storyboard.TargetName="LayoutRoot" Storyboard.TargetProperty="Opacity" To="0" />
<DoubleAnimation BeginTime="00:00:00" Duration="00:00:0.2" Storyboard.TargetName="CollapsiblePanelScale" Storyboard.TargetProperty="ScaleY" To="0" />
<DoubleAnimation BeginTime="00:00:00" Duration="00:00:0.2" Storyboard.TargetName="CollapsiblePanelScale" Storyboard.TargetProperty="ScaleX" To="0" />
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<ContentPresenter x:Name="Content"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Content="{TemplateBinding Content}"
Margin="{TemplateBinding Padding}"
ContentTemplate="{TemplateBinding ContentTemplate}">
</ContentPresenter>
<Grid.RenderTransform>
<ScaleTransform x:Name="CollapsiblePanelScale" ScaleX="1" ScaleY="1" />
</Grid.RenderTransform>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>"Undefined CLR Namespace". The "clr-namespace" URI refers to a namespace 'ESRI.ArcGIS.SilverlightMapApp' that is not included in the assembly.
xmlns:userControls="clr-namespace:Test5.ESRI.ArcGIS.SilverlightMapApp"
xmlns:userControls="clr-namespace:ESRI.ArcGIS.SilverlightMapApp"
There is generic.xaml file In standart esri map application template as shown on the picture.
You have to move it to your project on the client side, after inserting the name of your project instead
of the name "ESRIStandardMapApplication1". It is not obvious action, but it is the solution.
