Skip to content

Instantly share code, notes, and snippets.

@mfakane
Created January 13, 2012 23:01
Show Gist options
  • Save mfakane/1609233 to your computer and use it in GitHub Desktop.
Save mfakane/1609233 to your computer and use it in GitHub Desktop.
Silverlight Toolkit for Windows Phone に含まれる TurnstileTransition の回転の基準点がシステムと違い左端ぴったりで違和感があるのを補正
using System.Windows;
using System.Windows.Data;
using System.Windows.Media;
using Controls = Microsoft.Phone.Controls;
namespace Linearstar.Lavis.Presentation
{
public class TurnstileTransition : Controls.TransitionElement
{
Controls.TurnstileTransition inner = new Controls.TurnstileTransition();
public static readonly DependencyProperty ModeProperty = DependencyProperty.Register("Mode", typeof(Controls.TurnstileTransitionMode), typeof(TurnstileTransition), new PropertyMetadata(Controls.TurnstileTransitionMode.ForwardIn));
public Controls.TurnstileTransitionMode Mode
{
get
{
return (Controls.TurnstileTransitionMode)GetValue(ModeProperty);
}
set
{
SetValue(ModeProperty, value);
}
}
public TurnstileTransition()
{
BindingOperations.SetBinding(inner, Controls.TurnstileTransition.ModeProperty, new Binding("Mode")
{
Source = this,
});
}
public override Controls.ITransition GetTransition(UIElement element)
{
var rt = inner.GetTransition(element);
((PlaneProjection)element.Projection).CenterOfRotationX = -0.1;
return rt;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment