Ejemplo n.º 1
0
        private static CanvasDragDropBehavior GetAttachedBehavior(Canvas canvas)
        {
            if (!instances.ContainsKey(canvas))
            {
                instances[canvas] = new CanvasDragDropBehavior();
                instances[canvas].AssociatedObject = canvas;
            }

            return(instances[canvas]);
        }
Ejemplo n.º 2
0
		private static CanvasDragDropBehavior GetAttachedBehavior(Canvas canvas)
		{
			if (!instances.ContainsKey(canvas))
			{
				instances[canvas] = new CanvasDragDropBehavior();
				instances[canvas].AssociatedObject = canvas;
			}

			return instances[canvas];
		}
Ejemplo n.º 3
0
        public static void SetIsEnabled(DependencyObject obj, bool value)
        {
            CanvasDragDropBehavior behavior = GetAttachedBehavior(obj as Canvas);

            behavior.AssociatedObject = obj as Canvas;

            if (value)
            {
                behavior.Initialize();
            }
            else
            {
                behavior.CleanUp();
            }
            obj.SetValue(IsEnabledProperty, value);
        }