title: How to attach UrhoSharp Surface to LinearLayout in ViewGroup class
body: <p>I'm trying to add a UrohSharp Surface to a <code>LinearLayout</code> in a class inheriting from <code>ViewGroup</code> (to place in in the left hand corner of another view).</p>
  
  <p>Most examples showing UrhoSharp implemented in Android is done directly in the main activity like this: </p>
  
  <pre class="lang-cs prettyprint-override"><code>protected override async void OnCreate(Bundle savedInstanceState)
  {
              base.OnCreate(savedInstanceState);
              var mLayout = new AbsoluteLayout(this);
              surface = UrhoSurface.CreateSurface(this);// (this, , true);
              mLayout.AddView(surface);
  
              SetContentView(mLayout);
  
              dronModel = await surface.Show&lt;DroneScene&gt;(new ApplicationOptions("Data"));
  }
  
  </code></pre>
  
  <p>Or with a element in the layout file:</p>
  
  <pre class="lang-xml prettyprint-override"><code>    &lt;Urho.Droid.UrhoSurfacePlaceholder
          android:id="@+id/DroidModelId"
          android:background="@color/colorPrimary"
          android:layout_height="300dp"
          android:layout_width="match_parent"/&gt;
  </code></pre>
  
  <p>And replace it like so:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public override async void OnViewCreated(Android.Views.View view, Bundle savedInstanceState)
  {
              base.OnViewCreated(view, savedInstanceState);
  
              surface = UrhoSurface.CreateSurface(base.Activity);
              UrhoSurfacePlaceholder parent = view.FindViewById&lt;UrhoSurfacePlaceholder&gt;(Resource.Id.DroidModelId);
              parent.AddView(surface);
              droneModel = await surface.Show&lt;DroneModel&gt;(new ApplicationOptions("Data"));
  </code></pre>
  
  <p>But, what I need to do is create a view of some sort to incapsle the Urho code and reference it somehow like this:</p>
  
  <pre class="lang-xml prettyprint-override"><code>    &lt;My.App.Droid.Views.Drone.Model.DroneModelView
          android:id="@+id/DroneModel2"
          android:layout_marginTop="32dp"
          android:layout_marginLeft="32dp"
          android:layout_alignParentLeft="true"
          android:layout_alignParentTop="true"
          android:layout_width="55dp"
          android:layout_height="55dp"
          android:background="@null"/&gt;
  </code></pre>
  
  <p>And then grab it from the main activity view:</p>
  
  <pre class="lang-cs prettyprint-override"><code>droneModelView = FindViewById&lt;DroneModelView&gt;(Resource.Id.DroneModel2);
  </code></pre>
  
  <p>Since <code>UrhoSurface.CreateSurface</code> needs the Activity object I'm not sure how to best approch this - as far as I know there is no "clean" way to reach the activity from a class inherithing <code>ViewGroup</code>? The end goal is to show the 3D model in a view containing lots of other elements that are referenced in a similar fashion.</p>