Created
January 13, 2012 23:01
-
-
Save mfakane/1609233 to your computer and use it in GitHub Desktop.
Silverlight Toolkit for Windows Phone に含まれる TurnstileTransition の回転の基準点がシステムと違い左端ぴったりで違和感があるのを補正
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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