Author Topic: Command or another method while starting application.  (Read 5952 times)

Offline MJaskowski

  • Newbie
  • *
  • Posts: 27
  • Karma: 0
Command or another method while starting application.
« on: March 07, 2019, 07:33:24 PM »
I'm looking for command or method which is firing while starting application, while we get main window.

What I need to reach? I want to open My Workspace after login agent immediately. I need something Create() method for MyWorkplaceContainerView.

To open MyWorkplace window I use this code
Code: [Select]
viewEventManager.Publish(new GenericEvent()
{
Target = GenericContainerView.ContainerView,
Context = "ToolbarWorksheet",
Action = new GenericAction[]
{
new GenericAction ()
{
Action = ActionGenericContainerView.ShowHidePanelRight,
Parameters = new object[] { Visibility.Visible, "MyWorkplaceContainerView" }
},
new GenericAction ()
{
Action = ActionGenericContainerView.ActivateThisPanel,
Parameters = new object[] { "MyWorkplaceContainerView" }
}
}
});

but I can use above code only when MyWorkplaceContainer is prepared so this is possible only after login. I can't find any command like ApplicationOpenCommand or something, do you know how can I reach it?

Thank you for all answers.




Offline MJaskowski

  • Newbie
  • *
  • Posts: 27
  • Karma: 0
Re: Command or another method while starting application.
« Reply #1 on: March 12, 2019, 11:23:08 PM »
Could you help me anyone?

I found ShowMainWindowEvent but I can't subscribe to this correctly - is here someone who knows something about how to do?


Matt

Offline Leon

  • Newbie
  • *
  • Posts: 8
  • Karma: 0
Re: Command or another method while starting application.
« Reply #2 on: March 13, 2019, 12:22:52 AM »
Have you tried this ??

Code: [Select]
//Constructor of my module
public CustomModule(IEventAggregator eventAggregator)
{
eventAggregator.GetEvent<ShowMainWindowEvent>().Subscribe(new Action<object>(ShowMainWindowEvents), ThreadOption.PublisherThread, true);
}

public void ShowMainWindowEvents(object obj)
{
     //Here my logic
}