Exemple #1
0
        /// <summary>
        /// Overriding to setup state.
        /// </summary>
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();
            MetroUI.EnsureTheme(this);
#if TRIAL
            InsertTrialMessage();
#endif
        }
Exemple #2
0
        /// <summary>
        /// Overriding to setup state.
        /// </summary>
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            MetroUI.EnsureTheme(this);

            var transitioningSelector = GetTemplateChild("TransitioningSelector") as TransitioningSelector;

            if (transitioningSelector != null)
            {
                transitioningSelector.SelectionChanged += HandleTransitioningSelectorSelectionChanged;
            }

            SetupIdentity();

            SetupDragDropHelper();

            var visualStateGroups   = VisualStateManager.GetVisualStateGroups(this);
            var animationStateGroup = visualStateGroups.OfType <VisualStateGroup>().Where(g => g.Name == "AnimationStates").FirstOrDefault();

            if (animationStateGroup != null)
            {
                var tileLeavingState = animationStateGroup.States.OfType <VisualState>().Where(s => s.Name == "TileViewLeaving").FirstOrDefault();
                if (tileLeavingState != null)
                {
                    foreach (var animation in tileLeavingState.Storyboard.Children)
                    {
                        animation.Bind(Timeline.DurationProperty, this, AnimationDurationProperty);
                    }
                }

                var tileEnteringState = animationStateGroup.States.OfType <VisualState>().Where(s => s.Name == "TileViewEntering").FirstOrDefault();
                if (tileEnteringState != null)
                {
                    foreach (var animation in tileEnteringState.Storyboard.Children)
                    {
                        animation.Bind(Timeline.DurationProperty, this, AnimationDurationProperty);
                    }
                }
            }

            AddHandler(MetroStartPage.RepositionedEvent, new RoutedEventHandler(HandlePageRepositioned));
            SetPageCanvasPositions();

#if TRIAL
            InsertTrialMessage();
#endif
        }
Exemple #3
0
 /// <summary>
 /// Overriding to setup state.
 /// </summary>
 public override void OnApplyTemplate()
 {
     base.OnApplyTemplate();
     MetroUI.EnsureTheme(this);
     Dispatcher.BeginInvoke(new Action(SetStatusBarInnerMargin), DispatcherPriority.ContextIdle);
 }