Ejemplo n.º 1
0
        internal WindowContainer CreateOwnerContainer(WindowStartupLocation splashScreenStartupLocation)
        {
            WindowContainer result = null;

            if (splashScreenStartupLocation == WindowStartupLocation.CenterOwner)
            {
                result = new WindowArrangerContainer(Owner, SplashScreenLocation.CenterWindow)
                {
                    ArrangeMode = SplashScreenArrangeMode.ArrangeOnStartupOnly
                }
            }
            ;
            if (splashScreenStartupLocation == WindowStartupLocation.CenterScreen)
            {
                result = new WindowArrangerContainer(Owner, SplashScreenLocation.CenterScreen)
                {
                    ArrangeMode = SplashScreenArrangeMode.ArrangeOnStartupOnly
                }
            }
            ;
            if (result == null || !result.IsInitialized)
            {
                result = new WindowContainer(Owner);
            }

            return(result);
        }
    }
        static Window CreateSplashScreenWindow(object parameter)
        {
            object[] parameters                   = (object[])parameter;
            bool     useFadeEffect                = (bool)parameters[0];
            WindowArrangerContainer owner         = (WindowArrangerContainer)parameters[1];
            SplashScreenLock        lockMode      = (SplashScreenLock)parameters[2];
            IList <TimeSpan>        durations     = SplashScreenHelper.FindParameters <TimeSpan>(parameter);
            FlowDirection           flowDirection = SplashScreenHelper.FindParameter <FlowDirection>(parameter);
            Style windowStyle = SplashScreenHelper.FindParameter <Style>(parameter);
            var   window      = new LoadingDecoratorWindowFree(owner, lockMode);

            if (windowStyle != null)
            {
                window.Style = windowStyle;
            }
            else
            {
                window.ApplyDefaultSettings();
            }
            window.SetCurrentValue(FlowDirectionProperty, flowDirection);
            if (useFadeEffect && durations.Any(x => x.TotalMilliseconds > 0))
            {
                Interaction.GetBehaviors(window).Add(new WindowFadeAnimationBehavior()
                {
                    FadeInDuration = durations[0], FadeOutDuration = durations[1]
                });
            }

            return(window);
        }
 public LoadingDecoratorWindowFree(WindowArrangerContainer parentContainer, SplashScreenLock lockMode)
 {
     WindowStartupLocation = WindowStartupLocation.Manual;
     SetWindowStartupPosition(parentContainer.ControlStartupPosition.IsEmpty ? parentContainer.WindowStartupPosition : parentContainer.ControlStartupPosition);
     CreateLocker(parentContainer, lockMode);
     ClearValue(ShowActivatedProperty);
 }
            public LoadingDecoratorWindowFree(WindowArrangerContainer parentContainer, SplashScreenLock lockMode, bool useFadeEffect, TimeSpan fadeInDuration, TimeSpan fadeOutDuration)
            {
                ParentContainer = parentContainer;
                if (useFadeEffect)
                {
                    AnimationBehavior = new WindowFadeAnimationBehavior()
                    {
                        FadeInDuration = fadeInDuration, FadeOutDuration = fadeOutDuration
                    };
                    Interaction.GetBehaviors(this).Add(AnimationBehavior);
                }
                WindowStartupLocation = WindowStartupLocation.Manual;
                if (!LoadingDecorator.IsLoadedEx)
                {
                    Opacity = 0d;
                    LoadingDecorator.Loaded += OnLoadingDecoratorLoaded;
                    if (AnimationBehavior != null)
                    {
                        AnimationBehavior.ManualFadeIn = true;
                    }
                }
                var startupLocation = parentContainer.GetControlStartupRect(SplashScreenLocation.CenterContainer);

                if (startupLocation.IsEmpty)
                {
                    startupLocation = parentContainer.GetControlStartupRect(SplashScreenLocation.CenterWindow);
                }
                SetWindowStartupPosition(startupLocation);
                CreateLocker(parentContainer, lockMode);
                ClearValue(ShowActivatedProperty);
            }
Ejemplo n.º 5
0
 public LoadingDecoratorWindow(WindowArrangerContainer parentContainer, SplashScreenLock lockMode)
 {
     WindowStyle           = WindowStyle.None;
     AllowsTransparency    = true;
     Topmost               = false;
     Focusable             = false;
     ShowInTaskbar         = false;
     Background            = new SolidColorBrush(Colors.Transparent);
     SizeToContent         = SizeToContent.WidthAndHeight;
     WindowStartupLocation = WindowStartupLocation.Manual;
     SetWindowStartupPosition(parentContainer.ControlStartupPosition.IsEmpty ? parentContainer.WindowStartupPosition : parentContainer.ControlStartupPosition);
     CreateLocker(parentContainer, lockMode);
 }
Ejemplo n.º 6
0
        static Window CreateSplashScreenWindow(object parameter)
        {
            object[] parameters               = (object[])parameter;
            bool     useFadeEffect            = (bool)parameters[0];
            WindowArrangerContainer owner     = (WindowArrangerContainer)parameters[1];
            SplashScreenLock        lockMode  = (SplashScreenLock)parameters[2];
            IList <TimeSpan>        durations = SplashScreenHelper.FindParameters <TimeSpan>(parameter);
            var window = new LoadingDecoratorWindow(owner, lockMode);

            if (useFadeEffect && durations.Any(x => x.TotalMilliseconds > 0))
            {
                Interaction.GetBehaviors(window).Add(new WindowFadeAnimationBehavior()
                {
                    FadeInDuration = durations[0], FadeOutDuration = durations[1]
                });
            }

            return(window);
        }
Ejemplo n.º 7
0
 protected internal WindowArrangerBase(WindowArrangerContainer parent, SplashScreenLocation childLocation, SplashScreenArrangeMode arrangeMode)
 {
     this.childLocation = childLocation;
     this.arrangeMode   = arrangeMode;
     AttachParent(parent);
 }
Ejemplo n.º 8
0
 protected internal WindowArranger(WindowArrangerContainer parent, SplashScreenLocation childLocation, SplashScreenArrangeMode arrangeMode)
     : base(parent, childLocation, arrangeMode)
 {
 }
Ejemplo n.º 9
0
 public LoadingDecoratorWindowFree(WindowArrangerContainer parentContainer, SplashScreenLock lockMode) {
     WindowStartupLocation = WindowStartupLocation.Manual;
     SetWindowStartupPosition(parentContainer.ControlStartupPosition.IsEmpty ? parentContainer.WindowStartupPosition : parentContainer.ControlStartupPosition);
     CreateLocker(parentContainer, lockMode);
     ClearValue(ShowActivatedProperty);
 }
 public LoadingDecoratorWindow(WindowArrangerContainer parentContainer, SplashScreenLock lockMode) {
     WindowStyle = WindowStyle.None;
     AllowsTransparency = true;
     Topmost = false;
     Focusable = false;
     ShowInTaskbar = false;
     Background = new SolidColorBrush(Colors.Transparent);
     SizeToContent = SizeToContent.WidthAndHeight;
     WindowStartupLocation = WindowStartupLocation.Manual;
     SetWindowStartupPosition(parentContainer.ControlStartupPosition.IsEmpty ? parentContainer.WindowStartupPosition : parentContainer.ControlStartupPosition);
     CreateLocker(parentContainer, lockMode);
 }