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

Offline MJaskowski

  • Newbie
  • *
  • Posts: 27
  • Karma: 0
Command or another method while starting application.
« on: March 07, 2019, 10:33:24 AM »
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]
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" }
}
}
});
[/code]

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, 02: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 12, 2019, 03:22:52 PM »
Have you tried this ??

[code]//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
}[/code]