Esempio n. 1
0
        public void Show(string title)
        {
            _item.DisableDelete(true);
            _item.DisableRename(true);

            if (_view != null)
            {
                if (!string.IsNullOrEmpty(title))
                {
                    _view.Title = title;
                }

                // show work list button clicked > we're already on UI thread
                _view.Activate();
                return;
            }

            ViewUtils.RunOnUIThread(() =>
            {
                _view = WorkListViewFactory.CreateView(_worklist);

                _view.Owner = System.Windows.Application.Current.MainWindow;

                if (!string.IsNullOrEmpty(title))
                {
                    _view.Title = title;
                }

                _view.Closed += _view_Closed;

                _view.Show();
            });
        }
Esempio n. 2
0
        private void _view_Closed(object sender, EventArgs e)
        {
            // an exception here can crash Pro
            ViewUtils.Try(() =>
            {
                if (_view == null)
                {
                    return;
                }

                // in WPF a closed window cannot be re-openend again
                _view.Closed -= _view_Closed;
                _view         = null;
                _item.DisableDelete(false);
                _item.DisableRename(false);
                // todo daro
                // set item to null?
            }, _msg);
        }