I Want to write my own control, when the ctor is invoked, a MessageBox is shown.
public class Class1
{
public Class1()
{
ShowDialog();
}
I think I've found it. I had the same problem when creating messageboxes in any other threads besides the main thread. This is the C++ solution but I think you can convert it easily ;)
IAsyncOperation ^Op = msgbox->ShowAsync();
task( Op ).then([=](IUICommand^ C)
{
}).then([](task t)
{
try
{
t.get();
}
catch (Platform::Exception ^e)
{
//ERROR!
}
});
On a side note this is the correct way to handle ANY WinRT/Windows 8 Store C++ exception.