HelixViewport3D's camera commands -- XAML bindings possible?

Oct 2, 2012 at 2:51 AM

I've gotten myself lost again. 

Well, not that lost; my application is using the HelixViewPort3D, which of course comes with the ViewCube and key bindings for orienting views. That's working perfectly. 

Now I have other UI elements *around* the HelixViewPort3D in the same UserControl which I'd like to configure to send commands to the HelixViewPort3D's camera controller. I had thought to do this with three buttons formatted something like this: 


            <dxb:BarButtonItem Content="XZ Front View" Command="{x:Static h:CameraController.FrontViewCommand}" CommandTarget="{Binding ElementName=VP, Path=CameraController}" />
... where VP is the name of the HelixViewPort3D in the same UserControl. It's not working. The buttons register in design mode as if the binding is correct (that is, the UI appearance goes from disabled to enabled) but at runtime the buttons behave as though CanExecute is returning false!

I'm not sure how to proceed, or whether it's possible. The CameraController exposes a RoutedCommand named "FrontViewCommand" so I thought this syntax would work. 

Any ideas? 

Oct 2, 2012 at 3:14 AM

Never mind; exactly those XAML bindings work... if the focus is on the ViewPort. This is the only Viewport in the control, though, so I'm not sure why an automatic CanExecute isn't being routed through...