private void OnLoaded(object sender, RoutedEventArgs e)
        {
            if (_glControl != null)
            {
                _renderingAdapter = new CompositeRenderingAdapter(_controller, ((CompositeRenderer)_renderer).D3DRenderer,
                                                                  ((CompositeRenderer)_renderer).D3DRenderer.Direct3DDevice, _glControl, _frameRate);
                direct3DControl.RegisterRenderer(_renderingAdapter, (int)ActualWidth, (int)ActualHeight);
            }
            direct3DControl.Loaded               += OnDirect3DControlLoaded;
            direct3DControl.SizeChanged          += OnSizeChanged;
            direct3DControl.MouseLeftButtonDown  += OnMouseLeftButtonDown;
            direct3DControl.MouseRightButtonDown += OnMouseRightButtonDown;
            direct3DControl.MouseLeftButtonUp    += OnMouseLeftButtonUp;
            direct3DControl.MouseRightButtonUp   += OnMouseRightButtonUp;
            direct3DControl.MouseMove            += OnMouseMoveD3D;
            direct3DControl.MouseWheel           += OnMouseWheel;
            direct3DControl.KeyDown              += OnKeyPress;

            //_controller.Load();
        }
    private void OnLoaded(object sender, RoutedEventArgs e)
    {
      if (_glControl != null)
      {
        _renderingAdapter = new CompositeRenderingAdapter(_controller, ((CompositeRenderer)_renderer).D3DRenderer,
          ((CompositeRenderer)_renderer).D3DRenderer.Direct3DDevice,  _glControl, _frameRate);
        direct3DControl.RegisterRenderer(_renderingAdapter, (int) ActualWidth, (int) ActualHeight);
      }
      direct3DControl.Loaded += OnDirect3DControlLoaded;
      direct3DControl.SizeChanged += OnSizeChanged;
      direct3DControl.MouseLeftButtonDown += OnMouseLeftButtonDown;
      direct3DControl.MouseRightButtonDown += OnMouseRightButtonDown;
      direct3DControl.MouseLeftButtonUp += OnMouseLeftButtonUp;
      direct3DControl.MouseRightButtonUp += OnMouseRightButtonUp;
      direct3DControl.MouseMove += OnMouseMoveD3D;
      direct3DControl.MouseWheel += OnMouseWheel;
      direct3DControl.KeyDown += OnKeyPress;

      //_controller.Load();
    }