예제 #1
0
        public void Show(Panel parentElement)
        {
            _tempDisabledElements.Clear();
            foreach (FrameworkElement element in parentElement.Children)
            {
                if (!element.IsEnabled)
                {
                    _tempDisabledElements.Add(element);
                }
                else
                {
                    element.IsEnabled = false;
                }
            }

            parentElement.Children.Add(this);
            Panel.SetZIndex(this, 999);

            if (ShowUnderCursor)
            {
                dockControl.VerticalAlignment   = VerticalAlignment.Top;
                dockControl.HorizontalAlignment = HorizontalAlignment.Left;
                Loaded += (o, e) => RefreshPosition();
            }
            DialogOpened?.Invoke(this, new EventsArgs <object>(contentControl.Content));
        }
예제 #2
0
        private bool?Show(ModalDialog dialog)
        {
            DialogOpened?.Invoke(this, EventArgs.Empty);
            dialog.Show();
            DialogClosed?.Invoke(this, EventArgs.Empty);

            return(dialog.Result);
        }
예제 #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="e"></param>
        protected virtual void OnDialogOpened(RoutedEventArgs e)
        {
            DialogOpened?.Invoke(this, e);

            string[] Paths;
            if (DialogProvider.Show(out Paths, BrowseTitle, BrowseMode, DialogProviderSelectionMode.Single, null, Text))
            {
                Text = Paths[0];
            }
        }
예제 #4
0
        /// <summary>
        ///
        /// </summary>
        protected virtual void OnDialogOpened()
        {
            DialogOpened?.Invoke(this, new EventArgs());

            var Path = string.Empty;

            if (Dialog.Show(out Path, BrowseTitle, BrowseMode, null, Text))
            {
                Text = Path;
            }
        }
예제 #5
0
        private async Task AddDialogAsync(IDialog dialog, CancellationToken cancellationToken)
        {
            await semaphore.WaitAsync();

            try
            {
                if (dialog is IActivate activatable && !activatable.IsActive)
                {
                    await ScreenExtensions.TryActivateAsync(dialog, cancellationToken);
                }

                if (Items.Contains(dialog))
                {
                    if (!instanceCounter.ContainsKey(dialog))
                    {
                        instanceCounter.Add(dialog, 0);
                    }

                    instanceCounter[dialog]++;
                    return;
                }

                var topMostDialog = OpenDialogs.LastOrDefault();
                if (topMostDialog != null)
                {
                    topMostDialog.IsDialogEnabled = false;
                }

                dialog.IsDialogEnabled = true;
                Items.Add(dialog);

                DialogOpened?.Invoke(this, dialog);
            }
            finally
            {
                semaphore.Release();
            }
        }
 protected void OnDialogOpened(object sender, SelectedDirectoryEventArgs e)
 {
     DialogOpened?.Invoke(sender, e);
 }