This is driving me NUTS...This is what I have...maybe you can take a glance and see one last time if you see anything...
<esri:FeatureLayer ID="MG_BusStops" Visible="False"
Url="http://gis.org/arcgis/rest/services/MG_Test/MapServer/8"
Renderer="{StaticResource BusStopUniqueRenderer}">
<esri:FeatureLayer.OutFields>
<!-- OUTPUT FIELDS THAT ARE TO BE RETURNED IN THE MAP TIPS-->
<sys:String>ELEM_TEXT</sys:String>
<sys:String>Route</sys:String>
<sys:String>Location</sys:String>
<sys:String>Video</sys:String>
</esri:FeatureLayer.OutFields>
<esri:FeatureLayer.MapTip >
<Border esri:GraphicsLayer.MapTipHideDelay="00:00:01.5" 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>
<!-- Down further in the xaml file...in the map -->
<Grid x:Name="Media3PlayerGrid" Height="0" RenderTransformOrigin="0.5,0.5">
<Grid.RenderTransform>
<ScaleTransform x:Name="ResultsMedia3ScaleTransformNew" ScaleX="0" ScaleY="0" />
</Grid.RenderTransform>
<Canvas>
<MediaElement x:Name="mPlayer3" Width="300" Height="250" MediaOpened="Element_MediaOpened3" MediaEnded="Element_MediaEnded3" AutoPlay="True" />
<Button x:Name="bPlay3" Background="Green" Width="40" Height="20" Canvas.Left="8" Canvas.Top="220" Content="Play3" Click="bPlay_Click3" />
<Button x:Name="bPause3" Background="Yellow" Width="40" Height="20" Canvas.Left="112" Canvas.Top="220" Content="Pause3" Click="bPause_Click3" />
<Button x:Name="bStop3" Background="Red" Width="40" Height="20" Canvas.Left="216" Canvas.Top="220" Content="Stop3" Click="bStop_Click3" />
<Button x:Name="bHide3" Background="Red" Width="40" Height="20" Canvas.Left="260" Canvas.Top="220" Content="Hide3" Click="bHide_Click3" />
<TextBlock Foreground="Black" Margin="5" Canvas.Left="10" Canvas.Top="260" VerticalAlignment="Center">Seek To</TextBlock>
<Slider Name="timelineSlider3" Margin="5" Width="180" Canvas.Left="60" Canvas.Top="260" ValueChanged="SeekToMediaPosition3"/>
</Canvas>
</Grid>
In the main Class of the MainPage.xaml.vb
Public Sub PlayVideo(ByVal videoName As String)
MessageBox.Show("in PlayVideo")
MessageBox.Show(videoName)
' I get the correct values being passed in the messageboxes above
' I cannot set the darn media player defined in the xaml here....ugggggggggggg
'Dim Address = New Uri(Application.Current.Host.Source, "../Videos/halo.mp4")
Dim Address = New Uri(Application.Current.Host.Source, "../Videos/" + videoName + ".mp4")
Me.mPlayer3.Source = Address
'mPlayer3.Source = New Uri("../Videos/halo.mp4")
'mPlayer3.Source = New Uri("/Videos/halo.mp4")
'mPlayer3.Source = New Uri("Videos/halo.mp4")
End Sub
' Snip
#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(Me)
End If
Return Me.m_mapTipValueCommand1
End Get
End Property
#End Region
End Class
Public Class MapTipValueCommand1
Implements ICommand
Private _mainPage As MainPage
Public Sub New(ByVal mainPage As MainPage)
Me._mainPage = mainPage
End Sub
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())
Dim videoName = result2("Video").ToString()
Me._mainPage.PlayVideo(videoName)
End Sub
End Class