Ejemplo n.º 1
0
        private void UpdateFlyoutTheme()
        {
            FlyoutsControl flyoutsControl = this.TryFindParent <FlyoutsControl>();

            if (DesignerProperties.GetIsInDesignMode(this))
            {
                base.Visibility = (flyoutsControl != null ? System.Windows.Visibility.Collapsed : System.Windows.Visibility.Visible);
            }
            MetroWindow parentWindow = this.ParentWindow;

            if (parentWindow != null)
            {
                Tuple <AppTheme, Accent> tuple = Flyout.DetectTheme(this);
                if (tuple != null && tuple.Item2 != null)
                {
                    this.ChangeFlyoutTheme(tuple.Item2, tuple.Item1);
                }
                if (flyoutsControl != null && this.IsOpen)
                {
                    flyoutsControl.HandleFlyoutStatusChange(this, parentWindow);
                }
            }
        }