Question

Hi all i have a frame code as such

<Frame Name="wow" Width="1200" Height="600" ></Frame>

When i click on a button, it loads it with a url as such

wow.Source=(new Uri("http://www.google.com"));

It works when i throw it into a grid, it appears just fine however when i throw it into a viewport2dvisual3d container, it doesn't appear.

  <Viewport2DVisual3D.Visual >
    <Grid Width="1200" Height="600" Name="frontPanel" Background="Blue">
      <Frame Name="wow" Width="1200" Height="600" ></Frame>            
        </Grid>                   
          </Viewport2DVisual3D.Visual>

The frame isn't even visible. I do see my mouse changing to a loading symbol for a few seconds but i still cant seem to see the frame.

Is this a bug? or do i have to do something to make the frame appear in a viewport2dvisual3d which is within a viewport 3d?

Was it helpful?

Solution

So far what I can see you are missing the Geometry and the Material for Viewport2DVisual3D and Viewport2DVisual3D.IsVisualHostMaterial for Material

full example for Viewport2DVisual3D object

    <Viewport2DVisual3D>
        <Viewport2DVisual3D.Geometry>
            <MeshGeometry3D Positions="-1,1,0 -1,-1,0 1,-1,0 1,1,0"
                            TextureCoordinates="0,0 0,1 1,1 1,0"
                            TriangleIndices="0 1 2 0 2 3" />
        </Viewport2DVisual3D.Geometry>
        <Viewport2DVisual3D.Material>
            <DiffuseMaterial Viewport2DVisual3D.IsVisualHostMaterial="True" />
        </Viewport2DVisual3D.Material>
            <Grid Width="1200" Height="600" Name="frontPanel" Background="Blue">
               <Frame Name="wow" Width="1200" Height="600" ></Frame>
            </Grid>
    </Viewport2DVisual3D>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top