Beispiel #1
0
 private void PopupThumb_DragDelta(object sender, DragDeltaEventArgs e)
 {
     this.RootPopup.set_HorizontalOffset(this.RootPopup.get_HorizontalOffset() + e.get_HorizontalChange());
     this.RootPopup.set_VerticalOffset(this.RootPopup.get_VerticalOffset() + e.get_VerticalChange());
     Point point = this.BorderPathFigure.get_StartPoint();
     point.set_X(point.get_X() - e.get_HorizontalChange());
     point.set_Y(point.get_Y() - e.get_VerticalChange());
     this.BorderPathFigure.set_StartPoint(point);
 }
 private void ZoomThumb_DragDelta(object sender, DragDeltaEventArgs e)
 {
     double num = this.ZoomThumb.get_Margin().get_Left();
     double num2 = this.ZoomThumb.get_Margin().get_Top();
     double num3 = this.ZoomThumb.get_Margin().get_Right();
     double num4 = this.ZoomThumb.get_Margin().get_Bottom();
     num2 += e.get_VerticalChange();
     if (num2 < 0.0)
     {
         num2 = 0.0;
     }
     double num5 = (this.ThumbHeight + this.SpanHeight) * (this.ZoomLevelCount - 1);
     if (num2 > num5)
     {
         num2 = num5;
     }
     this.ZoomThumb.set_Margin(new Thickness(num, num2, num3, num4));
 }
Beispiel #3
0
        private void thumb_DragDelta(object sender, DragDeltaEventArgs e)
        {
            if (base.get_Parent() is Canvas)
            {
                double a = (double) base.GetValue(Canvas.LeftProperty);
                double num2 = (double) base.GetValue(Canvas.TopProperty);
                a += e.get_HorizontalChange();
                num2 += e.get_VerticalChange();
                if (a < 0.0)
                {
                    a = 0.0;
                }
                if (a > (base.get_Parent() as Canvas).get_ActualWidth())
                {
                    a = (base.get_Parent() as Canvas).get_ActualWidth() - base.get_ActualWidth();
                }
                if (num2 < 0.0)
                {
                    num2 = 0.0;
                }
                if (num2 > ((base.get_Parent() as Canvas).get_ActualHeight() - base.get_ActualHeight()))
                {
                    a = (base.get_Parent() as Canvas).get_ActualHeight() - base.get_ActualHeight();
                }
                base.SetValue(Canvas.LeftProperty, Math.Round(a));
                base.SetValue(Canvas.TopProperty, Math.Round(num2));
            }
            else
            {
                HorizontalAlignment alignment = (HorizontalAlignment) base.GetValue(FrameworkElement.HorizontalAlignmentProperty);
                VerticalAlignment alignment2 = (VerticalAlignment) base.GetValue(FrameworkElement.VerticalAlignmentProperty);
                double num3 = base.get_Margin().get_Left();
                double num4 = base.get_Margin().get_Right();
                double num5 = base.get_Margin().get_Top();
                double num6 = base.get_Margin().get_Bottom();
                switch (alignment)
                {
                    case 0:
                        num3 += e.get_HorizontalChange();
                        if (num3 < 0.0)
                        {
                            num3 = 0.0;
                        }
                        if (num3 > ((base.get_Parent() as Grid).get_ActualWidth() - base.get_ActualWidth()))
                        {
                            num3 = (base.get_Parent() as Grid).get_ActualWidth() - base.get_ActualWidth();
                        }
                        break;

                    case 2:
                        num4 -= e.get_HorizontalChange();
                        if (num4 < 0.0)
                        {
                            num4 = 0.0;
                        }
                        if (num4 > ((base.get_Parent() as Grid).get_ActualWidth() - base.get_ActualWidth()))
                        {
                            num4 = (base.get_Parent() as Grid).get_ActualWidth() - base.get_ActualWidth();
                        }
                        break;
                }
                switch (alignment2)
                {
                    case 0:
                        num5 += e.get_VerticalChange();
                        if (num5 < 0.0)
                        {
                            num5 = 0.0;
                        }
                        if (num5 > ((base.get_Parent() as Grid).get_ActualHeight() - base.get_ActualHeight()))
                        {
                            num5 = (base.get_Parent() as Grid).get_ActualHeight() - base.get_ActualHeight();
                        }
                        break;

                    case 2:
                        num6 -= e.get_VerticalChange();
                        if (num6 < 0.0)
                        {
                            num6 = 0.0;
                        }
                        if (num6 > ((base.get_Parent() as Grid).get_ActualHeight() - base.get_ActualHeight()))
                        {
                            num6 = (base.get_Parent() as Grid).get_ActualHeight() - base.get_ActualHeight();
                        }
                        break;
                }
                base.set_Margin(new Thickness(num3, num5, num4, num6));
            }
        }