I am trying to write a windows phone app and I want to invoke a delegate when a user wants performs an action. But the problem is the action has to be performed in the webpage and the event has to be handled inside the app. I know this is not a perfect design, but all I am doing is trying to explore ways to modify the data that is being passed from a webbrowser control back to the application.
This is my Question,
+---------------------------------------------+
| Inside App (C# Code Behind) |
| App Data. |
| |
| Delegate that handles the event. |
| ^ +----------------------+ |
| | |Webbrowser Control | |
| + | | |
| | | | |
| +------------+Action Performed | |
| | (HTML Control) |
| | | |
| | | |
| +----------------------+ |
| |
| |
+---------------------------------------------+
I am currently using window.external.notify(somestrings) and using reflection to invoke the method in the code behind. Other than passing around a string can I pass a generic Object
which when passed to C# code which can later be type cast to a delegate object which can then be invoked?
If not for delegates can I invoke the method that is part of the app in the code behind (C#) by just passing the function's name?