Ejemplo n.º 1
0
        /// <summary>
        /// Switches the current center node for the one passed in as a parameter.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">Arguments describing the routed event.</param>
        private static void OnSwitchCenterNodeCommand(object sender, ExecutedRoutedEventArgs e)
        {
            PhotoExplorerControl  photoExplorer = sender as PhotoExplorerControl;
            PhotoExplorerBaseNode nextNode      = e.Parameter as PhotoExplorerBaseNode;

            var pNode = nextNode as PhotoExplorerPhotoNode;
            PhotoExplorerBaseNode overrideNode = null;

            if (pNode != null)
            {
                if (pNode.Photo != null)// && pNode.Photo.PhotoUrlBig.Contains("profile"))
                {
                    if (pNode.RelatedNodes.Count == 1)
                    {
                        overrideNode = pNode.RelatedNodes[0];
                    }
                }
            }

            if (photoExplorer != null && nextNode != null)
            {
                if (nextNode == photoExplorer.CenterNode)
                {
                    if (photoExplorer.CenterNode.Content != null)
                    {
                        ServiceProvider.ViewManager.NavigationCommands.NavigateToContentCommand.Execute(photoExplorer.CenterNode.Content);
                    }
                }
                else
                {
                    photoExplorer.CenterNode = overrideNode ?? nextNode;
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a new animation to hide the provided node.
        /// </summary>
        /// <param name="node">The node to hide.</param>
        /// <param name="owner">The PhotoExplorerControl containing the node.</param>
        /// <returns>A new DoubleAnimation that hides the provided node.</returns>
        private static DoubleAnimation GetNewHideAnimation(NodePresenter node, PhotoExplorerControl owner)
        {
            DoubleAnimation hideAnimation = new DoubleAnimation(0, NodeHideAnimationDuration);

            hideAnimation.FillBehavior = FillBehavior.Stop;
            HideAnimationManager hideAnimationManager = new HideAnimationManager(owner, node);

            hideAnimation.Completed += new EventHandler(hideAnimationManager.CompletedHandler);
            hideAnimation.Freeze();
            return(hideAnimation);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the HideAnimationManager class.
 /// </summary>
 /// <param name="owner">The owning PhotoExplorerControl.</param>
 /// <param name="nodePresenter">The NodePresenter being hidden.</param>
 public HideAnimationManager(PhotoExplorerControl owner, NodePresenter nodePresenter)
 {
     this.owner         = owner;
     this.nodePresenter = nodePresenter;
 }