GeometryModel3D.Material 属性

定义

获取或设置用于呈现此 GeometryModel3D 的正面的 Material

public:
 property System::Windows::Media::Media3D::Material ^ Material { System::Windows::Media::Media3D::Material ^ get(); void set(System::Windows::Media::Media3D::Material ^ value); };
public System.Windows.Media.Media3D.Material Material { get; set; }
member this.Material : System.Windows.Media.Media3D.Material with get, set
Public Property Material As Material

属性值

应用到 GeometryModel3DMaterial

示例

以下代码摘录将 SolidColorBrush 定义为 DiffuseMaterial GeometryModel3D 上的 。

<ModelVisual3D>
  <ModelVisual3D.Content>
    <GeometryModel3D Geometry="{StaticResource myTeapot}">
      <GeometryModel3D.Material>
        <DiffuseMaterial>
          <DiffuseMaterial.Brush>
            <SolidColorBrush Color="Blue" Opacity="1.0" />
          </DiffuseMaterial.Brush>
        </DiffuseMaterial>
      </GeometryModel3D.Material>
      <GeometryModel3D.Transform>
        <RotateTransform3D>
          <RotateTransform3D.Rotation>
            <AxisAngleRotation3D x:Name="myAngleRotation" Axis="0,3,0" Angle="1" />
          </RotateTransform3D.Rotation>
        </RotateTransform3D>
      </GeometryModel3D.Transform>
    </GeometryModel3D>
  </ModelVisual3D.Content>
</ModelVisual3D>

注解

依赖项属性信息

标识符字段 MaterialProperty
元数据属性设置为 true

适用于