Skip to content

Calling javascript funtion on pressing Native Windows Xaml Button #11448

Discussion options

You must be logged in to vote

Something like:

In App.xaml.cs:

void InstanceCreated(object sender, InstanceCreatedEventArgs args)
{
this.ReactContext = args.Context;
}

public IReactContext ReactContext {get; set;}

In App()

add:
InstanceSettings.InstanceCreated += InstanceCreated

Then in your button handler you can use (Application.Current as App).ReactContext

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@hunainhumail-purevpn
Comment options

@acoates-ms
Comment options

Answer selected by hunainhumail-purevpn
@hunainhumail-purevpn
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants