Use commands from other context in my custom context

Forum Forums Visual Components 4.1 .NET Addon Programming Use commands from other context in my custom context

This topic contains 2 replies, has 2 voices, and was last updated by Hunter-agt Hunter-agt 1 year, 3 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #5883
    Hunter-agt
    Hunter-agt
    Participant

    Hi,

    I’m trying to use the command Jog in my custom context but the only way I found how to make it work is by setting the context to Teach then execute the Jog command is there a way to not make the context or tab change and still be able to use Jog ?

    I currently do something like

    this.Context.SetContext(“Teach”);
    var cmd = IoC.Get<ICommandRegistry>();
    var extractCmd = cmd.FindItem(“Jog”);
    extractCmd.Execute();

    #5887
    Jay
    Jay
    Moderator

    Well, I think it makes sense that the jog command is only available on the teach context cause the command is only available on that context. That’ the way the application was designed. It seems, what you are asking is a way to circumvent that design and I’m wondering why.

    #5894
    Hunter-agt
    Hunter-agt
    Participant

    Considering this, you are right! I will move my panel into the context teach so I will be able to use Jog while using my custom panel.
    Thanks !

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.