Example #1
0
 private void CreatePopup()
 {
     if (_popup == null)
     {
         _popup = new ContextActionsBulbPopup(_editor.TextArea)
         {
             CommandProvider = GetActionCommand
         };
         // TODO: workaround to refresh menu with latest document
         _popup.MenuOpened += async(sender, args) =>
         {
             if (await LoadActionsWithCancellationAsync().ConfigureAwait(true))
             {
                 _popup.ItemsSource = _actions;
             }
         };
         _popup.MenuClosed += (sender, args) =>
         {
             _editor.Dispatcher.InvokeAsync(() => _editor.Focus(), DispatcherPriority.Background);
         };
     }
 }
Example #2
0
 public ActionCommandConverter(ContextActionsBulbPopup owner)
 {
     _owner = owner;
 }