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

            return(instances[listBox]);
        }
コード例 #2
0
		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);
        }