Updating FOV from bound code

Dec 20, 2011 at 5:02 PM

I have the field of view of a perspective camera bound to a int variable in the code behind. Right now, it will not update the field of view until I "flick" the mouse with the right mouse button. Just rotating around will not cause the update. Is there something, perhaps a function that I can call, to force the camera FOV to update automatically?

Dec 21, 2011 at 9:36 PM

Sorry, I don't understand the problem here.

Here is an example binding the FieldOfView property of a PerspectiveCamera to a Slider

                <helix:CubeVisual3D SideLength="4" Fill="Blue"/>
                	<PerspectiveCamera FieldOfView="{Binding Value, ElementName=FieldOfViewSlider}"/>
        <StackPanel HorizontalAlignment="Left" VerticalAlignment="Top" Margin="8">
                <Slider Name="FieldOfViewSlider" Value="45" Minimum="10" Maximum="160" Width="200"/>
Binding to a property in the DataContext should work the same way. Are you raising INotifyPropertyChanged events?

Dec 21, 2011 at 9:45 PM

Let me see if I can clarify...I am an idiot and forgot to raise a propertychanged event. It works just fine now.