HelixViewport3D's camera commands -- XAML bindings possible?

Anonymous 9 years ago 0
This discussion was imported from CodePlex

RobPerkins wrote at 2012-10-02 04:51:

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? 

RobPerkins wrote at 2012-10-02 05:14:

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...