本文整理汇总了C#中System.Windows.Media.TranslateTransform.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# TranslateTransform.SetValue方法的具体用法?C# TranslateTransform.SetValue怎么用?C# TranslateTransform.SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Media.TranslateTransform
的用法示例。
在下文中一共展示了TranslateTransform.SetValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BeginTransition
/// <summary/>
protected override void BeginTransition(TransitionEventArgs e) {
AddBackSnapshot(e);
AddFrontSnapshot(e);
var prop = (Direction.IsHorizontal() ? TranslateTransform.XProperty : TranslateTransform.YProperty);
var value = 0.0;
switch (Direction) {
case MoveDirection.Up:
value = -e.Bounds.Height;
break;
case MoveDirection.Down:
value = +e.Bounds.Height;
break;
case MoveDirection.Left:
value = -e.Bounds.Width;
break;
case MoveDirection.Right:
value = +e.Bounds.Width;
break;
}
var txBack = new TranslateTransform();
txBack.SetValue(prop, 0.0);
e.BackSnapshot.RenderTransform = txBack;
AddAnimation(e, txBack, prop, 0.0, value);
var txFront = new TranslateTransform();
txFront.SetValue(prop, -value);
e.FrontSnapshot.RenderTransform = txFront;
AddAnimation(e, txFront, prop, -value, 0.0);
}
示例2: _content_SizeChanged
void _content_SizeChanged(object sender, SizeChangedEventArgs e)
{
FrameworkElement content = sender as FrameworkElement;
if (content != null)
{
TransformGroup tGroup = new TransformGroup();
TranslateTransform translate = new TranslateTransform();
translate.SetValue(FrameworkElement.NameProperty, "RollTransform" + Guid.NewGuid().ToString());
if (IsExpanded)
{
translate.Y = 0;
VisualStateManager.GoToState(this as Control, Expand, false);
}
else
{
translate.Y = -content.ActualHeight;
VisualStateManager.GoToState(this as Control, Collapse, false);
}
tGroup.Children.Add(translate);
content.RenderTransform = tGroup;
_RollUpStoryboardName = "RollUp" + Guid.NewGuid().ToString();
_RollDownStoryboardName = "RollDown" + Guid.NewGuid().ToString();
_SetupYTranslationStoryboard(translate, _RollUpStoryboardName, -content.ActualHeight);
_SetupYTranslationStoryboard(translate, _RollDownStoryboardName, 0);
}
}
示例3: SetPercentFromLeft
public static void SetPercentFromLeft(TranslateTransform element, double value)
{
element.SetValue(PercentFromLeftProperty, value);
}
示例4: SetOuterWidth
public static void SetOuterWidth(TranslateTransform element, double value)
{
element.SetValue(OuterWidthProperty, value);
}