/// <summary>
        ///     Creates an attached event member with custom logic.
        /// </summary>
        public static INotifiableAttachedBindingMemberInfo <TTarget, object> CreateEvent <TTarget>([NotNull] string path, Action <TTarget, MemberAttachedEventArgs> memberAttachedHandler = null)
        {
            var eventMember = new AttachedBindingMemberInfo <TTarget, object>(path, typeof(Delegate),
                                                                              memberAttachedHandler, null, null, GetBindingMemberValue, (info, target, arg3) =>
            {
                return(EventListenerList.GetOrAdd(target, ((IAttachedBindingMemberInternal)info).Id).AddWithUnsubscriber((IEventListener)arg3[0]));
            }, null, null, BindingMemberType.Event);

            eventMember.RaiseAction = (@internal, target, arg3) => EventListenerList.Raise(target, @internal.Id, arg3);
            return(eventMember);
        }
            public bool OnMenuItemClick(IMenuItem item)
            {
#if API8SUPPORT
                item = _item;
#endif
                if (item.IsCheckable)
                {
                    IsCheckedMenuItemMember.SetValue(item, !item.IsChecked);
                }
                EventListenerList.Raise(item, Key, EventArgs.Empty);
                return(true);
            }
 public bool OnMenuItemClick(IMenuItem item)
 {
     if (_item == null)
     {
         return(false);
     }
     item = _item;
     if (item.IsCheckable)
     {
         item.SetBindingMemberValue(AttachedMembers.MenuItem.IsChecked, !item.IsChecked);
     }
     EventListenerList.Raise(item, Key, EventArgs.Empty);
     return(true);
 }
 private static void TextDidChangeNotification(NSNotification nsNotification)
 {
     EventListenerList.Raise(nsNotification.Object, TextChangedEvent, EventArgs.Empty);
 }
Пример #5
0
 private static void Raise(IMenuItem item)
 {
     EventListenerList.Raise(item, Key, EventArgs.Empty);
 }
 public static void Raise(IBindingMemberInfo m, TTarget target, object arg3)
 {
     EventListenerList.Raise(target, GetMemberPath((IAttachedBindingMemberInternal)m), arg3);
 }
Пример #7
0
 private static void OnErrorsChanged(DependencyObject sender, ICollection <object> errors)
 {
     EventListenerList.Raise(sender, ErrorsObserverKey, EventArgs.Empty);
 }
Пример #8
0
 private static void Raise(DatePicker picker)
 {
     EventListenerList.Raise(picker, Key, EventArgs.Empty);
 }