static void OnCameraChanged(DependencyObject depObj, DependencyPropertyChangedEventArgs e) { Panel3D panel3D = depObj as Panel3D; Camera camera = e.NewValue as Camera; if (panel3D._viewport.Camera != camera) { panel3D._viewport.Camera = camera; } }
static void OnAllowTransparencyChanged(DependencyObject depObj, DependencyPropertyChangedEventArgs e) { Panel3D panel3D = depObj as Panel3D; var frontModel = panel3D._viewport.FrontModel; panel3D._viewport.AllowTransparency = (bool)e.NewValue; if (frontModel != null) { panel3D.BuildScene(frontModel); } }
void OnPanel3DLoaded(object sender, RoutedEventArgs e) { if (e.OriginalSource is Panel3D) { // Grab a reference to the Panel3D when it loads. _panel3D = e.OriginalSource as Panel3D; _panel3D.AllowTransparency = this.chkAllowTransparency.IsChecked ?? false; _panel3D.AutoAdjustOpacity = this.chkAutoAdjustOpacity.IsChecked ?? false; this.itemLayoutDirectionEditor.DataContext = _panel3D.ItemLayoutDirection; } }
void OnPanel3DLoaded(object sender, RoutedEventArgs e) { // Grab a reference to the Panel3D when it loads. _panel3D = sender as Panel3D; }