Exemplo n.º 1
0
        /// <summary>
        /// Enables "minimize to tray" behavior for the specified Window.
        /// </summary>
        /// <param name = "window"><see cref="Window"/> to enable the behavior on.</param>
        /// <param name="windows">Additional <see cref="Window"/>s to enable the behavior on.</param>
        public static void Enable(Window window, params Window[] windows)
        {
            // No need to track this instance; its event handlers will keep it alive
            foreach (var w in windows.Prepend(window))
            {
                switch (w)
                {
                case InProgressWindow inProgress:
                    TrayIconProvider.FromInProgressWindow(inProgress);
                    break;

                default:
                    TrayIconProvider.FromWindow(w);
                    break;
                }
            }
        }