I am new to WP8/c#, overloaded with new information and definetly missing something.
I have wp8 application that uses native code library. How can i notify UI about changes from native code? I understood that i cannot pass callbacks from c# function to to native c++ on wp8. Simple code below illustrates what i want:
MainPage cs
namespace phoneapp
{
public partial class MainPage : PhoneApplicationPage
{
testRT _testrt;
public MainPage()
{
_testrt= new testRT();
}
private void btnTest_Click(object sender, RoutedEventArgs e)
{
_testrt->foo();
}
}
}
runtime component cpp
namespace rtc
{
public ref class testRT sealed
{
public:
testRT();
void foo();
private:
test* _test;
};
}
testRT::testRT()
{
_test= new test();
}
testRT::foo()
{
_test->foothread();
}
native class cpp
test::test()
{
}
test::~test()
{
}
void test::foothread()
{
signal_UI_status("started");
while (notfinished)
{
//do something
...
signal_UI_results("found %i results", res);
}
signal_UI_status("finished");
}
What is the best way to implement such "signal" functionality on windows phone? callback? namedpipe? socket?