Example #1
0
        void InitializeSmartEvent()
        {
            _selected               = new SmartEvent <GenListItemEventArgs>(this, this.RealHandle, "selected", GenListItemEventArgs.CreateFromSmartEvent);
            _unselected             = new SmartEvent <GenListItemEventArgs>(this, this.RealHandle, "unselected", GenListItemEventArgs.CreateFromSmartEvent);
            _activated              = new SmartEvent <GenListItemEventArgs>(this, this.RealHandle, "activated", GenListItemEventArgs.CreateFromSmartEvent);
            _pressed                = new SmartEvent <GenListItemEventArgs>(this, this.RealHandle, "pressed", GenListItemEventArgs.CreateFromSmartEvent);
            _released               = new SmartEvent <GenListItemEventArgs>(this, this.RealHandle, "released", GenListItemEventArgs.CreateFromSmartEvent);
            _doubleClicked          = new SmartEvent <GenListItemEventArgs>(this, this.RealHandle, "clicked,double", GenListItemEventArgs.CreateFromSmartEvent);
            _expanded               = new SmartEvent <GenListItemEventArgs>(this, this.RealHandle, "expanded", GenListItemEventArgs.CreateFromSmartEvent);
            _realized               = new SmartEvent <GenListItemEventArgs>(this, this.RealHandle, "realized", GenListItemEventArgs.CreateFromSmartEvent);
            _unrealized             = new SmartEvent <GenListItemEventArgs>(this, this.RealHandle, "unrealized", GenListItemEventArgs.CreateFromSmartEvent);
            _longpressed            = new SmartEvent <GenListItemEventArgs>(this, this.RealHandle, "longpressed", GenListItemEventArgs.CreateFromSmartEvent);
            _moved                  = new SmartEvent <GenListItemEventArgs>(this, this.RealHandle, "moved", GenListItemEventArgs.CreateFromSmartEvent);
            _movedAfter             = new SmartEvent <GenListItemEventArgs>(this, this.RealHandle, "moved,after", GenListItemEventArgs.CreateFromSmartEvent);
            _movedBefore            = new SmartEvent <GenListItemEventArgs>(this, this.RealHandle, "moved,before", GenListItemEventArgs.CreateFromSmartEvent);
            _scrollAnimationStarted = new SmartEvent(this, this.RealHandle, "scroll,anim,start");
            _scrollAnimationStopped = new SmartEvent(this, this.RealHandle, "scroll,anim,stop");
            _changed                = new SmartEvent(this, this.RealHandle, "changed");

            _selected.On += (s, e) => { if (e.Item != null)
                                        {
                                            ItemSelected?.Invoke(this, e);
                                        }
            };
            _unselected.On += (s, e) => { if (e.Item != null)
                                          {
                                              ItemUnselected?.Invoke(this, e);
                                          }
            };
            _activated.On += (s, e) => { if (e.Item != null)
                                         {
                                             ItemActivated?.Invoke(this, e);
                                         }
            };
            _pressed.On += (s, e) => { if (e.Item != null)
                                       {
                                           ItemPressed?.Invoke(this, e);
                                       }
            };
            _released.On += (s, e) => { if (e.Item != null)
                                        {
                                            ItemReleased?.Invoke(this, e);
                                        }
            };
            _doubleClicked.On += (s, e) => { if (e.Item != null)
                                             {
                                                 ItemDoubleClicked?.Invoke(this, e);
                                             }
            };
            _expanded.On += (s, e) => { if (e.Item != null)
                                        {
                                            ItemExpanded?.Invoke(this, e);
                                        }
            };
            _realized.On += (s, e) => { if (e.Item != null)
                                        {
                                            ItemRealized?.Invoke(this, e);
                                        }
            };
            _unrealized.On += (s, e) => { if (e.Item != null)
                                          {
                                              ItemUnrealized?.Invoke(this, e);
                                          }
            };
            _longpressed.On += (s, e) => { if (e.Item != null)
                                           {
                                               ItemLongPressed?.Invoke(this, e);
                                           }
            };
            _moved.On += (s, e) => { if (e.Item != null)
                                     {
                                         ItemMoved?.Invoke(this, e);
                                     }
            };
            _movedAfter.On += (s, e) => { if (e.Item != null)
                                          {
                                              ItemMovedAfter?.Invoke(this, e);
                                          }
            };
            _movedBefore.On += (s, e) => { if (e.Item != null)
                                           {
                                               ItemMovedBefore?.Invoke(this, e);
                                           }
            };
        }
