这个Xamarin自定义渲染器教程中的CameraOptions类型是什么?

use*_*428 2 c# camera ios xamarin xamarin.forms

我很可能只是一个白痴,为此我提前道歉.无论如何,我正在尝试将相机功能添加到我的Xamarin.Forms(以iOS为中心)的应用程序中.

我在Xamarin的网站上找到了这个教程并且正在关注它(https://developer.xamarin.com/guides/xamarin-forms/custom-renderer/view/).

但是,我没有看到CameraOptions类型的定义 - 它为我抛出了一个错误,类似于"在此上下文中没有CameraOptions的定义".

我想我必须错过"使用"声明,但我想不出任何使用.

这是我开始感到困惑的代码的一部分:

public class CameraPreview : View
{
  public static readonly BindableProperty CameraProperty =
    BindableProperty.Create<CameraPreview, CameraOptions> (p => p.Camera, CameraOptions.Rear);

  public CameraOptions Camera {
    get { return (CameraOptions)GetValue (CameraProperty); }
    set { SetValue (CameraProperty, value); }
  }
}
Run Code Online (Sandbox Code Playgroud)

说真的.什么是CameraOptions类型?在整个教程中没有提到一次,它只是在代码中使用,所以我必须遗漏一些东西.

Jas*_*son 6

这是这里定义的枚举.该示例的整个源链接在页面顶部.