Пример #1
0
        /// <summary>
        /// 有参构造
        /// </summary>
        public ShowContentWindowAction(ShowContentWindowMessage message)
            : this()
        {
            ContentMessage  = message;
            Args            = message.Args;
            CallBackCommand = message.CallBackCommand;
            Content         = message.Content;
            Title           = message.Title;
            Icon            = message.Icon;
            ContentMargin   = message.ContentMargin;
            Height          = message.Height;
            Width           = message.Width;
            ContentName     = message.ContentName;
            IsModal         = true;
            WindowType      = message.WindowType;
            WindowAnimation = message.WindowAnimation;
            PositionX       = message.PositionX;
            PositionY       = message.PositionY;
            if (message.TileBackground == null)
            {
                BrushConverter brushConverter = new BrushConverter();
                Brush          brush          = (Brush)brushConverter.ConvertFromString("#20C1D3");
                message.TileBackground = brush;
            }

            TileBackground = message.TileBackground;

            switch (WindowType)
            {
            case ContentWindowType.Document:
                WindowState = WindowState.Maximized;
                IsModal     = message.IsModal;
                break;

            case ContentWindowType.Common:
                WindowState   = WindowState.Maximized;
                BorderMargin  = message.BorderMargin;
                ContentMargin = message.ContentMargin;
                ResizeMode    = message.ResizeMode;
                MinHeight     = message.MinHeight;
                MinWidth      = message.MinWidth;
                IsModal       = message.IsModal;
                WindowState   = message.WindowState;
                break;

            case ContentWindowType.ToolBox:
                IsModal = message.IsModal;
                break;
            }
        }
Пример #2
0
        public ShowContentWindowMessage(string contentType, string title, ContentWindowAnimation WindowAnimation = ContentWindowAnimation.FadeIn)
        {
            ContentName  = contentType;
            Title        = title;
            IsModal      = true;
            BorderMargin = new Thickness(-1);
            ResizeMode   = ResizeMode.CanResize;
            Height       = Double.NaN;
            Width        = Double.NaN;
            MinHeight    = 150;
            MinWidth     = 300;

            WindowType           = ContentWindowType.Common;
            this.WindowAnimation = WindowAnimation;
        }