Beispiel #1
0
        public ObjectSelectPanel()
        {
            FlowDirection = FlowDirection.LeftToRight;
            AutoSize      = true;
            AutoSizeMode  = AutoSizeMode.GrowAndShrink;

            _Cameras = new LabeledControl <ComboBox>(new ComboBox(), "Camera:");
            Cameras.DropDownStyle         = ComboBoxStyle.DropDownList;
            Cameras.DisplayMember         = "Name";
            Cameras.SelectedIndexChanged += (s, e) => CameraChanged.Raise(s, e);
            Controls.Add(_Cameras);

            _BeamFlags = new LabeledControl <ComboBox>(new ComboBox(), "Beam Flags:");
            BeamFlags.DropDownStyle         = ComboBoxStyle.DropDownList;
            BeamFlags.DisplayMember         = "Name";
            BeamFlags.SelectedIndexChanged += (s, e) => BeamFlagsChanged.Raise(s, e);
            Controls.Add(_BeamFlags);
        }
Beispiel #2
0
        /// <summary>
        /// Called when one of the dependency properties has changed.
        /// </summary>
        protected override async void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
        {
            base.OnPropertyChanged(e);

            if (!GraphicsCore.IsInitialized)
            {
                return;
            }
            if (this.IsInDesignMode())
            {
                return;
            }

            if (e.Property == SeeingSharpRendererElement.SceneProperty)
            {
                m_renderLoop.SetScene(this.Scene);
                SceneChanged.Raise(this, EventArgs.Empty);
            }
            else if (e.Property == SeeingSharpRendererElement.CameraProperty)
            {
                m_renderLoop.Camera = this.Camera;
                CameraChanged.Raise(this, EventArgs.Empty);
            }
            else if (e.Property == SeeingSharpRendererElement.DrawingLayer2DProperty)
            {
                if (e.OldValue != null)
                {
                    await m_renderLoop.Deregister2DDrawingLayerAsync(e.OldValue as Custom2DDrawingLayer);
                }
                if (e.NewValue != null)
                {
                    await m_renderLoop.Register2DDrawingLayerAsync(e.NewValue as Custom2DDrawingLayer);
                }
                DrawingLayer2DChanged.Raise(this, EventArgs.Empty);
            }
        }