예제 #1
0
        public override void OnApplyTemplate()
        {
            if (Application.Current.Resources.Contains("CustomFrameWindowStyle"))
            {
                Style = Application.Current.Resources["CustomFrameWindowStyle"] as Style;
            }

            var minimizeButton = GetTemplateChild("minimizeButton") as Button;

            if (minimizeButton != null)
            {
                minimizeButton.Click += MinimizeClick;
            }

            var restoreButton = GetTemplateChild("restoreButton") as Button;

            if (restoreButton != null)
            {
                restoreButton.Click += RestoreClick;
            }

            var closeButton = GetTemplateChild("closeButton") as Button;

            if (closeButton != null)
            {
                closeButton.Click += CloseClick;
            }

            if (WindowCommands == null)
            {
                WindowCommands = new WindowCommands();
            }

            if (GlowEnabled)
            {
                _glowBehavior = new GlowWindowBehavior();
                _glowBehavior.Attach(this);
            }

            // VSADDA - Window Snap Behavior is not taking into account maximize and minimize when processing WM_MOVE events
            //          Disabling it until this is fixed correctly. This is a fix for PARAGONDP-830
            // var snapBehavior = new WindowSnapBehavior();
            // snapBehavior.Attach(this);

            base.OnApplyTemplate();
        }
예제 #2
0
 private void SetGlowEnabled(bool enabled)
 {
     if (enabled)
     {
         if (_glowBehavior == null)
         {
             _glowBehavior = new GlowWindowBehavior();
             _glowBehavior.Attach(this);
         }
     }
     else
     {
         if (_glowBehavior != null)
         {
             _glowBehavior.Detach();
             _glowBehavior = null;
         }
     }
 }