Example #1
0
        /// <summary>
        ///
        /// </summary>
        private void SetContainerInvalidation()
        {
            var context = DataContext as EditorContext;

            if (context == null)
            {
                return;
            }

            var container = context.Editor.Project.CurrentContainer;

            if (container == null)
            {
                return;
            }

            foreach (var layer in container.Layers)
            {
                layer.InvalidateLayer += (s, e) => _drawable.Invalidate();
            }

            if (container.WorkingLayer != null)
            {
                container.WorkingLayer.InvalidateLayer += (s, e) => _drawable.Invalidate();
            }

            if (container.HelperLayer != null)
            {
                container.HelperLayer.InvalidateLayer += (s, e) => _drawable.Invalidate();
            }
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        private void InvalidateContainer()
        {
            SetContainerInvalidation();

            var context = DataContext as EditorContext;

            if (context == null || context.Editor.Project == null)
            {
                _drawable.Invalidate();
            }
            else
            {
                var container = context.Editor.Project.CurrentContainer;
                if (container != null)
                {
                    container.Invalidate();
                }
            }
        }