예제 #1
0
 protected override void OnAttached()
 {
     if (base.AssociatedObject != null && base.AssociatedObject.SaveWindowPosition)
     {
         IWindowPlacementSettings windowPlacementSettings = base.AssociatedObject.GetWindowPlacementSettings();
         WindowSettings.SetSave(base.AssociatedObject, windowPlacementSettings);
     }
 }
 protected override void OnAttached()
 {
     if (AssociatedObject != null && AssociatedObject.SaveWindowPosition)
     {
         // save with custom settings class or use the default way
         var windowPlacementSettings = this.AssociatedObject.GetWindowPlacementSettings();
         WindowSettings.SetSave(AssociatedObject, windowPlacementSettings);
     }
 }
        public void Initialize(Window window)
        {
            WindowSettings.SetSave(window, true);

            if (WindowChrome._IsCompositionEnabled)
            {
                WindowChrome.SetWindowChrome(window, new WindowChrome
                {
                    RoundCorners          = true,
                    RoundCornersRadius    = 8,
                    ClientBorderThickness = new Thickness(10, 100, 10, 30)
                });
            }
        }
        protected override void InitializeShell()
        {
            base.InitializeShell();
            var shell = (Shell)Shell;

            TextOptions.TextFormattingModeProperty.OverrideMetadata(
                typeof(Window),
                new FrameworkPropertyMetadata(TextFormattingMode.Display, FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender | FrameworkPropertyMetadataOptions.Inherits));

            WindowSettings.SetSave(shell, true);
            Application.Current.MainWindow = shell;

            if (!StartHidden)
            {
                Application.Current.MainWindow.Show();
            }

            Application.Current.MainWindow.WindowState = StartMinimized ? WindowState.Minimized : WindowState.Normal;
        }
예제 #5
0
 /// <summary>
 /// Called when behavior is being attached
 /// </summary>
 protected override void OnAttached()
 {
     WindowSettings.SetSave(AssociatedObject, AssociatedObject.SaveWindowPosition);
 }