I always wondered how NavigationTransitionInfo-s work if they have no publicly exposed animation/navigation data.Looking at the public definition of NavigationTransitionInfo WinRT class, it appears that it implements only 2 interfaces, INavigationTransitionInfo and INavigationTransitionInfoOverridesINavigationTransitionInfo is totally empty
However, none of these 2 function seem to hold the animation dataSo I guessed that there must be another hidden interface used to hold the animation data, so I assumed that it must be called something like INavigationTransitionInfoPrivate or INavigationTransitionInfoInternalSo I started searching for the dll that implements the NavigationTransitionInfo WinRT class, after some search in Registry I found that it’s in Windows.UI.Xaml.Phone.dllI dropped that dll in IDA Pro and started searching for “INavigationTransitionInfoPrivate”And YES! there was actually an interface with that name!Here comes ADeltaX’s big help, he showed me how to get the GUID and how to locate the vftable and the interface member functionsBig thanks to ADeltaX!Now, we have the GUID (1ab93e41-46d2-4a19-b20a-e8d042fe5740) and member functions and their signatures:
Created custom NavigationTransitionInfo class called CustomPageTransitionTest that inherits from NavigationTransitionInfo and INavigationTransitionInfoPrivate:
Copy
public class CustomPageTransitionTest : NavigationTransitionInfo, INavigationTransitionInfoPrivate{ void INavigationTransitionInfoPrivate.CreateStoryboards(UIElement pElement, NavigationTrigger trigger, IList<Storyboard> pStoryboards) { switch (trigger) { case NavigationTrigger.NavigatingAway: break; case NavigationTrigger.NavigatingTo: break; case NavigationTrigger.BackNavigatingAway: break; case NavigationTrigger.BackNavigatingTo: break; } } //For some reasons, this is required in some cases... protected override string GetNavigationStateCore() { return base.GetNavigationStateCore() ?? "0"; }}
Everything looks perfect, right? NoThere’s no exception and the navigation waits for the Storyboard to finish but… no animation shows on screen.It turns out that the API doesn’t animate the provided UIElement directly but another IFrameworkElementTargetElement (private property?) of UIElement returned using the helper GetLogicalTargetElement private function instead.Unfortunately I wasn’t able to RE the function because many information about it was stripped out from the public symbols.But luckily some NavigationTransitionInfo-s use the PropertyPath(UIElement.TransitionTarget) instead so we can use that.So using that PropertyPath I was able to rewrite the code to use it instead: