に渡すオブジェクトのコレクションItems
があります。everyを eachに直接渡したいと思います。どうやってやるの?JSection
LongListMultiSelector
JSection
controls:Section
ランタイム例外を引き起こす XAML:
<toolkit:LongListMultiSelector ItemsSource="{Binding Items}">
<toolkit:LongListMultiSelector.ItemTemplate>
<DataTemplate>
<controls:Section Data="{Binding}" />
</DataTemplate>
</toolkit:LongListMultiSelector.ItemTemplate>
</toolkit:LongListMultiSelector>
次の XAML を含む UserControl LongListMultiSelector
:
namespace Controls
{
public partial class RemoteHomePage : UserControl
{
public ObservableCollection<JSection> Items { get; set; }
public RemoteHomePage()
{
Items = new ObservableCollection<JSection> { };
Items.Add(new JSection { id = 2, name = "Section 2" });
Items.Add(new JSection { id = 1, name = "Section 1" });
Items.Add(new JSection { id = 3, name = "Section 3" });
InitializeComponent();
}
}
}
Section
クラス:
namespace Controls
{
public partial class Section : UserControl
{
public JSection Data { get; set; }
public Section()
{
InitializeComponent();
}
}
}
私が得る例外:
An exception of type 'System.ArgumentException' occurred in mscorlib.ni.dll and wasn't handled before a managed/native boundary
An exception of type 'System.IO.FileNotFoundException' occurred in Unknown Module. and wasn't handled before a managed/native boundary
An exception of type 'MS.Internal.NativeParseException' occurred in Unknown Module. and wasn't handled before a managed/native boundary
An exception of type 'System.Exception' occurred in Unknown Module. and wasn't handled before a managed/native boundary