Yea I dont think this is workign right....I am going between StreetLayer and Aerials. I turn off Aerials and slide this slider and the StreetLayer does not change....I think its because I still have that line in the xaml fileIf I remove the line in Red below it does not work. with it in there it only effects the opacity of which ever layer is specified.....what is wrong and why cant I remove it?One last thing...in VB when I use the "MouseLeftButtonUp" I set these parameters....What parameters do I use if I am using a "ValueChanged"MouseButtonEventArgs has to be changed to WHAT? Private Sub MultiLayerOpacity(ByVal sender As Object, ByVal e As MouseButtonEventArgs)Is my VB code completly wrong?I cant even turn off the layer from within my VB.... Dim DynamicLayer2 As ArcGISDynamicMapServiceLayer = TryCast(Me.MyMap.Layers("Aerials"), ArcGISDynamicMapServiceLayer) DynamicLayer2.Visible = False
<Slider x:Name="MySlider"
VerticalAlignment="Center" Minimum="0" Maximum="1" Width="50"
Margin="0,0,0,0" MouseLeftButtonUp="MultiLayerOpacity"
Value="{Binding ElementName=MyMap, Path=Layers[Aerials].Opacity, Mode=TwoWay}" /> Private Sub MultiLayerOpacity(ByVal sender As Object, ByVal e As MouseButtonEventArgs)
Dim Test As String = MySlider.Value
Dim DynamicLayer1 As ArcGISDynamicMapServiceLayer = TryCast(MyMap.Layers("StreetMapLayer"), ArcGISDynamicMapServiceLayer)
DynamicLayer1.Opacity = 1 - Test
Dim DynamicLayer2 As ArcGISDynamicMapServiceLayer = TryCast(MyMap.Layers("Aerials"), ArcGISDynamicMapServiceLayer)
DynamicLayer2.Opacity = Test
End SubIf I do this I get the messagebox value
Private Sub MultiLayerOpacity(ByVal sender As Object, ByVal e As MouseButtonEventArgs)
Dim Test As String = MySlider.Value
If Test > 0 Then
MessageBox.Show("Yo")
Dim DynamicLayer2 As ArcGISDynamicMapServiceLayer = TryCast(MyMap.Layers("Aerials"), ArcGISDynamicMapServiceLayer)
DynamicLayer2.Opacity = Test
End If
End Sub
If I do this I dont....so somethign has to be wrong with the syntax or setting of the opacity
Private Sub MultiLayerOpacity(ByVal sender As Object, ByVal e As MouseButtonEventArgs)
Dim Test As String = MySlider.Value
If Test > 0 Then
Dim DynamicLayer2 As ArcGISDynamicMapServiceLayer = TryCast(MyMap.Layers("Aerials"), ArcGISDynamicMapServiceLayer)
DynamicLayer2.Opacity = Test
MessageBox.Show("Yo")
End If
End Sub