示例#1
0
 void AttachToolbarEvents(SearchBar bar)
 {
     bar.Changed += (o, e) => {
         SearchEntryChanged?.Invoke(o, e);
     };
     bar.KeyPressed += (o, e) => {
         SearchEntryKeyPressed?.Invoke(o, e);
     };
     bar.LostFocus += (o, e) => {
         SearchEntryLostFocus?.Invoke(o, e);
     };
     bar.SelectionActivated += (o, e) => {
         SearchEntryActivated?.Invoke(o, e);
     };
     bar.LostFocus += (sender, e) => {
         exitAction?.Invoke();
     };
 }
示例#2
0
 void AttachToolbarEvents(SearchBar bar)
 {
     bar.PerformCommand += (o, e) => {
         PerformCommand?.Invoke(o, e);
     };
     bar.KeyPressed += (o, e) => {
         SearchEntryChanged?.Invoke(o, e);
     };
     bar.LostFocus += (o, e) => {
         SearchEntryLostFocus?.Invoke(o, e);
     };
     bar.SelectionActivated += (o, e) => {
         SearchEntryActivated?.Invoke(o, e);
     };
     bar.LostFocus += (sender, e) => {
         exitAction?.Invoke(Gtk.DirectionType.TabForward);
     };
 }