示例#1
0
        private bool OnWindowActivationChanged(object sender, EventHandler <WindowActivationChangedEventArgs> handler, bool showPopup)
        {
            var h = handler;

            if (h == null)
            {
                return(false);
            }

            var  window = sender as Window;
            Guid guid;

            if (myReferencedWindows.TryGetValue(window, out guid))
            {
                var args = new WindowActivationChangedEventArgs(guid, showPopup);
                h(this, args);
                return(args.ShowPopup);
            }
            return(showPopup);
        }
        private void WindowActivated(object sender, WindowActivationChangedEventArgs e)
        {
            // Window changed
            var previousWindowID = myCurrentWindowID;

            if (e.WindowID != myCurrentWindowID)
            {
                myCurrentWindowID = e.WindowID;
                var result = HandleWindowTransitionChange(previousWindowID);
                switch (result)
                {
                case HandleWindowTransitionResult.HidePopup:
                    e.ShowPopup = false;
                    break;

                case HandleWindowTransitionResult.ShowPopup:
                    e.ShowPopup = true;
                    break;
                }
            }
        }
 private void WindowDeactivated(object sender, WindowActivationChangedEventArgs e)
 {
 }