I'm developing for Windows 8 WinRT framework. The following sample code throws an exception:
Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
Is this one more bug in the current WinRT framework (I'm using VS11 and Consumer Preview)? Has someone an idea how to solve this problem?
Btw: I have tested the same code with Windows Phone 7.5 Silverlight and it works without problems...
Thanks for your help.
public class MyListBox : ListBox
{
}
public sealed partial class BlankPage : Page
{
public BlankPage()
{
this.InitializeComponent();
}
protected override void OnNavigatedTo(NavigationEventArgs e)
{
var box1 = new ListBox();
box1.ItemsSource = new List<Object> { new Object() }; // works without problems
Content = box1;
var box2 = new MyListBox();
box2.ItemsSource = new List<Object> { new Object() }; // throws exception
Content = box2;
}
}