Ejemplo n.º 1
0
        /// <summary>
        /// Shows the busy indicator with the specified mode.
        /// </summary>
        protected virtual void ShowBusyIndicator()
        {
            if (!InitializeBusyIndicator())
            {
                return;
            }

            // If equal and already visible, just exit
            if (_containerPopup.IsOpen)
            {
                return;
            }

            _containerPopup.IsOpen = true;

            PropertyHelper.TrySetPropertyValue(_busyIndicator, "IsIndeterminate", true);
            _busyIndicator.Visibility = Visibility.Visible;

            var currentWindow = Window.Current;

            if (currentWindow != null)
            {
                var windowContent = currentWindow.Content as FrameworkElement;
                if (windowContent != null)
                {
                    windowContent.UpdateLayout();
                    windowContent.IsHitTestVisible = false;
                    EffectsHelper.Dimm(windowContent);
                }
            }

            _containerPopup.UpdateLayout();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Hides this please wait window.
        /// </summary>
        public void Hide()
        {
            var dispatcher = DispatcherHelper.CurrentDispatcher;

            if (!dispatcher.HasThreadAccess)
            {
                dispatcher.BeginInvoke(Hide);
                return;
            }

            if (!InitializeBusyIndicator())
            {
                return;
            }

            _busyIndicator.Visibility = Visibility.Collapsed;
            _containerPopup.IsOpen    = false;

            var currentWindow = Window.Current;

            if (currentWindow != null)
            {
                var windowContent = currentWindow.Content as FrameworkElement;
                if (windowContent != null)
                {
                    EffectsHelper.Undimm(windowContent);
                    windowContent.IsHitTestVisible = true;
                }
            }

            _showCounter = 0;
        }