이것은 XAML을 사용하여 처음으로 8 점포 앱을 얻었으므로 몇 가지 사항이 확실하지 않습니다. 데이터를 gridview에 바인딩하고 싶습니다. 이렇게하려면, 난 내가 그룹 데이터를 Gridview 창에 저장합니다. 앱을 저장합니다.
protected override void LoadState(Object navigationParameter, Dictionary<String, Object> pageState)
{
// TODO: Assign a bindable collection of items to this.DefaultViewModel["Items"]
Model.Utility util = new Utility();
var categories = util.GetCategoryList(); // this returns List<Category>
this.DefaultViewModel["Items"] = categories;
}
가, 뒤에 코드에서
class Category
{
public int Id { get; set; }
public string CategoryName { get; set; }
public string IconPath { get; set; }
}
을 내 XAML은 다음과 같습니다
<!-- Horizontal scrolling grid used in most view states -->
<GridView
x:Name="itemGridView"
AutomationProperties.AutomationId="ItemsGridView"
AutomationProperties.Name="Items"
TabIndex="1"
Grid.RowSpan="2"
Padding="116,136,116,46"
ItemsSource="{Binding Source={StaticResource itemsViewSource}}"
ItemTemplate="{StaticResource Standard250x250ItemTemplate}"
SelectionMode="None"
IsSwipeEnabled="false"/>
하지만 난이 프로그램을 실행할 때 모든 데이터를 볼 해달라고 앱. 내가 어디에서 잘못 했니?
정말 멋지다. 건배 m8. :) 그것은 작동합니다. – kandroid