Reference problems when using custom controls within Exrin

70 views Asked by At

Using the base Exrin template, I am unable to use custom controls.

As it stands now, the Droid/iOS projects reference the App/Bootstrapper project, so that seems like the correct place to put them, but when creating a new page or BaseView, I am not able to access the custom control's namespace because the View project does not reference the App/Bootstrapper project.

The Tesla sample app does not have this problem in its current implementation since there is no separation of the App/Bootstrapper and the View projects.

(1) Should a reference to the App/Bootstrapper be placed in the View project or (2) should a reference to the View project be placed in the Android/iOS/etc projects? Or is there a better solution than either of these two?

Edit: (1) does not work because a reference to the App project from the View would create a circular dependency.

(2) should work (I think), but I'm having trouble getting the Application.Droid project to access the Application.View project namespace because when I add using Application.View;, the namespace isn't found in the Application namespace. Visual Studio attempts to fill in other Application namespaces (.Container, .Logic, .Droid, .Proxy) when I type in using Application.

1

There are 1 answers

7
Adam On BEST ANSWER

The native project can have a reference to the View. It already does in a way, because it references the App library, which then references the View. Hence you aren't really adding any further dependencies by doing this, just allowing access further up the chain.

If you are having trouble the namespace, I suggest you start out with

global::Application.

That way it starts from the top, if its getting mixed up with project namespaces.