Esempio n. 1
0
        /// <inheritdoc/>
        protected override void OnValueDisassociated(FrameworkElement targetObject, BehaviorActionCollection <DependencyObject> oldValue)
        {
            base.OnValueDisassociated(targetObject, oldValue);

            Require.NotNull(targetObject, nameof(targetObject));

            targetObject.RemoveHandler(_routedEvent, (RoutedEventHandler)OnEvent);
        }
Esempio n. 2
0
        private void OnEvent(object sender, RoutedEventArgs e)
        {
            var targetObject = (DependencyObject)sender;

            BehaviorActionCollection <DependencyObject> actions = GetAttachment(targetObject, HostedActionsProperty);

            foreach (BehaviorAction <DependencyObject> action in actions)
            {
                if (!action.Execute())
                {
                    return;
                }
            }
        }