Why is this XAML getting the error: Items collection must be empty before using ItemsSource

后端 未结 3 1300
鱼传尺愫
鱼传尺愫 2021-01-04 07:13

Can anyone conjure from this code why the ItemsSource line would be getting a

Items collection must be empty before using

3条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-04 07:44

    Your ItemsControl has a Button in it. Since there's already an item in the ItemsControl, it's not letting you set its ItemsSource property.

    Move the Button declaration down under the closing tag.

提交回复
热议问题