public static Position Convert(MahApps.Metro.Controls.Position position)
        {
            switch (position)
            {
            case MahApps.Metro.Controls.Position.Left:
                return(Position.LEFT);

            case MahApps.Metro.Controls.Position.Right:
                return(Position.RIGHT);

            case MahApps.Metro.Controls.Position.Top:
                return(Position.TOP);

            case MahApps.Metro.Controls.Position.Bottom:
            default:
                return(Position.BOTTOM);
            }
        }
 public static void AddFlyout <TView>(this Orchestra.Services.IFlyoutService flyoutService, string name, MahApps.Metro.Controls.Position position, Catel.MVVM.Providers.UnloadBehavior unloadBehavior = 1, MahApps.Metro.Controls.FlyoutTheme flyoutTheme = 0)
 {
 }
 public void AddFlyout(string name, System.Type viewType, MahApps.Metro.Controls.Position position, Catel.MVVM.Providers.UnloadBehavior unloadBehavior = 1, MahApps.Metro.Controls.FlyoutTheme flyoutTheme = 0)
 {
 }
Exemple #4
0
        internal void ApplyAnimation(MahApps.Metro.Controls.Position position, bool animateOpacity, bool resetShowFrame = true)
        {
            if (this.root == null || this.hideFrame == null || this.showFrame == null || this.hideFrameY == null || this.showFrameY == null || this.fadeOutFrame == null)
            {
                return;
            }
            if (this.Position == MahApps.Metro.Controls.Position.Left || this.Position == MahApps.Metro.Controls.Position.Right)
            {
                this.showFrame.Value = 0;
            }
            if (this.Position == MahApps.Metro.Controls.Position.Top || this.Position == MahApps.Metro.Controls.Position.Bottom)
            {
                this.showFrameY.Value = 0;
            }
            if (animateOpacity)
            {
                this.fadeOutFrame.Value = 0;
                if (!this.IsOpen)
                {
                    this.root.Opacity = 0;
                }
            }
            else
            {
                this.fadeOutFrame.Value = 1;
                this.root.Opacity       = 1;
            }
            switch (position)
            {
            case MahApps.Metro.Controls.Position.Right:
            {
                base.HorizontalAlignment = System.Windows.HorizontalAlignment.Right;
                base.VerticalAlignment   = System.Windows.VerticalAlignment.Stretch;
                this.hideFrame.Value     = this.root.ActualWidth;
                if (!resetShowFrame)
                {
                    break;
                }
                this.root.RenderTransform = new TranslateTransform(this.root.ActualWidth, 0);
                return;
            }

            case MahApps.Metro.Controls.Position.Top:
            {
                base.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
                base.VerticalAlignment   = System.Windows.VerticalAlignment.Top;
                this.hideFrameY.Value    = -this.root.ActualHeight - 1;
                if (!resetShowFrame)
                {
                    break;
                }
                this.root.RenderTransform = new TranslateTransform(0, -this.root.ActualHeight - 1);
                return;
            }

            case MahApps.Metro.Controls.Position.Bottom:
            {
                base.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
                base.VerticalAlignment   = System.Windows.VerticalAlignment.Bottom;
                this.hideFrameY.Value    = this.root.ActualHeight;
                if (!resetShowFrame)
                {
                    break;
                }
                this.root.RenderTransform = new TranslateTransform(0, this.root.ActualHeight);
                break;
            }

            default:
            {
                base.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
                base.VerticalAlignment   = System.Windows.VerticalAlignment.Stretch;
                this.hideFrame.Value     = -this.root.ActualWidth;
                if (!resetShowFrame)
                {
                    break;
                }
                this.root.RenderTransform = new TranslateTransform(-this.root.ActualWidth, 0);
                return;
            }
            }
        }