Пример #1
0
        private void EhTextureImageChanged()
        {
            var oldTexture = _doc.TextureImage;
            var newTexture = _view.TextureImage;

            if (newTexture is Altaxo.Main.ICopyFrom)
            {
                ((Altaxo.Main.ICopyFrom)newTexture).CopyFrom(oldTexture); // Try to keep the settings from the old texture
            }
            _doc.TextureImage = newTexture;
            _imageProxyController.InitializeDocument(_doc.TextureImage);
            if (null != _doc.TextureImage)
            {
                _textureScalingController.SourceTextureSize = GetSizeOfImageProxy(_doc.TextureImage);
            }
            OnMadeDirty();
        }
Пример #2
0
        protected override void Initialize(bool initData)
        {
            base.Initialize(initData);

            if (initData)
            {
                _imageProxyController = new Main.InstancePropertyController()
                {
                    UseDocumentCopy = UseDocument.Directly
                };
                _imageProxyController.MadeDirty += EhAdditionalPropertiesChanged;
                _imageProxyController.InitializeDocument(_doc.TextureImage);

                _textureScalingController = new TextureScalingController()
                {
                    UseDocumentCopy = UseDocument.Directly
                };
                _textureScalingController.MadeDirty += EhTextureScalingChanged;
                _textureScalingController.InitializeDocument(_doc.TextureScale);
                if (null != _doc.TextureImage)
                {
                    _textureScalingController.SourceTextureSize = GetSizeOfImageProxy(_doc.TextureImage);
                }
            }

            if (null != _view)
            {
                _view.RestrictBrushColorToPlotColorsOnly = _restrictBrushColorToPlotColorsOnly;

                _view.BrushType = _doc.BrushType;
                InitializeViewElementsWhenBrushTypeChanged();

                _imageProxyController.ViewObject     = _view.AdditionalPropertiesView;
                _textureScalingController.ViewObject = _view.TextureScalingView;

                EnableElementsInDependenceOnBrushType();
                _view.UpdatePreview(_doc);
            }
        }