Exemple #1
0
 private void RegisterChildFrame(ModernFrame frame)
 {
     // do not register existing frame
     if (!GetChildFrames().Contains(frame))
     {
         var r = new WeakReference <ModernFrame>(frame);
         this.childFrames.Add(r);
     }
 }
Exemple #2
0
        /// <summary>
        /// When overridden in a derived class, is invoked whenever application code or internal processes call System.Windows.FrameworkElement.ApplyTemplate().
        /// </summary>
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            // retrieve BackgroundAnimation storyboard
            var border = GetTemplateChild(PART_WindowBorder) as Border;

            if (border != null)
            {
                this.backgroundAnimation = border.Resources["BackgroundAnimation"] as Storyboard;

                if (this.backgroundAnimation != null)
                {
                    this.backgroundAnimation.Begin();
                }
            }
            this.AdornerDecorator = GetTemplateChild(PART_AdornerLayer) as AdornerDecorator;
            this.NavigationTarget = GetTemplateChild(PART_ContentFrame) as ModernFrame;
        }
Exemple #3
0
 /// <summary>Helper for setting <see cref="NavigationTargetProperty"/> on <paramref name="element"/>.</summary>
 /// <param name="element"><see cref="DependencyObject"/> to set <see cref="NavigationTargetProperty"/> on.</param>
 /// <param name="value">NavigationTarget property value.</param>
 public static void SetNavigationTarget(this DependencyObject element, ModernFrame value)
 {
     element.SetValue(NavigationTargetProperty, value);
 }