We help IT Professionals succeed at work.
Get Started

Conditional Compilation Problem

74 Views
Last Modified: 2015-09-20
I'm trying to create a Universal App and I'm following this example http://blogs.msdn.com/b/bingdevcenter/archive/2014/06/24/using-maps-in-universal-apps.aspx

I've run the MapView.cs file through a VB converter but the result fails on  Me.Children.Add(_map). as it's undeclared or inaccessible  The Code is ..

#If WINDOWS_PHONE_APP Then
Imports Windows.UI.Xaml.Controls.Maps
Imports Windows.UI.Xaml.Media
Imports Windows.UI.Xaml.Shapes
Imports Windows.UI.Xaml
#Elif WINDOWS_APP Then
Imports Bing.Maps
#End If

Namespace App3
    Public Class MapView
        Inherits Grid
#If WINDOWS_APP Then
		Private _map As Map
		#Elif WINDOWS_PHONE_APP Then
		Private _map As MapControl
#End If

        Public Sub New()
#If WINDOWS_APP Then
			Private _map = New Map()
			#Elif WINDOWS_PHONE_APP Then
			Private _map = New MapControl()
#End If

            Me.Children.Add(_map)
        End Sub
    End Class
End Namespace

Open in new window

Comment
Watch Question
Top Expert 2015
Commented:
This problem has been solved!
Unlock 1 Answer and 7 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE