Beispiel #1
0
        private void AddLayer_Click(object sender, RoutedEventArgs e)
        {
            GroupLayer layer = Layer as GroupLayer;

            ColorLayer colorLayer = new ColorLayer();

            layer.AddLayer(colorLayer);
        }
Beispiel #2
0
        private void LayerType_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ColorPanel.Visibility    = Visibility.Collapsed;
            ImagePanel.Visibility    = Visibility.Collapsed;
            LightingPanel.Visibility = Visibility.Collapsed;

            ComboBoxItem item      = LayerTypeCombo.SelectedItem as ComboBoxItem;
            LayerType    layerType = (LayerType)item.Tag;

            if (Layer.LayerType != layerType)
            {
                Layer layer = null;
                switch (layerType)
                {
                case LayerType.Backdrop:
                {
                    layer = new BackdropLayer();
                }
                break;

                case LayerType.BackdropHost:
                {
                    layer = new BackdropHostLayer();
                }
                break;

                case LayerType.Color:
                {
                    layer = new ColorLayer();
                }
                break;

                case LayerType.Image:
                {
                    layer = new ImageLayer();
                }
                break;

                case LayerType.Lighting:
                {
                    layer = new LightingLayer();
                }
                break;

                case LayerType.Group:
                {
                    layer = new GroupLayer();
                }
                break;

                default:
                    Debug.Assert(false);
                    break;
                }

                // Set the new layer
                Layer.GroupLayer.ReplaceLayer(Layer, layer);

                Layer = layer;

                // Update the edit control UI
                UpdateUI();
            }
        }