Skip to content

How to access public method declared in App.xaml.cs? #510

Answered by pbanosdev
pbanosdev asked this question in Q&A
Discussion options

You must be logged in to vote

As I mentioned, the solution was pretty much dumb.

Only thing I did was implement a Singleton initialization in App class;

private static App _instance;

(will implement synclocks for concurrency problems)
public static aXetChatControl Instance
{
get
{
return _instance;
}
}

//wherever your App ToolWindow is completely initialized
_instance = this;

Now access App.Instance from everywhere

Apologies for the thread, I'll mark it as solved.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by pbanosdev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant