示例#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;
            }
        }
        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);
 }