Beispiel #1
0
            private void OnToolTipOpening(object sender, ToolTipEventArgs e)
            {
                AssertIsForeground();

                Debug.Assert(_element.ToolTip == this);
                Debug.Assert(_disposableToolTip == null);

                _disposableToolTip = _createToolTip();
                _element.ToolTip   = _disposableToolTip.ToolTip;
            }
Beispiel #2
0
            private void OnToolTipClosing(object sender, ToolTipEventArgs e)
            {
                AssertIsForeground();

                Debug.Assert(_disposableToolTip != null);
                Debug.Assert(_element.ToolTip == _disposableToolTip.ToolTip);

                _element.ToolTip = this;

                _disposableToolTip.Dispose();
                _disposableToolTip = null;
            }
Beispiel #3
0
            private void OnToolTipOpening(object sender, ToolTipEventArgs e)
            {
                try
                {
                    AssertIsForeground();

                    Debug.Assert(_element.ToolTip == this);
                    Debug.Assert(_disposableToolTip == null);

                    _disposableToolTip = _createToolTip();
                    _element.ToolTip   = _disposableToolTip.ToolTip;
                }
                catch (Exception ex) when(FatalError.ReportAndCatch(ex))
                {
                    // Do nothing, since this is a WPF event handler and propagating the exception would cause a crash
                }
            }