本文整理汇总了C#中System.Windows.Controls.Primitives.DragDeltaEventArgs.get_HorizontalChange方法的典型用法代码示例。如果您正苦于以下问题:C# DragDeltaEventArgs.get_HorizontalChange方法的具体用法?C# DragDeltaEventArgs.get_HorizontalChange怎么用?C# DragDeltaEventArgs.get_HorizontalChange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.Primitives.DragDeltaEventArgs
的用法示例。
在下文中一共展示了DragDeltaEventArgs.get_HorizontalChange方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PopupThumb_DragDelta
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);
}
示例2: thumb_DragDelta
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));
}
}