예제 #1
0
        private static TextBoxDragDropBehavior GetAttachedBehavior(TextBox listBox)
        {
            if (!instances.ContainsKey(listBox))
            {
                instances[listBox] = new TextBoxDragDropBehavior();
                instances[listBox].AssociatedObject = listBox;
            }

            return(instances[listBox]);
        }
		private static TextBoxDragDropBehavior GetAttachedBehavior(TextBox listBox)
		{
			if (!instances.ContainsKey(listBox))
			{
				instances[listBox] = new TextBoxDragDropBehavior();
				instances[listBox].AssociatedObject = listBox;
			}

			return instances[listBox];
		}
예제 #3
0
        public static void SetIsEnabled(DependencyObject obj, bool value)
        {
            TextBoxDragDropBehavior behavior = GetAttachedBehavior(obj as TextBox);

            behavior.AssociatedObject = obj as TextBox;

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