Example #2
0
        void InitializeSmartEvent()
        {
            _selected      = new SmartEvent <GenGridItemEventArgs>(this, this.RealHandle, "selected", GenGridItemEventArgs.CreateFromSmartEvent);
            _unselected    = new SmartEvent <GenGridItemEventArgs>(this, this.RealHandle, "unselected", GenGridItemEventArgs.CreateFromSmartEvent);
            _activated     = new SmartEvent <GenGridItemEventArgs>(this, this.RealHandle, "activated", GenGridItemEventArgs.CreateFromSmartEvent);
            _pressed       = new SmartEvent <GenGridItemEventArgs>(this, this.RealHandle, "pressed", GenGridItemEventArgs.CreateFromSmartEvent);
            _released      = new SmartEvent <GenGridItemEventArgs>(this, this.RealHandle, "released", GenGridItemEventArgs.CreateFromSmartEvent);
            _doubleClicked = new SmartEvent <GenGridItemEventArgs>(this, this.RealHandle, "clicked,double", GenGridItemEventArgs.CreateFromSmartEvent);
            _realized      = new SmartEvent <GenGridItemEventArgs>(this, this.RealHandle, "realized", GenGridItemEventArgs.CreateFromSmartEvent);
            _unrealized    = new SmartEvent <GenGridItemEventArgs>(this, this.RealHandle, "unrealized", GenGridItemEventArgs.CreateFromSmartEvent);
            _longpressed   = new SmartEvent <GenGridItemEventArgs>(this, this.RealHandle, "longpressed", GenGridItemEventArgs.CreateFromSmartEvent);
            _focused       = new SmartEvent <GenGridItemEventArgs>(this, this.RealHandle, "item,focused", GenGridItemEventArgs.CreateFromSmartEvent);
            _unfocused     = new SmartEvent <GenGridItemEventArgs>(this, this.RealHandle, "item,unfocused", GenGridItemEventArgs.CreateFromSmartEvent);
            _changed       = new SmartEvent(this, this.RealHandle, "changed");

            _selected.On += (s, e) => { if (e.Item != null)
                                        {
                                            ItemSelected?.Invoke(this, e);
                                        }
            };
            _unselected.On += (s, e) => { if (e.Item != null)
                                          {
                                              ItemUnselected?.Invoke(this, e);
                                          }
            };
            _activated.On += (s, e) => { if (e.Item != null)
                                         {
                                             ItemActivated?.Invoke(this, e);
                                         }
            };
            _pressed.On += (s, e) => { if (e.Item != null)
                                       {
                                           ItemPressed?.Invoke(this, e);
                                       }
            };
            _released.On += (s, e) => { if (e.Item != null)
                                        {
                                            ItemReleased?.Invoke(this, e);
                                        }
            };
            _doubleClicked.On += (s, e) => { if (e.Item != null)
                                             {
                                                 ItemDoubleClicked?.Invoke(this, e);
                                             }
            };
            _realized.On += (s, e) => { if (e.Item != null)
                                        {
                                            ItemRealized?.Invoke(this, e);
                                        }
            };
            _unrealized.On += (s, e) => { if (e.Item != null)
                                          {
                                              ItemUnrealized?.Invoke(this, e);
                                          }
            };
            _longpressed.On += (s, e) => { if (e.Item != null)
                                           {
                                               ItemLongPressed?.Invoke(this, e);
                                           }
            };
            _focused.On += (s, e) => { if (e.Item != null)
                                       {
                                           ItemFocused?.Invoke(this, e);
                                       }
            };
            _unfocused.On += (s, e) => { if (e.Item != null)
                                         {
                                             ItemUnfocused?.Invoke(this, e);
                                         }
            };
            _changed.On += (s, e) => { Changed?.Invoke(this, e); };
        }