c# - Unable to access methods and classes from my project in Windows Runtime Component in UWP -


i create background task synchronize data server background task using windows runtime component in uwp app.

but, unable access methods , classes project in windows runtime component in uwp.

is there alternate way create background task without windows runtime component? or how can able access classes.

you can create class library , add reference winmd , project class. code of class library like:

    public class bridgeclass {   public static event action<string> messagereceived;    public static void broadcast(string message)   {       if (messagereceived != null) messagereceived(message);   } } 

inside project class can subscribe event

bridgeclass.messagereceived += showmessage; 

and make realization:

void showmessage(string msg) { }    

now winmd class call it:

bridgeclass.broadcast("some value");  

Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -