Display a stub indicating that the margin is not set.
상속: System.Windows.Controls.Control
        public CanvasPositionHandle(DesignItem adornedControlItem, AdornerPanel adornerPanel, HandleOrientation orientation)
        {
            Debug.Assert(adornedControlItem != null);
            this.adornedControlItem = adornedControlItem;
            this.adornerPanel       = adornerPanel;
            this.orientation        = orientation;

            Angle = (double)orientation;

            canvas          = (Canvas)adornedControlItem.Parent.Component;
            adornedControl  = (FrameworkElement)adornedControlItem.Component;
            Stub            = new MarginStub(this);
            ShouldBeVisible = true;

            leftDescriptor = DependencyPropertyDescriptor.FromProperty(Canvas.LeftProperty,
                                                                       adornedControlItem.Component.GetType());
            leftDescriptor.AddValueChanged(adornedControl, OnPropertyChanged);
            rightDescriptor = DependencyPropertyDescriptor.FromProperty(Canvas.RightProperty,
                                                                        adornedControlItem.Component.GetType());
            rightDescriptor.AddValueChanged(adornedControl, OnPropertyChanged);
            topDescriptor = DependencyPropertyDescriptor.FromProperty(Canvas.TopProperty,
                                                                      adornedControlItem.Component.GetType());
            topDescriptor.AddValueChanged(adornedControl, OnPropertyChanged);
            bottomDescriptor = DependencyPropertyDescriptor.FromProperty(Canvas.BottomProperty,
                                                                         adornedControlItem.Component.GetType());
            bottomDescriptor.AddValueChanged(adornedControl, OnPropertyChanged);
            widthDescriptor = DependencyPropertyDescriptor.FromProperty(Control.WidthProperty,
                                                                        adornedControlItem.Component.GetType());
            widthDescriptor.AddValueChanged(adornedControl, OnPropertyChanged);
            heightDescriptor = DependencyPropertyDescriptor.FromProperty(Control.WidthProperty,
                                                                         adornedControlItem.Component.GetType());
            heightDescriptor.AddValueChanged(adornedControl, OnPropertyChanged);
            BindAndPlaceHandle();
        }
예제 #2
0
		public CanvasPositionHandle(DesignItem adornedControlItem, AdornerPanel adornerPanel, HandleOrientation orientation)
		{
			Debug.Assert(adornedControlItem != null);
			this.adornedControlItem = adornedControlItem;
			this.adornerPanel = adornerPanel;
			this.orientation = orientation;

			Angle = (double) orientation;
			
			canvas = (Canvas) adornedControlItem.Parent.Component;
			adornedControl = (FrameworkElement) adornedControlItem.Component;
			Stub = new MarginStub(this);
			ShouldBeVisible = true;

			leftDescriptor = DependencyPropertyDescriptor.FromProperty(Canvas.LeftProperty,
			                                                           adornedControlItem.Component.GetType());
			leftDescriptor.AddValueChanged(adornedControl, OnPropertyChanged);
			rightDescriptor = DependencyPropertyDescriptor.FromProperty(Canvas.RightProperty,
			                                                            adornedControlItem.Component.GetType());
			rightDescriptor.AddValueChanged(adornedControl, OnPropertyChanged);
			topDescriptor = DependencyPropertyDescriptor.FromProperty(Canvas.TopProperty,
			                                                          adornedControlItem.Component.GetType());
			topDescriptor.AddValueChanged(adornedControl, OnPropertyChanged);
			bottomDescriptor = DependencyPropertyDescriptor.FromProperty(Canvas.BottomProperty,
			                                                             adornedControlItem.Component.GetType());
			bottomDescriptor.AddValueChanged(adornedControl, OnPropertyChanged);
			widthDescriptor = DependencyPropertyDescriptor.FromProperty(Control.WidthProperty,
			                                                            adornedControlItem.Component.GetType());
			widthDescriptor.AddValueChanged(adornedControl, OnPropertyChanged);
			heightDescriptor = DependencyPropertyDescriptor.FromProperty(Control.WidthProperty,
			                                                             adornedControlItem.Component.GetType());
			heightDescriptor.AddValueChanged(adornedControl, OnPropertyChanged);
			BindAndPlaceHandle();
		}
        public MarginHandle(DesignItem adornedControlItem, AdornerPanel adornerPanel, HandleOrientation orientation)
        {
            Debug.Assert(adornedControlItem != null);
            this.adornedControlItem = adornedControlItem;
            this.adornerPanel       = adornerPanel;
            this.orientation        = orientation;
            Angle           = (double)orientation;
            grid            = (Grid)adornedControlItem.Parent.Component;
            adornedControl  = (FrameworkElement)adornedControlItem.Component;
            Stub            = new MarginStub(this);
            ShouldBeVisible = true;
            BindAndPlaceHandle();

            adornedControlItem.PropertyChanged += OnPropertyChanged;
            OnPropertyChanged(this.adornedControlItem, new PropertyChangedEventArgs("HorizontalAlignment"));
            OnPropertyChanged(this.adornedControlItem, new PropertyChangedEventArgs("VerticalAlignment"));
        }
예제 #4
0
		public MarginHandle(DesignItem adornedControlItem, AdornerPanel adornerPanel, HandleOrientation orientation)
		{
			Debug.Assert(adornedControlItem!=null);
			this.adornedControlItem = adornedControlItem;
			this.adornerPanel = adornerPanel;
			this.orientation = orientation;
			Angle = (double)orientation;
			grid=(Grid)adornedControlItem.Parent.Component;
			adornedControl=(FrameworkElement)adornedControlItem.Component;
			Stub = new MarginStub(this);
			ShouldBeVisible=true;
			BindAndPlaceHandle();
			
			adornedControlItem.PropertyChanged += OnPropertyChanged;
			OnPropertyChanged(this.adornedControlItem, new PropertyChangedEventArgs("HorizontalAlignment"));
			OnPropertyChanged(this.adornedControlItem, new PropertyChangedEventArgs("VerticalAlignment"));
		}