Beispiel #1
0
        /// <summary>
        /// Handles an InteractorRemoved event, and removes the interactor from the WpfEyeXHost's
        /// repository of interactors.
        /// </summary>
        /// <param name="sender">The sender of the OnInteractorRemoved event.</param>
        /// <param name="args">The <see cref="ElementEventArgs"/>.</param>
        private void OnInteractorRemoved(object sender, ElementEventArgs args)
        {
            var element = args.Element;
            var interactor = element.GetWpfInteractor();

            lock (_lock)
            {
                _interactors.Remove(interactor.Id);
                _interactorsHaveChanged = true;
            }
        }
Beispiel #2
0
        /// <summary>
        /// Handles an InteractorAdded event, and adds the interactor to the WpfEyeXHost's
        /// repository of interactors.
        /// </summary>
        /// <param name="sender">The sender of the OnInteractorAdded event.</param>
        /// <param name="args">The <see cref="ElementEventArgs"/>.</param>
        private void OnInteractorAdded(object sender, ElementEventArgs args)
        {
            var element = args.Element;
            var interactor = element.GetWpfInteractor();

            lock (_lock)
            {
                _interactors.Add(interactor.Id, new WeakReference(interactor));
                _interactorsHaveChanged = true;
            }
        }