<!-- Snip inside MapTip of Feature -->
<StackPanel Orientation="Vertical">
<Button x:Name="button" Background="Green" Width="40" Height="20" Content="button" Click="doThis" SEND TO VB SUB="{Binding[Field1]}" />
</StackPanel>
<!-- Snip -->
<!-- Snip User Control -->
xmlns:ViewModel="clr-namespace:gislis2010_live.ViewModel">
<!-- Snip MapTip -->
<UserControl.Resources>
<ViewModel:MainPageViewModel x:Key="vm" />
</UserControl.Resources>
<!-- Snip MapTip -->
<Button Content="GetMapTipValue"
Width="100" Height="20"
Command="{Binding Source={StaticResource vm},Path= MapTipValueCommand}"
CommandParameter="{Binding}" />
<!-- Snip MapTip -->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.Collections.Generic
Namespace gislis2010_live.Commands
Public Class MapTipValueCommand
Implements ICommand
Public Function CanExecute(ByVal parameter As Object) As Boolean Implements System.Windows.Input.ICommand.CanExecute
Return True
End Function
Public Event CanExecuteChanged(ByVal sender As Object, ByVal e As System.EventArgs) Implements System.Windows.Input.ICommand.CanExecuteChanged
Public Sub Execute(ByVal parameter As Object) Implements System.Windows.Input.ICommand.Execute
Dim result2 = DirectCast(parameter, IDictionary(Of String, Object))
MessageBox.Show(result2("Video").ToString())
End Sub
End Class
End Namespace
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 gislis2010_live.Commands
Namespace gislis2010_live.ViewModel
Public Class MainPageViewModel
Inherits DependencyObject
Public Sub New()
End Sub
#Region "Intersect command"
Private m_mapTipValueCommand As MapTipValueCommand
Public ReadOnly Property MapTipValueCommand() As MapTipValueCommand
Get
If Me.m_mapTipValueCommand Is Nothing Then
Me.m_mapTipValueCommand = New MapTipValueCommand()
End If
Return Me.m_mapTipValueCommand
MessageBox.Show("In the Get")
End Get
End Property
#End Region
End Class
End Namespace
Public Sub Execute(ByVal parameter As Object) Implements System.Windows.Input.ICommand.Execute
Dim result2 = DirectCast(parameter, IDictionary(Of String, Object))
MessageBox.Show(result2("Video").ToString())
ShowMediaPlayerPanelNew.Begin()
End Sub <Button Content="GetMapTipValue"
Width="100" Height="20"
Command="{Binding MapTipValueCommand}"
CommandParameter="{Binding}" />
Partial Public Class MainPage
Inherits UserControl
Public Sub New()
InitializeComponent()
End Sub
#Region "Intersect command"
Private m_mapTipValueCommand1 As MapTipValueCommand1
Public ReadOnly Property MapTipValueCommand1() As MapTipValueCommand1
Get
If Me.m_mapTipValueCommand1 Is Nothing Then
Me.m_mapTipValueCommand1 = New MapTipValueCommand1()
End If
Return Me.m_mapTipValueCommand1
End Get
End Property
#End Region
End Class
Public Class MapTipValueCommand1
Implements ICommand
Public Function CanExecute(ByVal parameter As Object) As Boolean Implements System.Windows.Input.ICommand.CanExecute
Return True
End Function
Public Event CanExecuteChanged(ByVal sender As Object, ByVal e As System.EventArgs) Implements System.Windows.Input.ICommand.CanExecuteChanged
Public Sub Execute(ByVal parameter As Object) Implements System.Windows.Input.ICommand.Execute
Dim result2 = DirectCast(parameter, IDictionary(Of String, Object))
MessageBox.Show(result2("NAME").ToString())
End Sub
End Class
<UserControl x:Class="SilverlightApplication1_VB.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"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="400"
x:Name="mainPage">
<Grid x:Name="LayoutRoot">
<!-- Map Control -->
<esri:Map x:Name="MyMap"
Extent="-15000000,2000000,-7000000,8000000">
<esri:ArcGISTiledMapServiceLayer ID="StreetMapLayer"
Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" />
<esri:FeatureLayer ID="MyFeatureLayer"
Url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/3">
<esri:FeatureLayer.MapTip>
<Border esri:GraphicsLayer.MapTipHideDelay="00:00:05"
CornerRadius="10"
BorderBrush="#FF222957"
BorderThickness="0"
Margin="0,0,15,15">
<Border.Background>
<LinearGradientBrush EndPoint="1.038,1.136"
StartPoint="0.015,0.188">
<GradientStop Color="#FFD1DFF2" />
<GradientStop Color="#FF092959"
Offset="0.946" />
</LinearGradientBrush>
</Border.Background>
<Border.Effect>
<DropShadowEffect ShadowDepth="10"
BlurRadius="14"
Direction="300" />
</Border.Effect>
<Grid>
<StackPanel Orientation="Vertical"
Margin="10,10,0,10"
VerticalAlignment="Center">
<Grid>
<Button Content="GetMapTipValue"
Width="100"
Height="20"
Command="{Binding ElementName=mainPage,Path= MapTipValueCommand1}"
CommandParameter="{Binding}" />
</Grid>
</StackPanel>
</Grid>
</Border>
</esri:FeatureLayer.MapTip>
</esri:FeatureLayer>
</esri:Map>
</Grid>
</UserControl>
Public Class MapTipValueCommand1
Implements ICommand
Public Function CanExecute(ByVal parameter As Object) As Boolean Implements System.Windows.Input.ICommand.CanExecute
Return True
End Function
Public Event CanExecuteChanged(ByVal sender As Object, ByVal e As System.EventArgs) Implements System.Windows.Input.ICommand.CanExecuteChanged
Public Sub Execute(ByVal parameter As Object) Implements System.Windows.Input.ICommand.Execute
Dim result2 = DirectCast(parameter, IDictionary(Of String, Object))
MessageBox.Show(result2("Video").ToString())
ShowMediaPlayerPanelNew.Begin()
End Sub
End Class
Public Sub Execute(ByVal parameter As Object) Implements System.Windows.Input.ICommand.Execute
Dim result2 = DirectCast(parameter, IDictionary(Of String, Object))
MessageBox.Show(result2("Video").ToString())
Call Sub in Main vb and pass the Video value to it and return Message box there
End Sub