"Read-only" display on emdebed ViewPortControl in WPF app

Hi guys,

I am embedding a Rhino ViewPortControl in a WPF app and I am trying to change the display modes of it but it only displays in Wireframe mode.

I have this event handler which assigns the display mode selected in the UI to the _activeViewPort (RhinoViewport)

 private void RhinoDisplayModesCache_DisplayModeSelected(object sender, RhinoDisplayMode selectedDisplayMode)
 {
      var rhinoDisplayMode = DisplayModeDescription.GetDisplayMode(selectedDisplayMode.Id);

        _activeViewPort.DisplayMode = rhinoDisplayMode;
  }

RhinoDisplayMode is my own class, this does not really matter but Its worth clarifying to avoid any confusion.

In addition, RhinoViewport.ZoomExtents() seems to have no effect as well.

Is it possible to update a ViewportControl like I am trying to do?

@dale, @stevebaer do you guys have some info on this? or on any workarounds?

PS: This app runs within Revit

Thank you!

Nicholas

Here’s a sample that allows setting different display modes

1 Like