C# 如何在WPF中更改ViewPort3D背景色?

C# 如何在WPF中更改ViewPort3D背景色?,c#,wpf,colors,background,viewport3d,C#,Wpf,Colors,Background,Viewport3d,我有viewport3d,我想更改其背景色 我对Wpf很陌生。我不知道从其他帖子上该怎么办。所以我在这里问 我更改了viewport3d的笔刷属性,但它没有任何作用 <Window x:Class="W3DTinker.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xa

我有viewport3d,我想更改其背景色

我对Wpf很陌生。我不知道从其他帖子上该怎么办。所以我在这里问

我更改了viewport3d的笔刷属性,但它没有任何作用

<Window x:Class="W3DTinker.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="800" Width="1200">
<Grid HorizontalAlignment="Left" Height="780" Margin="10,10,0,-21" VerticalAlignment="Top" Width="1180">
    <Viewport3D Grid.Row="0" Grid.Column="0" x:Name="Viewport" Margin="350,10,10,10" OpacityMask="{DynamicResource {x:Static SystemColors.AppWorkspaceBrushKey}}" />
</Grid>


Viewport3D
是一个控件,用于创建3D场景,以便将内容渲染到其中。它本身不显示任何内容。如果你想在它后面加一个背景色,那么就在它的父控件上设置背景色,在你的例子中,它是包含它的
网格。

这篇文章的可能副本没有回答我的问题@泽维尔