Exemplo n.º 1
0
        private void SetEffect(LayerEffect target, LayerEffect source, bool isDragDrop)
        {
            if (source != target)
            {
                var old = target.Copy(false) as LayerEffect;
                old._layer = this;

                LayerEffect @new = null;

                @new = source.Copy(isDragDrop);
                if (isDragDrop)
                {
                    @new.PartFromTo(source);
                }
                else
                {
                    @new.FromTo(source);
                }
                //@new.FromTo(source, isDragDrop);

                @new.ShapeLayer = source.ShapeLayer;

                var type = source.Type;
                this[type] = @new;

                OnPropertyChanged(_.GetEffectPropertyName(type), @new, old);
            }
        }
                public void FromTo(LayerEffect effect)
                {
                    bool isAddNewEffect = _layerEffect.IsEmpty;

                    _layerEffect      = effect.Copy(isAddNewEffect);
                    _layerEffect.Left = this.Left;
                    if (isAddNewEffect)
                    {
                        LoadEffect();
                    }
                }
                public LayerEffect Copy(bool isAddNewEffect)
                {
                    StoreEffect();

                    return(_layerEffect.Copy(isAddNewEffect));
                }