-1

As I mentioned in the title, the GridLine is not displayed in the Helixtoolkit MVVM instance. I couldn't find the source of the problem. My application is as follows.

        <HelixToolkit:HelixViewport3D ItemsSource="{Binding Objects}">

        <HelixToolkit:GridLinesVisual3D Width="600"
                                        Length="600"
                                        Thickness="0.1"
                                        MinorDistance="5"
                                        MajorDistance="10"
                                        Fill="Black"
                                        Visible="True" />

    </HelixToolkit:HelixViewport3D>
voltac
  • 33
  • 7

1 Answers1

0

This is because you are overwriting.

There are a few ways to resolve this:

Option 1: Include the GridLinesVisual3D in your Objects dynamically (possibly in your ViewModel) and not inside the HelixViewport3D in the XAML.

<hx:HelixViewport3D ItemsSource="{Binding Objects}"/>
//Pseudo code in ViewModel, depends on how you are using it or on the type of "Objects"...
var myGrid = new GridLinesVisual3D();
Objects.Add(myGrid);

Option 2: You can put a ModelVisual3D (or other container, which one to use really depends on what you are doing) and pass your objects to it while keeping the GridLinesVisual3D defined inside the HelixViewport3D.

<hx:HelixViewport3D>
    <hx:SunLight/>
    <hx:GridLinesVisual3D ... />
    <ModelVisual3D Content="{Binding myModelVisual3D.Content}"/> 
</hx:HelixViewport3D>
dwpessoa
  • 440
  • 4
  • 15